By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
AIModelKitAIModelKitAIModelKit
  • Home
  • News
    NewsShow More
    Stricter UK Regulations for Tech Firms Addressing Intimate Image Abuse | Enhancing Internet Safety
    Stricter UK Regulations for Tech Firms Addressing Intimate Image Abuse | Enhancing Internet Safety
    4 Min Read
    Pope Leo XIV Collaborates with Anthropic Co-Founder to Release Text on Human Dignity and Artificial Intelligence
    Pope Leo XIV Collaborates with Anthropic Co-Founder to Release Text on Human Dignity and Artificial Intelligence
    5 Min Read
    Key Google Updates and Announcements You Can Expect This Week
    Key Google Updates and Announcements You Can Expect This Week
    5 Min Read
    Sam Altman and OpenAI Triumph Over Elon Musk in Landmark AI Legal Battle
    Sam Altman and OpenAI Triumph Over Elon Musk in Landmark AI Legal Battle
    5 Min Read
    Amazon Unveils Alexa for Shopping: Rufus Transitions to Behind-the-Scenes Role
    Amazon Unveils Alexa for Shopping: Rufus Transitions to Behind-the-Scenes Role
    6 Min Read
  • Open-Source Models
    Open-Source ModelsShow More
    Enhancing Scientific Impact with Global Partnerships and Open Resources
    Enhancing Scientific Impact with Global Partnerships and Open Resources
    5 Min Read
    Top 4 Ways Google Research Scientists Utilize Empirical Research Assistance
    Top 4 Ways Google Research Scientists Utilize Empirical Research Assistance
    5 Min Read
    Unlocking DeepInfra on Hugging Face: Explore Powerful Inference Providers 🔥
    Unlocking DeepInfra on Hugging Face: Explore Powerful Inference Providers 🔥
    5 Min Read
    How AI-Generated Synthetic Neurons are Revolutionizing Brain Mapping
    How AI-Generated Synthetic Neurons are Revolutionizing Brain Mapping
    5 Min Read
    Discover HoloTab by HCompany: Your Ultimate AI Browser Companion
    4 Min Read
  • Guides
    GuidesShow More
    Ultimate Guide to Absolute vs Relative Imports in Python: Test Your Knowledge with Our Quiz – Real Python
    Ultimate Guide to Absolute vs Relative Imports in Python: Test Your Knowledge with Our Quiz – Real Python
    4 Min Read
    Ultimate Guide to OpenAI Omni Moderation: Free Text & Image Filtering Solutions
    Ultimate Guide to OpenAI Omni Moderation: Free Text & Image Filtering Solutions
    6 Min Read
    Master Python Metaclasses: Take the Ultimate Quiz on Real Python
    Master Python Metaclasses: Take the Ultimate Quiz on Real Python
    5 Min Read
    Creating Type-Safe LLM Agents Using Pydantic AI: A Comprehensive Guide | Real Python
    Creating Type-Safe LLM Agents Using Pydantic AI: A Comprehensive Guide | Real Python
    5 Min Read
    Mastering List Flattening in Python: A Quiz from Real Python
    Mastering List Flattening in Python: A Quiz from Real Python
    4 Min Read
  • Tools
    ToolsShow More
    Optimizing Use-Case Based Deployments with SageMaker JumpStart
    Optimizing Use-Case Based Deployments with SageMaker JumpStart
    5 Min Read
    Safetensors Partners with PyTorch Foundation: Strengthening AI Development
    Safetensors Partners with PyTorch Foundation: Strengthening AI Development
    5 Min Read
    High Throughput Computer Use Agent: Understanding 12B for Optimal Performance
    High Throughput Computer Use Agent: Understanding 12B for Optimal Performance
    5 Min Read
    Introducing the First Comprehensive Healthcare Robotics Dataset and Essential Physical AI Models for Advancing Healthcare Robotics
    Introducing the First Comprehensive Healthcare Robotics Dataset and Essential Physical AI Models for Advancing Healthcare Robotics
    6 Min Read
    Creating Native Multimodal Agents with Qwen 3.5 VLM on NVIDIA GPU-Accelerated Endpoints
    Creating Native Multimodal Agents with Qwen 3.5 VLM on NVIDIA GPU-Accelerated Endpoints
    5 Min Read
  • Events
    EventsShow More
    NVIDIA and Ineffable Intelligence Join Forces to Revolutionize Reinforcement Learning Infrastructure
    NVIDIA and Ineffable Intelligence Join Forces to Revolutionize Reinforcement Learning Infrastructure
    5 Min Read
    UK Financial Services Security Hackathon: Lloyds Banking Group, Hack The Box, and Google Cloud Join Forces
    UK Financial Services Security Hackathon: Lloyds Banking Group, Hack The Box, and Google Cloud Join Forces
    6 Min Read
    NVIDIA and SAP Enhance Trust in Specialized Agents Through Collaboration
    NVIDIA and SAP Enhance Trust in Specialized Agents Through Collaboration
    7 Min Read
    Introducing NVIDIA Spectrum-X: The Open, AI-Native Ethernet Fabric for Gigascale AI with Enhanced MRC Capabilities
    Introducing NVIDIA Spectrum-X: The Open, AI-Native Ethernet Fabric for Gigascale AI with Enhanced MRC Capabilities
    5 Min Read
    NVIDIA and ServiceNow Collaborate on Next-Gen Autonomous AI Agents for Enterprise Solutions
    NVIDIA and ServiceNow Collaborate on Next-Gen Autonomous AI Agents for Enterprise Solutions
    6 Min Read
  • Ethics
    EthicsShow More
    Poll Reveals One-Third of UK University Students Believe AI Job Losses Could Trigger Social Unrest
    Poll Reveals One-Third of UK University Students Believe AI Job Losses Could Trigger Social Unrest
    6 Min Read
    Exploring Technology-Facilitated Abuse: The Rise of AirTags, AI Nudification, and Emerging Tools
    Exploring Technology-Facilitated Abuse: The Rise of AirTags, AI Nudification, and Emerging Tools
    6 Min Read
    State-by-State Efforts to Limit Youth Access to Social Media: An In-Depth Look
    State-by-State Efforts to Limit Youth Access to Social Media: An In-Depth Look
    5 Min Read
    Ensuring Safety with Auditing Agent: A Comprehensive Guide
    Ensuring Safety with Auditing Agent: A Comprehensive Guide
    6 Min Read
    Optimizing Canada’s AI Strategy: Essential Considerations for K-12 Education Integration
    Optimizing Canada’s AI Strategy: Essential Considerations for K-12 Education Integration
    6 Min Read
  • Comparisons
    ComparisonsShow More
    Enhancing Urgent Care Satisfaction: How AI Analyzes Patient Reviews to Identify Key Drivers
    Enhancing Urgent Care Satisfaction: How AI Analyzes Patient Reviews to Identify Key Drivers
    5 Min Read
    LISTEN to Your Preferences: A Comprehensive LLM Framework for Effective Multi-Objective Selection
    LISTEN to Your Preferences: A Comprehensive LLM Framework for Effective Multi-Objective Selection
    5 Min Read
    Enhancing Large Language Model Systems Using User Logs: Insights from Paper [2602.06470]
    Enhancing Large Language Model Systems Using User Logs: Insights from Paper [2602.06470]
    5 Min Read
    Cloudflare and Stripe Empower AI Agents to Create Accounts, Purchase Domains, and Deploy to Production Effortlessly
    Cloudflare and Stripe Empower AI Agents to Create Accounts, Purchase Domains, and Deploy to Production Effortlessly
    7 Min Read
    Evaluating Confidence in Large Vision-Language Models: Grounded vs. Guessing Through Blind-Image Contrastive Ranking
    Evaluating Confidence in Large Vision-Language Models: Grounded vs. Guessing Through Blind-Image Contrastive Ranking
    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

