vllm.models.kimi_k3.nvidia.specialized_decode.cutedsl.moe.experts_runtime
¶
Persistent routed experts for B<=64 (B>8: grouped units of <=8 tokens per expert) over one shared core and model-owned workspace. The entry wait completes the predecessor (incl. workspace rearm/counters) before shared state is read; output rows keep the caller's top16 order.
Classes:
Functions:
-
compile_experts–Only code and geometry are cached; no owner tensors or descriptors.
knobs: -
compile_group–The pregrouped experts' unit-table kernel: (ids, workspace, batch);
early: -
compile_plan–Plan writer for callers without the routing kernel's copy role in front.
-
early_group–Pregrouped batches whose unit-table kernel releases the experts at its entry.
-
pregrouped–B>8 experts read the unit table a one-CTA kernel builds after routing, beside
-
scratch–Model-owned expert buffers: the workspace and the grouped plan (MXFP8 x, written
-
stealing–B>8 experts balance the FC2(B) tail by claims.
-
streamed–B<=8 on the incremental producer: ~1-1.5% at B4-8, neutral at B1-2, which keep
PersistentExperts
¶
Methods:
-
group–Pregrouped batches prepared
early: the unit-table kernel (run it on the -
prepare–publish: (multicast, parity, rank) of the WaveMoeTail latent slot to
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
group(ids)
¶
Pregrouped batches prepared early: the unit-table kernel (run it on the
stream after routing; run then skips it).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
prepare(batch, buffers, out, publish=(), planned=False, twoshot=False, early=False)
¶
publish: (multicast, parity, rank) of the WaveMoeTail latent slot to
publish (twoshot: the common.twoshot push box); planned: B>8 calls
find the plan written (by the routing kernel), else run writes it from x first;
early: the caller runs group (pregrouped batches) before run.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
compile_experts(tp, experts, batch, grid, device, publish=False, *knobs)
cached
¶
Only code and geometry are cached; no owner tensors or descriptors. knobs:
(B<=8 stream, pregrouped, steal).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
compile_group(tp, experts, batch, grid, device, early=False)
cached
¶
The pregrouped experts' unit-table kernel: (ids, workspace, batch); early:
it releases the experts at entry.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
compile_plan(batch, device)
cached
¶
Plan writer for callers without the routing kernel's copy role in front.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
early_group(tp, batch)
¶
Pregrouped batches whose unit-table kernel releases the experts at its entry.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
pregrouped(tp, batch)
¶
B>8 experts read the unit table a one-CTA kernel builds after routing, beside the fused shared expert (hidden at B9-32; at B64 its ~2.3 us after routing outlast the shared expert).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
scratch(tp, device)
¶
Model-owned expert buffers: the workspace and the grouped plan (MXFP8 x, written
by the routing kernel or compile_plan).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/moe/experts_runtime.py
stealing(batch)
¶
streamed(batch)
¶
B<=8 on the incremental producer: ~1-1.5% at B4-8, neutral at B1-2, which keep the previous producer.