vllm.models.muse_spark.nvidia.specialized_decode.cutedsl.oproj.batt
¶
The o_proj GEMM and the attention boundary (o_proj all-reduce, post_attn_norm, gated FP32 residual, pre_ffn_norm) of the Muse Spark specialized decode.
OProjection: this rank's row-parallel o_proj partial, [b, 128 * 64 / tp] x [8192, 128 * 64 / tp]^T -> BF16 [b, 8192]: on cuBLAS at TP4 and TP16; at TP8 (PACKAGE_GEMM_TPS) on the package's small-M GEMM (the unpooler's kernel, cutedsl/gemm/unpooler.py), whose epilogue also publishes the partial into the attention boundary's mailbox (zero-copy).AttentionBoundary(anAttentionBoundaryProvider):- TP4 and TP8: the all-reduce fused with the dual norm
(all_reduce_dual_norm.py), one mailbox shared by every layer, summing in
the order of the all-reduce the stock o_proj reaches, which the executor
reads once at build from the backend that all-reduce resolved to
(
BuildContext.all_reduce_order; TP4, one node: the MNNVL one-shot by default, the node-local one-shot when set; TP8, across trays: the MNNVL one-shot and two-shot); - TP16: the all-reduce op the executor is given
(
RoutedExpertsOps.all_reduce: the TP communicator's MNNVL all-reduce, the one the stock o_proj reaches), then the standalone dual norm. Both are bit for bit the stock all-reduce followed by the stock dual norm.
Classes:
-
AttentionBoundary–The attention boundary (an
AttentionBoundaryProvider):partial -
OProjection–x BF16 [b, K] (this rank's attention output, K = 128 * 64 / tp) ->
Functions:
-
fused_all_reduce–The model's mailbox, created on first use (collective over the TP group:
-
producer_mailbox–The fused boundary's mailbox where the o_proj GEMM publishes its
-
standalone_dual_norm–The dual norm's standalone kernel, compiled once per constant set.
AttentionBoundary
¶
The attention boundary (an AttentionBoundaryProvider): partial
BF16 [b, H] -> all-reduce, post_attn_norm, gated add into stream (FP32
[b, H], in place), pre_ffn_norm into out (BF16 [b, H]).
Methods:
-
build–layeris a stock decoder layer;all_reducethe all-reduce op
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/oproj/batt.py
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 | |
build(ctx, layer, *, all_reduce=None)
classmethod
¶
layer is a stock decoder layer; all_reduce the all-reduce op
(RoutedExpertsOps.all_reduce), given at TP16 only.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/oproj/batt.py
OProjection
¶
x BF16 [b, K] (this rank's attention output, K = 128 * 64 / tp) -> this rank's o_proj partial BF16 [b, 8192], before the all-reduce.
Without a mailbox: torch.mm into out (cuBLAS, as the stock o_proj),
bit for bit.
With mailbox (the fused attention boundary's, width 8192): the package
GEMM (Unpooler with the OPROJ launch shape), which also multicasts
the partial into this rank's slot of the mailbox. Not bitwise to cuBLAS
(summation order); the boundary bound with published then runs its
consumer alone.
Methods:
-
build–From a stock decoder layer's o_proj; with the model's fused boundary
-
run–The partial, in
out(and in the mailbox with the package GEMM:
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/oproj/batt.py
build(ctx, layer, *, rows=ROWS)
classmethod
¶
From a stock decoder layer's o_proj; with the model's fused boundary
mailbox where it publishes into it (producer_mailbox).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/oproj/batt.py
run(x, out)
¶
The partial, in out (and in the mailbox with the package GEMM:
the attention boundary bound with published must run next).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/oproj/batt.py
fused_all_reduce(ctx)
¶
The model's mailbox, created on first use (collective over the TP group:
every rank builds the same layers in the same order), summing in the order
of the stock TP all-reduce (ctx.all_reduce_order).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/oproj/batt.py
producer_mailbox(ctx)
¶
The fused boundary's mailbox where the o_proj GEMM publishes its
partial into it (PACKAGE_GEMM_TPS), else None: the one place that
decides, for the o_proj (which GEMM) and the attention boundary (whether
it publishes).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/oproj/batt.py
standalone_dual_norm(constants)
cached
¶
The dual norm's standalone kernel, compiled once per constant set.