By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
AIModelKitAIModelKitAIModelKit
  • Home
  • News
    NewsShow More
    SpaceXAI’s Grok Tool Uploading Users’ Entire Codebase to Cloud Storage: What You Need to Know
    SpaceXAI’s Grok Tool Uploading Users’ Entire Codebase to Cloud Storage: What You Need to Know
    4 Min Read
    New York Leads the Way: First State to Enforce One-Year Moratorium on New AI Data Centers
    New York Leads the Way: First State to Enforce One-Year Moratorium on New AI Data Centers
    4 Min Read
    AI Replacing New York Nurses: Why Patients Should be Concerned About Quality of Care
    AI Replacing New York Nurses: Why Patients Should be Concerned About Quality of Care
    5 Min Read
    Navigating AI Agent Crawlers and Cloudflare’s New Rules: A Comprehensive Guide
    Navigating AI Agent Crawlers and Cloudflare’s New Rules: A Comprehensive Guide
    5 Min Read
    How Apple’s Self-Driving Car Program Paved the Way for Advanced AI Chip Technology
    How Apple’s Self-Driving Car Program Paved the Way for Advanced AI Chip Technology
    4 Min Read
  • Open-Source Models
    Open-Source ModelsShow More
    GlucoFM: Advanced Foundation Model for Continuous Glucose Monitoring Insights
    GlucoFM: Advanced Foundation Model for Continuous Glucose Monitoring Insights
    5 Min Read
    AgentHands: Creating Interactive Hand Gestures for Enhanced Conversations with Spatially Grounded Agents in XR
    AgentHands: Creating Interactive Hand Gestures for Enhanced Conversations with Spatially Grounded Agents in XR
    5 Min Read
    Exploring How Mobility Enhances Language Models’ Understanding of Location
    Exploring How Mobility Enhances Language Models’ Understanding of Location
    5 Min Read
    Optimize Candidate Biomarkers with Our AI Tool for Wearable Sensor Data Analysis
    Optimize Candidate Biomarkers with Our AI Tool for Wearable Sensor Data Analysis
    4 Min Read
    Beyond BMI: Assessing Cardiometabolic Risk Using Smartphone Images
    Beyond BMI: Assessing Cardiometabolic Risk Using Smartphone Images
    5 Min Read
  • Guides
    GuidesShow More
    Your Comprehensive Guide to Practical Constraint Decoding: Basics and Applications
    Your Comprehensive Guide to Practical Constraint Decoding: Basics and Applications
    6 Min Read
    KDnuggets Weekly Data Science News Roundup: Highlights from July 20, 2026
    KDnuggets Weekly Data Science News Roundup: Highlights from July 20, 2026
    4 Min Read
    Unlock Your AI Potential with Kaggle and Google’s Free 5-Day Agentic AI Course
    Unlock Your AI Potential with Kaggle and Google’s Free 5-Day Agentic AI Course
    6 Min Read
    Top 5 High-Performance MCP Servers for Optimal Agentic Development
    Top 5 High-Performance MCP Servers for Optimal Agentic Development
    6 Min Read
    Top 5 Free Resources for Understanding Agentic AI: Unlock Your Knowledge
    Top 5 Free Resources for Understanding Agentic AI: Unlock Your Knowledge
    6 Min Read
  • Tools
    ToolsShow More
    Unlock Agentic Coding: Experimenting with Qwen 3.8-Flash-Next on NVIDIA GB300 NVL72
    Unlock Agentic Coding: Experimenting with Qwen 3.8-Flash-Next on NVIDIA GB300 NVL72
    6 Min Read
    Unlock Agentic Coding: Experimenting with Qwen 3.8 Flash-Next 176B Model on NVIDIA GB300 NVL72
    Unlock Agentic Coding: Experimenting with Qwen 3.8 Flash-Next 176B Model on NVIDIA GB300 NVL72
    5 Min Read
    Optimizing LFM2.5 Q4_0 Checkpoints through Quantization-Aware Distillation Techniques
    Optimizing LFM2.5 Q4_0 Checkpoints through Quantization-Aware Distillation Techniques
    4 Min Read
    Deploy Qwen 3.8-2.4T-A95B: A Configurable 2.4T Parameter Model on NVIDIA GB300 NVL72 for Enhanced Reasoning
    Deploy Qwen 3.8-2.4T-A95B: A Configurable 2.4T Parameter Model on NVIDIA GB300 NVL72 for Enhanced Reasoning
    6 Min Read
    Optimize Your AI Models with Baseten on Hugging Face Inference Providers 🔥
    Optimize Your AI Models with Baseten on Hugging Face Inference Providers 🔥
    5 Min Read
  • Events
    EventsShow More
    Exploring the Future of EdTech: Highlights from the ‘Best of ISTE’ Virtual Playground
    Exploring the Future of EdTech: Highlights from the ‘Best of ISTE’ Virtual Playground
    4 Min Read
    Empowering Veteran Students: Effective Teaching Strategies in Technology and Learning
    Empowering Veteran Students: Effective Teaching Strategies in Technology and Learning
    4 Min Read
    NVIDIA Partners with NSF to Enhance AI Research and Education Through State and Regional AI Hubs Across the US
    NVIDIA Partners with NSF to Enhance AI Research and Education Through State and Regional AI Hubs Across the US
    5 Min Read
    South Korea Unveils AI Future at AI Summit with NVIDIA and Strategic Partners
    South Korea Unveils AI Future at AI Summit with NVIDIA and Strategic Partners
    5 Min Read
    NVIDIA Launches First Open-Source GPU-Accelerated Framework for Medical Physics Simulations
    NVIDIA Launches First Open-Source GPU-Accelerated Framework for Medical Physics Simulations
    5 Min Read
  • Ethics
    EthicsShow More
    AI Giants Warn: Impending Cybersecurity Crisis Looms in Just Months
    AI Giants Warn: Impending Cybersecurity Crisis Looms in Just Months
    6 Min Read
    Assessing the Environmental Impact of Data Centres: Are We Finally Acknowledging the Consequences?
    Assessing the Environmental Impact of Data Centres: Are We Finally Acknowledging the Consequences?
    5 Min Read
    Survey Reveals Surprising Impact of AI on Job Losses: Insights from Workers
    Survey Reveals Surprising Impact of AI on Job Losses: Insights from Workers
    6 Min Read
    Understanding DAO-to-DAO Voting: On-Chain and Off-Chain Mechanisms Explored
    Understanding DAO-to-DAO Voting: On-Chain and Off-Chain Mechanisms Explored
    5 Min Read
    Taiwan Prosecutes Nine Individuals for Smuggling Advanced AI Servers to China: A Tech Industry Update
    Taiwan Prosecutes Nine Individuals for Smuggling Advanced AI Servers to China: A Tech Industry Update
    4 Min Read
  • Comparisons
    ComparisonsShow More
    InternBootcamp: Enhancing LLM Reasoning Through Verifiable Task Scaling Techniques
    InternBootcamp: Enhancing LLM Reasoning Through Verifiable Task Scaling Techniques
    4 Min Read
    Enhancing Anomaly Detection in Collider Experiments through Contrastive Learning for Better Interpretability
    Enhancing Anomaly Detection in Collider Experiments through Contrastive Learning for Better Interpretability
    6 Min Read
    Exploring the Impact of Quantization on Self-Explanations in Large Language Models: Can LLMs Explain Themselves?
    Exploring the Impact of Quantization on Self-Explanations in Large Language Models: Can LLMs Explain Themselves?
    5 Min Read
    CytoNet: A Foundation Model for Understanding the Human Cerebral Cortex at Cellular Resolution
    CytoNet: A Foundation Model for Understanding the Human Cerebral Cortex at Cellular Resolution
    5 Min Read
    Optimizing Nonconvex-Nonconcave Min-Max Problems with a Limited Maximization Domain: Insights from [2110.03950]
    Optimizing Nonconvex-Nonconcave Min-Max Problems with a Limited Maximization Domain: Insights from [2110.03950]
    5 Min Read
