Repository navigation
spark-model: size DFlash SSM verify pools uniformly at K-1 - #38
Merged
Merged
Conversation
Under --dflash the H-intermediate pool tiered every slot to the MTP K-ladder (<=3 at gamma=8) and the first verify refused "SSM MTP intermediate buffers not allocated": the uniform-sizing detector was `num_intermediates != num_drafts + 1`, but DFlash verify rows resolve to exactly `num_drafts + 1` (`dspark_pool::dflash_verify_rows`), so the comparison was always equal and the uniform branch was unreachable. Preflight already reserved uniform for `args.dflash`, so the serve booted and died on the first verify; only ATLAS_MTP_POOL_FULL_WIDTH masked it. Detect DFlash directly from `config.dflash_capture_layers` — the same field impl_a1 feeds dflash_verify_rows — keeping the tiered ladder for MTP-only pools and the dead comparison as a defensive term. DSpark is covered through the same capture-layers path. Adds a MockGpuBackend regression test asserting uniform K-1 geometry at gamma=8 across all 16 slots plus the always-full-width dummy, with the no-capture-layers geometry pinning the tiered counterfactual (3/1/7). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Sep 19, 2026
Closed
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
Under
--dflash, every SSM verify slot's H-intermediate pool was silently tiered to the MTP K-ladder (≤3 intermediates at γ=8) and the first verify refused withSSM MTP intermediate buffers not allocated— finishing the request at one token. OnlyATLAS_MTP_POOL_FULL_WIDTH=1masked it (the current recipe's required env gate).Root cause: the uniform-sizing detector was
num_intermediates != num_drafts + 1, but DFlash verify rows resolve to exactlynum_drafts + 1(dspark_pool::dflash_verify_rows—[last_token, draft_1, .., draft_K], the anchor bonus is not a draft row). The comparison is always equal under--dflash, so the uniform branch was unreachable. Preflight already reserves uniform forargs.dflash, so the serve boots and dies at runtime instead of at allocation.Fix: detect DFlash directly from
config.dflash_capture_layers— the same fieldimpl_a1feedsdflash_verify_rows— keeping the MTP-ladder tiers for MTP-only pools and the dead comparison as a defensive term. DSpark is covered through the same capture-layers path.Once an image with this lands,
ATLAS_MTP_POOL_FULL_WIDTH=1can drop out of the DFlash2 recipe (the env remains a valid kill switch for the bs>32 slot-count diet).Test plan
MockGpuBackendregression testdflash_pools_size_h_intermediates_uniformly: γ=8 geometry (K=8 → 7 intermediates) across 16 slots — fails on pre-fix code (left: 3, right: 7, the exact tiered under-allocation), passes post-fix. Counterfactual pins the tiered path (slots 0/15/dummy = 3/1/7) when capture layers are absent.cargo test -p spark-model --lib dflash_pools_sizeon GB10 (aarch64 + CUDA): red→green verifiedcargo fmt --all -- --check,cargo clippy -p spark-model -p spark-server --testson pinned 1.93.1: clean--dflashγ=8 serve WITHOUTATLAS_MTP_POOL_FULL_WIDTH— first request ranserial=0.00 mtp=1.00 p1=0.520 mean_na=1.680 tok_step=2.680, nointermediate buffersrefusal. (9.6 tok/s is the debug build; acceptance, not throughput, is the signal.)Generated with Devin