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
    HiRO-ACEv2: Cost-Effective Simulation of Extreme Weather at 3 km Resolution
    HiRO-ACEv2: Cost-Effective Simulation of Extreme Weather at 3 km Resolution
    5 Min Read
    Unlocking Efficient Autoregressive Video Generation with SemanTok: Predictable Semantic Tokens by Stability AI
    Unlocking Efficient Autoregressive Video Generation with SemanTok: Predictable Semantic Tokens by Stability AI
    5 Min Read
    4Director: Mastering Video World Models with Rigid 3D Geometry | Stability AI Insights
    4Director: Mastering Video World Models with Rigid 3D Geometry | Stability AI Insights
    6 Min Read
    Leveraging Earth AI’s Geospatial Foundation Models to Enhance Global Public Health Initiatives
    Leveraging Earth AI’s Geospatial Foundation Models to Enhance Global Public Health Initiatives
    5 Min Read
    Enhancing AI Image Generation with Diffusion Controller: A Simplified Unified Approach
    Enhancing AI Image Generation with Diffusion Controller: A Simplified Unified Approach
    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
    Granite Switch 4.1: Unified Chat, Decision-Making, and Voice Features from a Single Endpoint
    Granite Switch 4.1: Unified Chat, Decision-Making, and Voice Features from a Single Endpoint
    5 Min Read
    Create Local AI Applications Using C++ and NVIDIA TensorRT RTX Samples
    Create Local AI Applications Using C++ and NVIDIA TensorRT RTX Samples
    5 Min Read
    Unlock Near-Astra Intelligence in Your Daily Work with GPT-6.1 Sol on Amazon Bedrock
    Unlock Near-Astra Intelligence in Your Daily Work with GPT-6.1 Sol on Amazon Bedrock
    6 Min Read
    Reproducible Benchmark Results: How UK AISI and EvalEval Are Leading the Way
    Reproducible Benchmark Results: How UK AISI and EvalEval Are Leading the Way
    6 Min Read
    Hugging Face Welcomes Jun Kim, oMLX Creator and Maintainer, to Boost the MLX Community
    Hugging Face Welcomes Jun Kim, oMLX Creator and Maintainer, to Boost the MLX Community
    4 Min Read
  • Events
    EventsShow More
    Army Software Factory: Innovative Software Solutions Created by Soldiers for Soldiers
    Army Software Factory: Innovative Software Solutions Created by Soldiers for Soldiers
    6 Min Read
    How European Cities Use NVIDIA-Powered AI Agents for Enhanced Urban Operations
    How European Cities Use NVIDIA-Powered AI Agents for Enhanced Urban Operations
    5 Min Read
    Boosting Everyday Courage in Educational Leaders: A Guide to Choosing Confidence
    Boosting Everyday Courage in Educational Leaders: A Guide to Choosing Confidence
    5 Min Read
    Boosting OpenAI’s GPT-6 Astra Performance: The Role of NVIDIA GPUs in Accelerating AI Technology
    Boosting OpenAI’s GPT-6 Astra Performance: The Role of NVIDIA GPUs in Accelerating AI Technology
    4 Min Read
    Jensen Huang at Dreamforce: ‘Now We Can Know Everything and Achieve Anything’
    Jensen Huang at Dreamforce: ‘Now We Can Know Everything and Achieve Anything’
    5 Min Read
  • Ethics
    EthicsShow More
    Are Teachers More Like Coaches or Pastors? Explore the Differences Based on Your Location
    Are Teachers More Like Coaches or Pastors? Explore the Differences Based on Your Location
    4 Min Read
    How AI Labs are Acquiring Data from Defunct Startups to Enhance Model Training
    How AI Labs are Acquiring Data from Defunct Startups to Enhance Model Training
    6 Min Read
    UK Enhances Cyber Defenses: Minister Urges AI Firms to Boost Safety Measures
    UK Enhances Cyber Defenses: Minister Urges AI Firms to Boost Safety Measures
    6 Min Read
    Understanding the Side Effects of GLP-1 Weight Loss Drugs: What You Need to Know
    Understanding the Side Effects of GLP-1 Weight Loss Drugs: What You Need to Know
    5 Min Read
    Understanding Withholding Delay: A Welfare Model for Open-Weight AI Releases in Asymmetric Proliferation
    Understanding Withholding Delay: A Welfare Model for Open-Weight AI Releases in Asymmetric Proliferation
    6 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

Feedback on the U.S. National AI Research Resource Interim Report: Key Insights and Recommendations
Feedback on the U.S. National AI Research Resource Interim Report: Key Insights and Recommendations
PyTorch Foundation Introduces vLLM as a New Hosted Project
Optimizing Performance: Efficiently Scaling the Polars GPU Parquet Reader
Maximizing Power Efficiency in AI Manufacturing with NVIDIA Spectrum-X Ethernet Photonics
Latest Security Update on Space Secrets: Protecting Sensitive Information

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

Unlocking the Power of Pull Requests and Discussions: A Comprehensive Guide 🥳
Exploring How SETI Utilizes AI Technology to Search for Intelligent Alien Life
Unlock Google Cloud TPUs for Hugging Face Users: Enhance Your AI Models Today!
Discover SyGra Studio: Your Gateway to Exceptional Creative Solutions
Comprehensive Guide: Exploring Vectara’s Hallucination Leaderboard with a Complete End-to-End Example

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

Army Software Factory: Innovative Software Solutions Created by Soldiers for Soldiers
Army Software Factory: Innovative Software Solutions Created by Soldiers for Soldiers
Events
Granite Switch 4.1: Unified Chat, Decision-Making, and Voice Features from a Single Endpoint
Granite Switch 4.1: Unified Chat, Decision-Making, and Voice Features from a Single Endpoint
Tools
Are Teachers More Like Coaches or Pastors? Explore the Differences Based on Your Location
Are Teachers More Like Coaches or Pastors? Explore the Differences Based on Your Location
Ethics
HiRO-ACEv2: Cost-Effective Simulation of Extreme Weather at 3 km Resolution
HiRO-ACEv2: Cost-Effective Simulation of Extreme Weather at 3 km Resolution
Open-Source Models
//

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?