fix(ds4): enforce sparse top-k row-length contract - #431
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
171d821
into
local-inference-lab:dev/infernal-invocation
Resulting behavior
DeepSeek V4 sparse-indexer row lengths now obey one contract across metadata production and top-k consumption:
min(logits.stride(0), max_seq_len)scores from each row;Valid row lengths and selected top-k sets are unchanged.
Technical reason
Uniform MTP metadata computed
seq_len - max_decode_len + token_offset + 1. A CUDA-graph padding request withseq_len == 0therefore produced-1for its first token. The top-k kernels consume row lengths in unsigned indexing decisions, so the negative value could select scores from a non-empty row instead of returning-1padding.Persistent CTA groups also indexed their triple-buffered histogram by every assigned row. A short row does not execute radix selection, so counting it advanced the ring without initializing that generation. A later long row assigned to the same group could consume stale histogram state.
The implementation adapts the applicable contracts from upstream vLLM #49139 and #51538 to the Infernal Invocation metadata and B12X integration.
Compatibility
Validation
Status: implemented. Compiled C++ kernel qualification is part of the Infernal Invocation release image build because an existing image contains the previous
_Cextension.ruff checkandruff format: pass.[-1, 0, 4, 5], expected-contract assertion failed;[0, 0, 4, 5], passed.The compiled-kernel tests must pass against the release-built extension before image publication.