vllm.models.kimi_k3.nvidia.recoverssm.cutedsl.commit
¶
KDA RecoverSSM state commit: one CTA per (head chunk, request, layer).
Folds the n accepted tokens of a verify window into the checkpoint:
S_n = S_0 * e^{L_n} + sum_{t<n} u_t (k_t * e^{L_n - L_t})
(columns scale per key channel; u_t are the verify's corrections, k_t the
normalized recorded keys and L_t the log decay of tokens 0..t inclusive). With
prefix caching (align), a window that crosses a block boundary after its first
m tokens also stores S_m to the boundary block's slot.
Each CTA walks up to MAX_HEADS_PER_CTA heads of one (request, layer). A head's
32 KB state page streams in with one bulk copy into a double-buffered shared tile
(the next head's page loads while this head is folded); thread c rebuilds key
channel c's decays and scaled keys; 16 lanes per state row (8 keys each) fold the
tile in place, and one bulk store writes it to the destination slot (the boundary
state of align is stored row by row from registers). Layer tensors are addressed
through the per-layer base-address tables of KDARecoverSSMCommitContext.
Classes:
-
KdaCommit–Args: state / correction / key-gate base addresses [L], their slot / row
Functions:
-
bulk_done–Wait until every committed bulk store has completed.
-
bulk_read_done–Wait until every committed bulk store has read its shared source.
-
proxy_fence–Order this thread's shared writes before later async-proxy (bulk) reads.
-
store_bulk–Bulk store of
sizebytes from shared memory, in this thread's bulk group.
KdaCommit
¶
Args: state / correction / key-gate base addresses [L], their slot / row
strides [L] (elements), a_log [L, H], dt_bias [L, H, K], source slots [B],
commit lengths [B], destination slots [B], boundary slots [B] and lengths [B]
(read with align), lower bound, null slot, stream. Per slot the state is
[H, V, K] BF16; request b's records are row b of the corrections
[rows, H, Q, V] FP32 and key / gate records [rows, H, Q, 2K] BF16, all
contiguous.
Source code in vllm/models/kimi_k3/nvidia/recoverssm/cutedsl/commit.py
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 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | |
bulk_done()
¶
bulk_read_done()
¶
Wait until every committed bulk store has read its shared source.
proxy_fence()
¶
Order this thread's shared writes before later async-proxy (bulk) reads.
store_bulk(dst, src, size)
¶
Bulk store of size bytes from shared memory, in this thread's bulk group.