---
id: pr-flashinfer-3191
repo: flashinfer-ai/flashinfer
pr: 3191
title: 'fix(sm12x): fix micro-kernel workspace sizing when routed_rows > num_local_experts'
author: meena-at-work
date: '2026-05-07'
url: https://github.com/flashinfer-ai/flashinfer/pull/3191
source_category: upstream-code
architectures:
- sm100
tags:
- arch_pipeline
- attention_kv
- benchmark_test
- blackwell
- compiler_runtime
- cute dsl
- fused moe
- moe_routing
- sm120
- topk
techniques:
- kernel-fusion
- pipeline-stages
hardware_features:
- blackwell
kernel_types:
- attention
- compiler
- moe
- runtime
languages:
- cuda-cpp
- cute-dsl
- triton
captured_at: '2026-05-16'
status: merged
merge_sha: 14f2beef319eed9950bad5f2f88f9fea2bf0fd1d
inclusion_reason: Separate routing, permutation, top-k, and expert GEMM costs; keep tail-token and expert-layout tests attached to the idea.
changed_paths:
- flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_dispatch.py
- flashinfer/fused_moe/cute_dsl/blackwell_sm12x/triton_compact.py
- tests/moe/test_b12x_fused_moe.py
artifact_dir: evidence/pull-bundles/flashinfer/gh-3191
head_ref_oid: 4e765192e00fdc5a11ad760c0bd0c18d40c7a017
---
# fix(sm12x): fix micro-kernel workspace sizing when routed_rows > num_local_experts

- Repository: `flashinfer-ai/flashinfer`
- PR: [3191](https://github.com/flashinfer-ai/flashinfer/pull/3191)
- Decision: `Separate routing, permutation, top-k, and expert GEMM costs; keep tail-token and expert-layout tests attached to the idea.`
- Reason: Separate routing, permutation, top-k, and expert GEMM costs; keep tail-token and expert-layout tests attached to the idea.

## Changed Paths

- `flashinfer/fused_moe/cute_dsl/blackwell_sm12x/moe_dispatch.py`
- `flashinfer/fused_moe/cute_dsl/blackwell_sm12x/triton_compact.py`
- `tests/moe/test_b12x_fused_moe.py`

## Evidence Bundle

`evidence/pull-bundles/flashinfer/gh-3191`
