vllm.models.flint.ops.moe_cute
¶
FlashInfer's SM100 NVFP4-weight / BF16-activation grouped MoE GEMMs.
The FlashInfer kernel decodes E2M1 * E4M3 weight tiles to BF16 and runs BF16
tcgen05 MMAs with fp32 accumulation and the per-expert fp32 global scale
applied to the accumulator. Its SwiGLU epilogue keeps gate/up in fp32 and
rounds silu(g) * u once (sigmoid via ex2.approx + rcp.approx), the
rounding rule every Flint MoE path follows.
Functions:
-
grouped_moe–Routed expert outputs in permuted order (unweighted, BF16).
-
warmup–Compile every grouped-GEMM kernel variant used for min..max tokens.
_compile_key(num_tokens, top_k, num_experts, gemm1_rows)
¶
The parts of the kernel cache keys that vary with num_tokens (tactics and whether GEMM1 uses the CLC scheduler, as in FlashInfer's launcher).
Source code in vllm/models/flint/ops/moe_cute.py
_variants(top_k, num_experts, gemm1_rows, min_tokens, max_tokens)
cached
¶
Smallest token count of each kernel cache key in [min, max].
Source code in vllm/models/flint/ops/moe_cute.py
grouped_moe(x, topk_ids, topk_weights, w1, w1_sf, w1_alpha, w2, w2_sf, w2_alpha)
¶
Routed expert outputs in permuted order (unweighted, BF16).
Returns (y [route_slots, H], expanded_idx_to_permuted_idx [M, TOPK]); the caller does the weighted top-k reduction.
Source code in vllm/models/flint/ops/moe_cute.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
warmup(weights, top_k, min_tokens, max_tokens)
¶
Compile every grouped-GEMM kernel variant used for min..max tokens.
CuTe kernels compile on first use, which must not happen inside CUDA graph capture; the compile caches are process-wide, so each variant runs once.