Search
  • Privacy Policy
  • Terms of Service
  • Contact Us
  • FAQ / Help Center
  • Advertise With Us
  • Latest News
  • Model Comparisons
  • Tutorials & Guides
  • Open-Source Tools
  • Community Events
© 2025 AI Model Kit. All Rights Reserved.
Reading: Optimizing Dynamic Kernel Selection with KleidiAI and Quantized Tied Embeddings in PyTorch
Share
Notification Show More
Font ResizerAa
AIModelKitAIModelKit
Font ResizerAa
  • 🏠
  • 🚀
  • 📰
  • 💡
  • 📚
  • ⭐
Search
  • Home
  • News
  • Models
  • Guides
  • Tools
  • Ethics
  • Events
  • Comparisons
Follow US
  • Latest News
  • Model Comparisons
  • Tutorials & Guides
  • Open-Source Tools
  • Community Events
© 2025 AI Model Kit. All Rights Reserved.
AIModelKit > Tools > Optimizing Dynamic Kernel Selection with KleidiAI and Quantized Tied Embeddings in PyTorch
Tools

Optimizing Dynamic Kernel Selection with KleidiAI and Quantized Tied Embeddings in PyTorch

aimodelkit
Last updated: August 8, 2025 6:28 am
aimodelkit
Share
Optimizing Dynamic Kernel Selection with KleidiAI and Quantized Tied Embeddings in PyTorch
SHARE

