spec(blackwell): SPEC-BLACKWELL-FIX-001 — GB10 training enablement (PMAT-700)#1803
Merged
Conversation
…sign (PMAT-700) GB10 (sm_121) hits CUDA_ERROR_OUT_OF_MEMORY at "Block 0 upload" during apr distill --backend cuda, even with a 0.5B teacher on 128GB unified memory. Root cause is PTX JIT cache memory pressure: pre-warming 27+ custom kernels for sm_121 allocates so much VRAM that the subsequent block upload has no headroom. Live evidence in evidence/distill-phase-3-gb10-oom/. Design surfaces a three-pronged root-cause fix using the existing cuBLAS / PTX / wgpu backends, not a workaround: Fix #1 — PTX precompilation for sm_121 (eliminates JIT entirely) Fix #2 — Migrate backward GEMMs to cuBLAS (eliminates 7 PTX kernels per layer; 168 fewer JIT modules for a 24-layer model) Fix #3 — wgpu backward fallback (cross-vendor safety net) Each fix has its own falsifier (F-BLACKWELL-PTX-001, F-BLACKWELL- CUBLAS-001, F-BLACKWELL-WGPU-FALLBACK-001) and standalone value. Fix #2 alone is likely sufficient for the immediate gx10 unblock (3-4 day effort, drop-in, also a perf win on every host). Rollout: spec → Fix #2 → Fix #1 → Fix #3 → re-dispatch Phase 3 on gx10. 7-10 days from spec-land to gx10 dispatch working, vs waiting on upstream trueno 0.4.36 (uncertain timeline). Evidence: - evidence/distill-phase-3-gb10-oom/dispatch-v6-0.5b-oom.txt - evidence/distill-phase-3-gb10-oom/remote-traces.txt Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
5 tasks
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
GB10 (sm_121) hits
CUDA_ERROR_OUT_OF_MEMORYat "Block 0 upload" duringapr distill --backend cuda, even with a 0.5B model on a 128GB unified memory pool. The root cause is PTX JIT cache memory pressure — pre-warming 27+ custom kernels for sm_121 allocates enough VRAM that the subsequent transformer block upload has no headroom.Design — three coordinated backend changes
Each fix has its own falsifier:
F-BLACKWELL-PTX-001,F-BLACKWELL-CUBLAS-001,F-BLACKWELL-WGPU-FALLBACK-001.Why not just wait for trueno 0.4.36?
The memory rule says upstream trueno will fix Blackwell training, but timeline is uncertain. This spec ships the in-tree workaround with the same backends already in tree, giving us a 7-10 day path to gx10 dispatch working — independent of upstream timeline.
Evidence
Live OOM traces from gx10 dispatch attempts (Qwen 0.5B teacher, Qwen 0.5B student):
evidence/distill-phase-3-gb10-oom/dispatch-v6-0.5b-oom.txtevidence/distill-phase-3-gb10-oom/remote-traces.txtPre-warm contract that documents the JIT pressure:
crates/aprender-train/src/finetune/classify_pipeline/gpu.rs:56-59(C-PREWARM-001).Recommendation
Start with Fix #2 (cuBLAS backward GEMM). Three reasons:
If #2 doesn't fully unblock GB10, layer in Fix #1 (PTX precomp) for a complete elimination of runtime JIT. Fix #3 lands last as cross-vendor safety net.
Rollout
Test plan
This PR is a spec document; the falsifiers fire on the implementation PRs (PMAT-700-B through -D). Acceptance for Phase E:
STEPS=50 ./scripts/dispatch-distill-phase-3-gx10.shcompletes without OOMfinal_loss < initial_loss(F-DISTILL-SMOKE-001 dischargeable)🤖 Generated with Claude Code