vllm.models.kimi_k3.nvidia.specialized_decode.recoverssm.kernels
¶
Triton kernels of the specialized decode's deferred RecoverSSM: the stock
RecoverSSM verify with its records written to each request's record slot, and the
commit-plan steps that defer (_defer_commit_kernel) or flush
(_prepare_flush_plan_kernel) a request's pending replay.
Functions:
-
kda_recoverssm_verify–Verify a KDA speculative window without modifying its checkpoint. Request
_defer_commit_kernel(state_indices_ptr, commit_lens_ptr, record_rows_ptr, pending_ptr, eager_ptr, null_block_id, stride_state_indices, HAS_EAGER)
¶
Deferred RecoverSSM after a plan: request b's commit length becomes the
pending replay of its record slot (and no commit runs for it), unless the row is
committed now (eager: pending 0, the plan kept). Rows without a state slot
(padding, dummy batches) or a record slot leave every pending count.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/recoverssm/kernels.py
_prepare_flush_plan_kernel(state_indices_ptr, record_rows_ptr, pending_ptr, commit_lens_ptr, final_state_indices_ptr, boundary_state_indices_ptr, boundary_recovery_lens_ptr, null_block_id, stride_state_indices, SPEC_QUERY_LEN)
¶
The commit plan folding each request's pending replay into its checkpoint in place (deferred RecoverSSM steps that the stock verify runs).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/recoverssm/kernels.py
kda_recoverssm_verify(q, k, v, raw_g, raw_beta, A_log, dt_bias, lower_bound, checkpoint_state, records, query_start_loc, state_indices, spec_query_len, out=None, record_indices=None)
¶
Verify a KDA speculative window without modifying its checkpoint. Request
b writes its verify records to row b of records, or to row
record_indices[b] (deferred RecoverSSM: records indexed by request slot).
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/recoverssm/kernels.py
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 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |