Repository navigation
test(fsdp): verify optimizer CUDA graphs in v2 - #6498
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
37bc223 to
c98aecd
Compare
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31737737376 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31745334721 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31746289164 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31752937667 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31755638967 |
…ware optimizer, HSDP, and optimizer CUDA graphs Megatron-LM landed dedicated MFSDP v2 support for these, each with its own commits and tests, after this validation function was written: - clip_grad: MFSDP v2 gradient clipping across dense and expert meshes (NVIDIA/Megatron-LM#6489) - use_precision_aware_optimizer: mixed-precision optimizers in MFSDP v2 (NVIDIA/Megatron-LM#6506) - num_distributed_optimizer_instances / outer_dp_sharding_strategy (HSDP): expose HSDP and HFSDP through the MFSDP v2 adapter (NVIDIA/Megatron-LM#6873); the adapter itself now enforces the correct paired constraint, so no replacement check is needed here - optimizer_cuda_graph: verified for MFSDP v2 (NVIDIA/Megatron-LM#6498) Verified end-to-end against Megatron-LM main + Megatron-Bridge with the DeepSeek-V3 MFSDP v2 + EP proxy config (clip_grad=1.0): 20/20 iterations, finite decreasing loss, no skipped or NaN iterations.
…ware optimizer, HSDP, and optimizer CUDA graphs Megatron-LM landed dedicated MFSDP v2 support for these, each with its own commits and tests, after this validation function was written: - clip_grad: MFSDP v2 gradient clipping across dense and expert meshes (NVIDIA/Megatron-LM#6489) - use_precision_aware_optimizer: mixed-precision optimizers in MFSDP v2 (NVIDIA/Megatron-LM#6506) - num_distributed_optimizer_instances / outer_dp_sharding_strategy (HSDP): expose HSDP and HFSDP through the MFSDP v2 adapter (NVIDIA/Megatron-LM#6873); the adapter itself now enforces the correct paired constraint, so no replacement check is needed here - optimizer_cuda_graph: verified for MFSDP v2 (NVIDIA/Megatron-LM#6498) Verified end-to-end against Megatron-LM main + Megatron-Bridge with the DeepSeek-V3 MFSDP v2 + EP proxy config (clip_grad=1.0): 20/20 iterations, finite decreasing loss, no skipped or NaN iterations. Signed-off-by: Jingyue Wu <wujingyue@gmail.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
…ware optimizer, HSDP, and optimizer CUDA graphs Megatron-LM landed dedicated MFSDP v2 support for these, each with its own commits and tests, after this validation function was written: - clip_grad: MFSDP v2 gradient clipping across dense and expert meshes (NVIDIA/Megatron-LM#6489) - use_precision_aware_optimizer: mixed-precision optimizers in MFSDP v2 (NVIDIA/Megatron-LM#6506) - num_distributed_optimizer_instances / outer_dp_sharding_strategy (HSDP): expose HSDP and HFSDP through the MFSDP v2 adapter (NVIDIA/Megatron-LM#6873); the adapter itself now enforces the correct paired constraint, so no replacement check is needed here - optimizer_cuda_graph: verified for MFSDP v2 (NVIDIA/Megatron-LM#6498) Verified end-to-end against Megatron-LM main + Megatron-Bridge with the DeepSeek-V3 MFSDP v2 + EP proxy config (clip_grad=1.0): 20/20 iterations, finite decreasing loss, no skipped or NaN iterations. Signed-off-by: Jingyue Wu <wujingyue@gmail.com>
Summary
Enable
optimizer_cuda_graphfor MFSDP v2 by removing its configuration guard.Extend the MCore adapter optimizer integration test to exercise eager execution plus optimizer-step CUDA-graph warmup, capture, and replay against the existing unsharded reference.
Capturable Transformer Engine FusedAdam requires main gradients to use the configured main-weight dtype. The CUDA-graph test derives that dtype from the MFSDP configuration; the eager variant retains its default bf16 main gradients. See NVIDIA/TransformerEngine#3358.
Validation
python -m torch.distributed.run --nproc-per-node 2 -m pytest -q tests/unit_tests/distributed/mfsdp_v2/test_mcore_adapter.py::TestMcoreAdapter::test_build_train_and_steppython -m black --check tests/unit_tests/distributed/mfsdp_v2/test_mcore_adapter.pypython -m isort --check-only tests/unit_tests/distributed/mfsdp_v2/test_mcore_adapter.py