Repository navigation
fix(dsv41): warm small prefill tails before serving - #1
Closed
JoelAHilliard wants to merge 1 commit into
Closed
JoelAHilliard wants to merge 1 commit into
JoelAHilliard wants to merge 1 commit into
Conversation
4 of 8 tasks
Owner
|
Thank you @JoelAHilliard — a really careful catch. ELI5: a request whose last prefill chunk is 13 rows asks the GPU for a kernel size that was never loaded at warmup, so the first such request pays a cold load (in your log, a load crash that took the lane down). We're not merging it right now: the repo is in maintenance mode and this changes serving behavior (extra warmup prompts), so we're only taking small fixes that leave existing behavior untouched. Your analysis of the gap — decode warms the fused path, prefill uses |
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.
With
TF_DS_PREFILL_CHUNK=2048andTF_DS_WARM_LENGTHS=1,17,33,131,514,1024,2113, a 20,493-token request can first load the 13-row prefill indexer kernel during serving. The observed deployment ran for about 15.5 hours before rank 0 failed atTriton load_binarywithCUDA: operation not permitted; the lane then required restarting every rank.Decode warmup does not cover this specialization: its indexer uses the fused
rowmm_wtspath, while prefill usesrowmm2/_rowmm2r. Prompts shorter than a compression block can also skip the prefill indexer entirely. The failing request had 12,288 cached tokens and a 13-token final chunk (20493 % 2048).This change adds every small row count and
PREFILL_CHUNK + row_countto the configured warmup prompts, bounded bymin(PREFILL_CHUNK, DECODE_ROWS). It preserves configured order, removes duplicates, retains the existing context/decode headroom check, and reports the number of eligible warmup prompts.TF_DS_WARM=0retains its existing behavior. The second-chunk cases exercise the prefill indexer with compressed keys present.The fix closes the verified warmup coverage gap. It does not establish the underlying cause of the intermittent CUDA 800 binary-load rejection. Isolated cold 13-row loading, cold loading inside graph capture, and preloaded graph replay all passed on the same hardware after unloading the model; graph capture alone did not reproduce the failure.
Validation receipt:
DsEngine.warmmethod with CPU doubles for CUDA, caches and forward calls. They cover serial/concurrent serving, the failing 13-row tail, custom chunk sizes and row bounds, deduplication, context headroom and the reported warmup count. Before: 8 failed, 3 passed. After: 11 passed.git diff --checkpass. The engine retains the same two baseline lint findings (UP035,SIM115); checking with those inherited findings excluded passes.Environment: two DGX Sparks / NVIDIA GB10, TensorFold 0.6.6 at
808eb4a1090ca7b79173cc2c799de16da5f923e3, with the exact candidate engine file overlaid on both ranks. The base engine file is identical to this PR's parent90b68e063a0b8bba59aaf13340ef16619e751195. PyTorch2.13.0a0+9186a08b2c.nv26.07, Triton3.7.1, CUDA13.3; kernel driver580.159.03, CUDA compatibility driver610.43.02. The existing active-MTU RDMA patch was retained.Checkpoint:
Mia-AiLab/DeepSeek-V4.1-Flash-EXL3-2.9bpwrevision64ba41b6c916a587db06eae2e19b7845f7be6e6b; original DeepSeek Engram shards at2cba9e42aa026125f3ed06c6d98c1db82f7ca027, with original vision gate biases. Serving: tensor parallel 2, context 262,144, parallel 4, MTP drafts 5, vision enabled,TF_DS_REPLAY=1, prefill chunk 2,048.Full 2k/8k/16k/32k/64k prompt benchmarks, sustained decode performance measurements, and the full newer fork revision were not run. This change adds startup work; it does not change model arithmetic or the serving forward paths. The original long-uptime failure has not been reproduced after the fix.
Live GPU verification used the original seven configured warmup lengths and the exact candidate engine file on both ranks (SHA-256
ed2a0d72b10ddc0c485a86c81a2a928b405d8bbed32ea0b705a4a98369ff8895):_rowmm2rvariants during startup, including the exact previously failing binary (a514c90f155e9c3687cc40bc1964e36f25c27c8fe69e4802d9b3ae9c9f34a9ed), with zero_rowmm2rloads during serving throughout the probes below.[1000 + (i * 7919) % 60000 for i in range(n)]. The 20493-token request reused 12288 cached tokens, matching the observed failure's cache boundary.tools/bench_concurrent.pyrequest helpers and its public code/chat prompts, 16-token replies at temperatures 0 and 1 passed 10 drafted-vs-serial token-hash comparisons and 16 concurrent-vs-solo comparisons, with all four streams active. Hashes were present and explicitly compared, rather than accepting missing hashes as equal.Two single-run cold-prompt timing probes used distinct prefixes, one generated token and zero cached tokens:
These single-run probes are diagnostic checks, not a statistically controlled performance comparison.