fix(dspark): reduce V2 working VRAM#27
Open
alexbi29 wants to merge 7 commits into
Open
Conversation
alexbi29
force-pushed
the
codex/ds4-vram-kv-cleanups
branch
4 times, most recently
from
July 7, 2026 23:53
32fdb44 to
d82b645
Compare
alexbi29
force-pushed
the
codex/ds4-vram-kv-cleanups
branch
2 times, most recently
from
July 14, 2026 00:56
65d2885 to
40f1d12
Compare
dspark_inv_rope_bf16_layout and dspark_markov_greedy_argmax (and the two Triton kernels backing the latter) have no production callers anywhere in the tree; the live draft path uses the BF16 WO_A projection and the fused probabilistic Markov sampler (dspark_markov_probs_sample). Drop the dead wrappers, kernels, and their standalone tests.
alexbi29
force-pushed
the
codex/ds4-vram-kv-cleanups
branch
from
July 17, 2026 23:34
ced1c66 to
92d4c2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces DeepSeek V4 / DSpark V2 working VRAM and increases usable KV cache on the 2x SM120 DSpark serving config.
Main changes:
mtp.n_local_heads == padded_heads; in that case the fused qnorm/RoPE/KV-insert op can write Q in place.[T, hc, H]just to producehc_headoutput and Eagle aux means.[T, hc, H]allocation.[T, H]profile allocation per rank without changing kernel math or launch count.Live memory result
Measured on 2x RTX PRO 6000 Blackwell / SM120, TP=2, DSpark V2, GMU 0.975, max model len 524288.
Net from baseline: +1.07 GiB available KV and +110,442 KV tokens.
Validation
git diff --check, targetedpy_compilepassed.tests/v1/spec_decode/test_dspark_config.py,test_rejection_sampler_utils.py,test_dspark.pypassed (48 passed).30 passed).7*8 -> 56.309.2 tok/s, median310.9, range304.7-311.4, versus current-step post-JIT baseline median297.7.6106 / 8004 / 7710 / 6369 tok/sat1K / 4K / 16K / 65Kprompt sizes.17 + 25 -> 42.tests/v1/spec_decode/test_dspark_config.py->2 passedtest_dense_draft_logits_index_mapping_matches_state_indexedandtest_gumbel_sample_stores_processed_logits_inplace->2 passed20 passed; deployed profile11.61 GiB/1,205,591tokens /2.30x; warm decode A/B307.6vs307.5 tok/s; final deployed warm median310.0 tok/s; coherency17 + 25 -> 42.max_tokens=500,temperature=0, thinking off):c=2275.7 aggregate tok/s (52.95% draft accept),c=4393.2 tok/s (55.07%),c=8577.9 tok/s (56.92%).286.5 tok/s; 65,539-token prompt median287.9 tok/s; both ~7% below the310.0 tok/sshort-context median with no further 64K degradation.