vllm.models.kimi_k3.nvidia.specialized_decode.cutedsl.kda.commit
¶
RecoverSSM commit of an FP32 KDA state: one CTA per (head, request, layer).
Folds the n accepted tokens of a verify window into the checkpoint as the stock
FP32 commit (_commit_kda_state_kernel) does, in its association:
S_n = S_0 * D_n + sum_{t<n} (u_t * kn_t) * P_t, P_t = prod_{t<s<n} d_s
(u_t the verify's corrections, kn_t the normalized recorded keys, d_t the
per-key decays, D_n = P_{-1}), and with prefix caching (align) also the
boundary state S_m of the window's first m tokens.
Thread c < 128 rebuilds key channel c's decays, normalized keys and suffix products into shared memory; then all 8 warps fold the head's [128, 128] state from global memory to global memory, thread 2 i + h taking keys 8 c + 4 h + [0, 4) of row i, so each byte of the state is read once and written once (the stock FP32 kernel splits a head over four CTAs that each rebuild the key operands).
Classes:
-
KdaCommitF32–Args as the stock CuTe commit's
KdaCommit(base addresses, strides,
Functions:
-
commit_f32–Fold a prepared commit plan of
context(aKDARecoverSSMCommitContext) -
compile_commit_f32–Compile before serving (the commit runs eagerly after sampling).
-
supported–Whether
commit_f32folds this checkpoint cache (FP32 [slot, H, 128, 128]
KdaCommitF32
¶
Args as the stock CuTe commit's KdaCommit (base addresses, strides,
a_log [L, H], dt_bias [L, H, K], source / commit length / destination /
boundary slot / boundary length per request, lower bound, null slot, stream);
the state is FP32 [H, V, K] per slot.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/commit.py
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 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 | |
commit_f32(context, state_indices, batch, align, record_rows=None)
¶
Fold a prepared commit plan of context (a KDARecoverSSMCommitContext)
into every layer's FP32 state in one launch on the current stream; the records
of request b are in slot record_rows[b] (default: b).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/commit.py
compile_commit_f32(state, window, params, align, indexed=False)
¶
Compile before serving (the commit runs eagerly after sampling).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/kda/commit.py
supported(state, lower_bound)
¶
Whether commit_f32 folds this checkpoint cache (FP32 [slot, H, 128, 128]
pages, contiguous per slot, on SM10x) for a bounded gate (the stock softplus
gate of gate_lower_bound=None is not implemented).