TorchAO: Elevating Low-Bit Inference on Arm CPUs

TorchAO is revolutionizing the way we implement high-performance low-bit linear and embedding operators specifically targeted for Arm CPUs. In our latest update, we’re thrilled to announce three pivotal advancements: dynamic kernel selection, integration with Arm’s KleidiAI library, and support for quantized tied embeddings. These enhancements are crafted to supercharge performance while broadening the scope for low-bit inference in PyTorch, particularly with ExecuTorch, PyTorch’s innovative solution for efficient on-device execution.

Contents
  • Dynamic Kernel Selection
    • How It Works
    • Active Kernels
  • KleidiAI Integration
  • Quantized Tied Embedding and lm_head Kernels
  • Try It Out and Contribute!

For example, leveraging KleidiAI kernels has led to an astonishing improvement—over 2x enhancement in prefill performance on a 4-bit quantized Llama1B model running on an M1 Mac, achieving speeds of 373 tokens per second!

Dynamic Kernel Selection

One of the standout features introduced in TorchAO is dynamic kernel selection. Our low-bit operators now adeptly select the most suitable kernel based on:

  • The format of packed weights
  • CPU capabilities, such as has_arm_neon_dot and has_arm_i8mm
  • The dimensions of the activation tensor

This dynamic dispatch mechanism ensures optimized execution tailored to the unique characteristics of both the hardware and workload.

How It Works

When working with quantized model weights, these can be packed into a format aimed at optimizing a specific linear kernel. Each packed weight contains headers that detail its format. Upon invoking a linear operator with these packed weights, we assess the weight format in conjunction with current CPU capabilities. This examination allows us to identify a suite of compatible kernels for these weights, with function pointers cached in a registration table.

More Read

Reflecting on the Past and Anticipating the Future
Reflecting on the Past and Anticipating the Future
Hugging Face Partners with Microsoft to Introduce Hugging Face Model Catalog on Azure
Introducing the AI Text-to-Image Leaderboard and Arena: A New Frontier in Artificial Analysis
Optimizing Use-Case Based Deployments with SageMaker JumpStart
End of Password-Based Git Authentication: What You Need to Know

For instance, weights packed in format1 might be compatible with both GEMV and GEMM kernels (such as gemv_kernel1 and gemm_kernel1), while weights structured in format2 may only work with a GEMV kernel (like gemv_kernel2). This registration table then leverages this information to deliver swift, optimized execution.

Active Kernels

Curious about which kernels are currently being utilized? Set TORCH_CPP_LOG_LEVEL=INFO to gain comprehensive insights into active kernels.

KleidiAI Integration

Our collaboration with KleidiAI—an open-source library from Arm filled with highly optimized microkernels—has taken the performance of TorchAO to unparalleled heights. The integration allows KleidiAI kernels to be registered and used automatically where feasible (like 8-bit dynamic activation with 4-bit weights). In the event of coverage gaps—such as with non-4-bit weights or tied embedding layers—our in-house GEMV neondot kernels automatically serve as a reliable fallback, no additional configuration needed.

