MoE inference reveals grouped GEMM limits
According to @_avichawla, MoE routing fragments batches, making grouped GEMM suboptimal at low concurrency and requiring weight-streamed GEMV kernels.
SourceAnalysis
Mixture of Experts inference challenges are reshaping how large language models are deployed in production environments, particularly as companies scale autoregressive decoding for real-time applications. According to insights shared by Avi Chawla on X in September 2026 regarding optimizations for Qwen-3.5-397B-A17B-FP8 on Ironwood TPUs, routing tokens to sparse experts fragments batches in ways that architecture diagrams often overlook, creating measurable impacts on throughput and latency.
Key Takeaways
- MoE routing divides token batches into variable-sized expert-specific groups, reducing overall computation but introducing fragmentation that dense transformers avoid.
- At low concurrency levels typical of autoregressive decoding, most experts receive single-row batches, shifting operations toward inefficient GEMV patterns instead of reusable matrix multiplications.
- Hardware-specific solutions like custom weight prefetching kernels deliver up to 3.6x speedups when grouped GEMM cannot exploit row reuse, highlighting the need for shape-aware execution strategies.
Deep Dive into MoE Batch Fragmentation
In dense transformer execution a batch of 32 token rows processes through identical feed-forward weights in a single matrix multiplication, maximizing weight reuse across all rows. MoE models change this dynamic by routing each token to a limited subset of experts, splitting the batch into smaller expert-specific subsets whose sizes vary based on token selections. For instance a top-1 router might assign 8 rows to one expert, 3 to another, zero to a third, 11 to a fourth, and the remainder across others, forcing the inference engine to regroup tokens, execute separate projections, apply routing weights, and restore original order.
Grouped GEMM and Its Limitations
Grouped GEMM addresses launch overhead by scheduling multiple expert matrix multiplications together on the accelerator. This approach performs well when each active expert receives several rows, allowing efficient parallel processing. However during ordinary decoding with only one to three concurrent requests, selected experts rarely overlap, leaving most expert batches with a single row. These single-row cases resemble GEMV operations where weight reuse across rows disappears, limiting the benefits of grouped GEMM even when launches are combined.
The Qwen-3.5 example on Ironwood TPUs illustrates the issue clearly: with three concurrent requests and top-10 routing from 512 experts, only 5 percent of selected experts were duplicated across requests. Researchers responded by building a custom kernel that prefetches expert weights into fast VMEM and handles these GEMV-like cases directly, achieving 3.6 times faster MoE block execution at concurrency one.
Business Impact and Opportunities
These inference realities create direct opportunities for AI infrastructure providers offering specialized serving engines that adapt execution based on expert batch shapes. Companies deploying MoE models in chatbots, coding assistants, or enterprise search can reduce serving costs by adopting shape-aware kernels instead of generic grouped GEMM paths. Implementation challenges include detecting concurrency levels at runtime and switching between GEMM and streaming strategies, yet solutions like the TPU VMEM prefetching demonstrate practical paths forward. Market leaders in cloud inference such as Google Cloud TPUs and emerging startups can monetize these optimizations through managed MoE endpoints that guarantee lower latency under variable load. Regulatory considerations around energy efficiency further incentivize such advances, as fragmented execution wastes accelerator cycles and increases carbon footprints.
Future Outlook
Looking ahead, the competitive landscape will favor hardware-software co-design that anticipates routing overlap statistics across workloads. Predictions indicate wider adoption of dynamic kernel selection frameworks that profile expert batch distributions in real time, shifting industry practice from static grouped GEMM assumptions to adaptive strategies. This evolution will lower barriers for smaller organizations to run large MoE models profitably while raising the bar for ethical deployment practices that prioritize transparent performance reporting under diverse concurrency conditions.
Frequently Asked Questions
What causes batch fragmentation in MoE inference?
Token routing to sparse experts splits the original batch into smaller expert-specific groups whose sizes depend on selection patterns, unlike uniform processing in dense models.
How does low concurrency affect MoE performance?
With few concurrent requests experts rarely share tokens, producing mostly single-row batches that reduce weight reuse and favor GEMV over efficient matrix multiplications.
Why did custom kernels improve Qwen performance on TPUs?
Prefetching weights into fast memory allowed direct handling of one-row operations, delivering 3.6x speedup where grouped GEMM could not exploit parallelism.
What business opportunities arise from these MoE challenges?
Providers can offer adaptive serving platforms that switch execution strategies based on batch shapes, cutting costs and improving latency for production LLM deployments.
Avi Chawla
@_avichawlaDaily tutorials and insights on DS, ML, LLMs, and RAGs • Co-founder