fix(distributed): Fix UMA graph-parallel stress reduction - #156
fix(distributed): Fix UMA graph-parallel stress reduction#156atulcthakur wants to merge 1 commit into
Conversation
Signed-off-by: atulcthakur <atthakur@nvidia.com>
|
/ok to test 2e43853 |
| continue | ||
| value = value.clone() | ||
| if grp is not None: | ||
| dist.all_reduce(value, op=dist.ReduceOp.SUM, group=grp) |
There was a problem hiding this comment.
Preserve differentiable reduction semantics
This generic loop handles every spec-declared all-reduce output with plain dist.all_reduce, bypassing the autograd-aware reduction and world-size correction used by consolidate_sharded_outputs when an output is also listed in model_config.autograd_outputs. Route overlapping outputs through the differentiable consolidation path so extending the spec does not silently produce rank-local gradients.
Knowledge Base Used: Distributed domain decomposition
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Greptile SummaryFixes graph-partition stress consolidation by SUM-reducing spec-declared rank partials before marking them global, and extends the multi-GPU UMA test to compare every rank’s stress against a single-GPU reference. Important Files Changed
Reviews (1): Last reviewed commit: "fix(distributed): all-reduce graph-paral..." | Re-trigger Greptile |
ALCHEMI Toolkit Pull Request
Description
In UMA graph-partition execution, each rank calculates a local contribution
to the system stress.
Energy and forces were reduced across ranks, but stress was not. Instead,
stress entered the generic output-consolidation logic, which divided this
local contribution by the number of ranks without first summing the
contributions.
This caused each rank to return an incomplete stress tensor.
Bug example
Using
uma-s-1p1with theomattask on two H100 GPUs:stress[0, 0]:0.012035440.002988840.003028889.2e-03Neither rank returned the correct system stress.
Fix
In the internal graph-partition path:
domain process group.
autograd
/world_sizecorrection.After the all-reduce, every rank receives the complete system stress.
Type of Change
Related Issues
Changes Made
nvalchemi/distributed/distributed_model.pyworld_size.test/distributed/model/test_uma_gp_partition_multigpu.pyTesting
Extended the real UMA graph-partition multi-GPU test to:
reference.
The test passed on two H100 GPUs:
Stress error on both ranks:
2.96e-08Unit tests pass locally (
make pytest)Linting passes (
make lint)New tests added for new functionality meets coverage expectations?
Checklist
Additional Notes
Tip
This repository uses Greptile, an AI code review service, to help conduct
pull request reviews. We encourage contributors to read and consider suggestions
made by Greptile, but note that human maintainers will provide the necessary
reviews for merging: Greptile's comments are not a qualitative judgement
of your code, nor is it an indication that the PR will be accepted/rejected.
We encourage the use of emoji reactions to Greptile comments, depending on
their usefulness and accuracy.