This hybrid approach effectively merges superior performance delivered by KleidiAI with the robust operator support from TorchAO’s kernels. The result? A remarkable boost in prefill performance that surpasses 2x speed improvement, especially with ExecuTorch recording rates above 373 tokens per second on an M1 Mac.

Quantized Tied Embedding and lm_head Kernels

Tied embeddings are crucial in compact Large Language Models (LLMs), including models like LLaMA 3.2 and Phi-4 Mini. In this context, the weights for the embedding layer are shared with the weights of the final linear layer—referred to as lm_head:

With recent models boasting vocabulary sizes exceeding 100,000 tokens, these layers may occupy a substantial fraction of the total model size. Unfortunately, on mobile devices, this often leads to weight duplication due to the necessity of packing weights into different formats for linear and embedding kernels, which complicates the sharing of weights without degrading performance.

To combat this challenge, we have engineered efficient quantized kernels for both embedding and linear operations that utilize a unified weight format. This innovation is available through the SharedEmbeddingQuantizer, allowing the same quantized weights to function for both the input embedding and the output lm_head. This strategic reduction minimizes model size without compromising performance. The quantizer supports a diverse array of configurations, such as:

  • 8-bit dynamic activations
  • x-bit weights, where x ranges from 1 to 8

Try It Out and Contribute!

All these exciting enhancements are readily accessible through TorchAO’s quantization APIs and have been seamlessly integrated into ExecuTorch for shining efficiency in deploying quantized models on mobile and edge devices.

We warmly invite you to experiment with these updates, share your feedback, and actively contribute to this transformative journey! For those intrigued by low-bit quantization and mobile deployment, we encourage you to connect with the ExecuTorch community on both Discord and GitHub. Your input and participation are invaluable in shaping the future of efficient model deployment!

Inspired by: Source

Hugging Face Joins French Data Protection Agency’s Enhanced Support Program
Introducing NVIDIA Exemplar Clouds: The Ultimate Benchmarking Solution for AI Cloud Infrastructure
Unmissable Highlights from PyTorch Day France: Pioneering Open Source AI Innovations
Initial Assessment of Language Models: Early Training Evaluation Techniques
Enhancing Automatic PII Detection on the Hub with Presidio: A Comprehensive Experiment

Sign Up For Daily Newsletter

Get AI news first! Join our newsletter for fresh updates on open-source models.

By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article Top 6 Major Updates Coming to ChatGPT: What You Need to Know Top 6 Major Updates Coming to ChatGPT: What You Need to Know
Next Article Verbalized Representation Learning: Enhancing Interpretable Few-Shot Generalization in AI Verbalized Representation Learning: Enhancing Interpretable Few-Shot Generalization in AI

Stay Connected

XFollow
PinterestPin
TelegramFollow
LinkedInFollow

							banner							
							banner
Explore Top AI Tools Instantly
Discover, compare, and choose the best AI tools in one place. Easy search, real-time updates, and expert-picked solutions.
Browse AI Tools

Latest News

AI Giants Warn: Impending Cybersecurity Crisis Looms in Just Months
AI Giants Warn: Impending Cybersecurity Crisis Looms in Just Months
Ethics
Assessing the Environmental Impact of Data Centres: Are We Finally Acknowledging the Consequences?
Assessing the Environmental Impact of Data Centres: Are We Finally Acknowledging the Consequences?
Ethics
Exploring the Future of EdTech: Highlights from the ‘Best of ISTE’ Virtual Playground
Exploring the Future of EdTech: Highlights from the ‘Best of ISTE’ Virtual Playground
Events
Survey Reveals Surprising Impact of AI on Job Losses: Insights from Workers
Survey Reveals Surprising Impact of AI on Job Losses: Insights from Workers
Ethics
//

Leading global tech insights for 20M+ innovators

Quick Link

  • Latest News
  • Model Comparisons
  • Tutorials & Guides
  • Open-Source Tools
  • Community Events

Support

  • Privacy Policy
  • Terms of Service
  • Contact Us
  • FAQ / Help Center
  • Advertise With Us

Sign Up for Our Newsletter

Get AI news first! Join our newsletter for fresh updates on open-source models.

AIModelKitAIModelKit
Follow US
© 2025 AI Model Kit. All Rights Reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?