vllm.models.kimi_k3.nvidia.specialized_decode.cutedsl.oproj.prepared
¶
Output projection fused with its TP all-reduce and post-attention AttnRes: rank
partials go into Lamport slots of a multicast [TP, 64, 7168] mailbox (parity alternates
by layer) and the consumer sums and re-arms them. TP16 B<=8 fuses producer and consumer
(MLA layers below B5 keep them split); above B8 the producer runs 16-token groups.
At twoshot_batches, given TwoShot buffers, the all-reduce is common.twoshot
(chunks pushed to their column owner, owner sums + multicasts, all Lamport-polled), so
each GPU receives ~2 x 14 KB per token instead of TP x 14 KB. bind_ahead: fused
rows that also compute the next layer's AttnRes statistics (consumer ahead).
Classes:
-
OprojMailbox–Sentinel-armed multicast mailbox; defaults to [parity, TP, 64, 7168] BF16.
-
PreparedOproj–One decoder layer's o-projection + all-reduce + post-attention AttnRes.
Functions:
-
compile_oproj–Producer, consumer or fused kernel over a [TP, cap, 7168] parity view;
-
engine–Producer engine above B8 (GB300): grouped mma.sync for TP8 up to B16, else
-
producer–B<=8: one mma.sync pass, TP8 stages 8 (MLA 4) of 12 K blocks per warp. Above
OprojMailbox
¶
Sentinel-armed multicast mailbox; defaults to [parity, TP, 64, 7168] BF16.
multicast=False: a peer-store mailbox (handle.buffer_ptrs only, mc
0), which spends no NVLink multicast object.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/oproj/prepared.py
PreparedOproj
¶
One decoder layer's o-projection + all-reduce + post-attention AttnRes.
Methods:
-
bind_ahead–The fused
rowsalso computetarget's AttnRes statistics into
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/oproj/prepared.py
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 | |
bind_ahead(target, mixture, scal, rows)
¶
The fused rows also compute target's AttnRes statistics into
mixture [cap, 7168] / scal [cap, 2] FP32; target must read the
saved blocks of this kernel's AttnRes. Returns the rows bound.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/oproj/prepared.py
compile_oproj(kind, k, batch, tp, nb, has_delta, mla, front=False, cap=64, twoshot=False, ahead=0)
cached
¶
Producer, consumer or fused kernel over a [TP, cap, 7168] parity view;
front: the consumer also publishes x_moe [1, 4, 7168] and the epoch hint.
twoshot: the two-shot pair (arguments as TwoShot.views). ahead: the
fused kernel also stores the next layer's AttnRes statistics into [ahead, 7168] /
[ahead, 2] FP32 rows (after the AttnRes rows: next norm, next query, the two
rows, next eps).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/oproj/prepared.py
engine(batch, tp)
¶
Producer engine above B8 (GB300): grouped mma.sync for TP8 up to B16, else tcgen05.
producer(k, batch, tp, mla, twoshot=False, kind=None)
¶
B<=8: one mma.sync pass, TP8 stages 8 (MLA 4) of 12 K blocks per warp. Above
B8 (kind overrides engine): the tcgen05 engine, or 2-tile warps over 8 K
parts in 16-token groups, TP8 staging 2 of 6 K blocks per warp.