Accelerating Energy Modeling Applications with OpenSynth and PyTorch: A Deep Dive into Enhanced Compute Solutions
Accelerating Energy Modeling Applications with OpenSynth and PyTorch: A Deep Dive into Enhanced Compute Solutions
Boost Your Qubit Research Using NVIDIA cuQuantum Integrations in QuTip and scQubits
Quick Fix for Linux Installation Issues: A TensorFlow Blog Guide
Unlocking Performance: NVIDIA HPC SDK 24.1 Release Overview
Boosting AI Innovation: How PyTorch is Revolutionizing Performance with Intelligent Caching

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

Enhance Your LLMs Using Gradio MCP Servers for Effective Upskilling
Optimizing Use-Case Based Deployments with SageMaker JumpStart
Enhancing PyTorch Distributed Checkpointing with HuggingFace Safetensors Support
Optimized Gemma 3 Models: Lightweight, Multimodal, and Multilingual for Enhanced Performance
Hugging Face and Cloudflare Collaborate to Enhance Real-Time Speech and Video with FastRTC Integration

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

Ultimate Guide to Absolute vs Relative Imports in Python: Test Your Knowledge with Our Quiz – Real Python
Ultimate Guide to Absolute vs Relative Imports in Python: Test Your Knowledge with Our Quiz – Real Python
Guides
Stricter UK Regulations for Tech Firms Addressing Intimate Image Abuse | Enhancing Internet Safety
Stricter UK Regulations for Tech Firms Addressing Intimate Image Abuse | Enhancing Internet Safety
News
Enhancing Urgent Care Satisfaction: How AI Analyzes Patient Reviews to Identify Key Drivers
Enhancing Urgent Care Satisfaction: How AI Analyzes Patient Reviews to Identify Key Drivers
Comparisons
Pope Leo XIV Collaborates with Anthropic Co-Founder to Release Text on Human Dignity and Artificial Intelligence
Pope Leo XIV Collaborates with Anthropic Co-Founder to Release Text on Human Dignity and Artificial Intelligence
News
//

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?