Stream optimizer main initialization to NVMe - #2653
Merged
yueming-yuan merged 2 commits intoAug 31, 2026
Merged
Conversation
6 tasks
ziang-and
force-pushed
the
ziang/stream-optimizer-main-init
branch
from
August 20, 2026 23:23
078621b to
1697c45
Compare
zianglih
marked this pull request as ready for review
August 21, 2026 06:24
zianglih
requested review from
Shi-Dong,
Zhichenzzz,
fzyzcjy,
maocheng23,
yueming-yuan and
yushengsu-thu
as code owners
August 21, 2026 06:24
zianglih
force-pushed
the
ziang/stream-optimizer-main-init
branch
2 times, most recently
from
August 30, 2026 20:25
8398040 to
0401d4e
Compare
zianglih
force-pushed
the
ziang/stream-optimizer-main-init
branch
from
August 30, 2026 20:28
0401d4e to
ab760c0
Compare
yueming-yuan
approved these changes
Aug 31, 2026
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
@HumansAnd
ci-megatron-pr: #86
Extend
--stream-optimizer-state-to-diskto distributed-optimizer construction. Miles enables the paired Megatron deferred-main mode for the Adam/DistributedOptimizer path, then initializes FP32 mains one existing runtime bucket at a time directly in their final files.c0dad034d0eb0e57fde0267d38589f42eb7213b1.+89/-6; no compatibility fallback or broad exception handling was added.Design
200,000,000-element soft bucket limit and final store layout. There is no temporary full-main file or parallel fallback path.Validation
docker.io/radixark/miles:dev-202608301223; OCI indexsha256:22c82828fca9215e22c8493bfe53fba12ca2b63feb0e6343c052fc48f16e7d47; linux/amd64 manifestsha256:cb5beb813caa5aaaf47b144bc4fabe7b75cae1c1cf65bf7cac5b6840c5b110e3.590.48.01, PyTorch2.13.0+cu130, CUDA13.0, imageCUDA_VERSION=13.0.3. Focused GPU tests used GPU 0; each E2E used four GPUs.0401d4e3f2baf20855bd4ce821e20d4569664fbe; the submitted head differs only by qualifying one documentation sentence to the Adam/DistributedOptimizer path, and every changed Python blob is identical. Megatron was tested at the exact head above. The full Miles command prepends/root/Megatron-LM, so the two changed Megatron runtime files were overlaid on its exact image base; their hashes matched the synced Megatron head.Focused tests
The Miles GPU test verifies zero-tolerance BF16-to-FP32 bytes in the final file and zero CUDA backing storage after initialization. The Megatron test verifies stable tensor identity, logical shape, FP32 CUDA metadata, and zero backing storage.
The effective dispatch contract was also checked directly:
Four-GPU Qwen3-4B E2E
After one explicit-loopback checkpoint conversion, the existing E2E
execute()paths ran with TP2/PP1/CP1, four B300s, two rollouts/optimizer steps, colocated SGLang, disk train offload, and--stream-optimizer-state-to-disk:Adam/DistributedOptimizer, Ray job
raysubmit_G7VgaVvS5pNDL9Xn:Muon upstream control, Ray job
raysubmit_1DNkhNExcJ1nLigM:Both jobs completed both training steps. No CUDA OOM, host OOM, ENOSPC, invalid step, or Ray failure was observed.
Repository checks
Limitations
torchrun, then both existing E2E execution paths ran unchanged./freeze_gcconnection races before reporting ready. Subsequent requests and both Ray jobs succeeded.