vllm.models.deepseek_v41.nvidia.specialized_decode.boundary.boundary
¶
The mHC boundaries of the specialized decode.
Every decoder sublayer ends in a TP-partial output (the attention's wo_b,
the MoE's routed and shared experts). The next boundary reduces it across the
TP group, mixes it into the hc residual streams (mHC post) and collapses and
normalizes the streams into the next sublayer's input (mHC pre). Here the
fused all-reduce + mHC kernel (BoundaryAllReduce) does all of that for every
step the executor runs; the next sublayer's mHC coefficients then come from the
stock mhc_pre_delayed_overlap, on the shared mHC side stream for up to
MHC_OVERLAP_MAX_ROWS rows and inline after the fused kernel above.
The fused kernel also finalizes a MoE output left unfinalized, collects a
wo_b output the publishing GEMM already stored into its mailbox, writes the
attention input as MXFP8 for fused_wqa_wkv, and writes only the streams
(residual-only) where the next consumer is not a sublayer's pre: an Engram
injection and the final collapse.
Classes:
-
Boundaries–The boundaries of one decode step's layer loop, on one fused kernel.
-
BoundaryState–The hc residual streams and the mixes carried to the next boundary.
Functions:
-
empty_quantized_layer_input–An unfilled MXFP8 layer input with FlashInfer's swizzled 128x4 scales.
Boundaries
¶
The boundaries of one decode step's layer loop, on one fused kernel.
Methods:
-
first–The first layer's attention entry: the embedding broadcast to the
-
join–Make the current stream wait for the side-stream coefficients.
-
post_only–Reduce
state.pendinginto the streams and return them, for an -
pre–An Engram layer's attention entry, on the injected streams.
-
sublayer–Reduce
state.pendinginto the streams and prepare the attention
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
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 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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
_pre(layer, residual, fn, pre_mix, x, step)
¶
The stock attention entry without a reduction: mHC pre of
residual on the side stream, or inline with TileLang.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
_reduce(state, pre, norm, mxfp8_out)
¶
The fused kernel on state.pending; residual-only without pre.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
first(layer, x, step)
¶
The first layer's attention entry: the embedding broadcast to the hc streams, whose identity pre-mix selects stream zero.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
join(layer, step)
¶
Make the current stream wait for the side-stream coefficients.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
post_only(state)
¶
Reduce state.pending into the streams and return them, for an
Engram injection or the final collapse.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
pre(layer, residual, state, step)
¶
An Engram layer's attention entry, on the injected streams.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
sublayer(layer, ffn, state, step, *, quantize=False, capture_aux=False)
¶
Reduce state.pending into the streams and prepare the attention
(or with ffn, the MoE) input of layer.
Returns the new state, the layer input, the same input as MXFP8 with
quantize, and with capture_aux the mean of the streams (on the
side stream when the coefficients run there: join it before reading).
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
BoundaryState
dataclass
¶
The hc residual streams and the mixes carried to the next boundary.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/boundary/boundary.py
empty_quantized_layer_input(num_tokens, hidden_size, device)
¶
An unfilled MXFP8 layer input with FlashInfer's swizzled 128x4 scales.