You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add opt-in Turbo fused cross entropy for TP1 training - #1245
Megatron TP1 training can opt into Turbo fused cross entropy through the declared use_turbo_cross_entropy training argument. The patch preserves Core's sequence/batch layout and per-token loss contract; unsupported tensor parallelism, dtypes, and unfused configurations retain the configured implementation.
turbo_ce_overwrite_input additionally permits backward to reuse exclusively owned contiguous logits storage. Both arguments default false in primus/configs/modules/megatron/primus_turbo.yaml and support experiment YAML and Primus CLI overrides. The patch no longer reads PRIMUS_TURBO_CROSS_ENTROPY or PRIMUS_TURBO_CE_OVERWRITE_INPUT. Documentation is linked from the docs index and site navigation.
The Turbo dependencies #546 and #550 are merged. CI pins Turbo main at 4e6bd90b4fd9aa40c7945674d83975ee150a7b68, which includes both MoE gather fusion and fused cross entropy.
Training subprocess tests now use independent c10d rendezvous ports allocated and held by torchrun. This fixes inherited MASTER_PORT collisions in pipeline-warmup and projection tests. A regression test launches two concurrent distributed jobs while the inherited port is occupied. Multi-node test settings are preserved.
MI300X PyTorch: 3,219 core tests passed (1,039 skipped, 8 deselected), including all 13 cross-entropy tests and the new concurrent-rendezvous regression. All 19 Megatron and 7 TorchTitan training tests passed, as did CLI smoke checks.
TorchTitan Llama FP8 reported finite losses (12.26768, 22.06730, 22.74743) and gradients for all three steps. An earlier MI300X NaN failure did not recur; the rendezvous fix addresses port collisions, and no numerical workaround or relaxed metric assertion was added.
All 25 focused local rendezvous, finite-metric, and cross-entropy configuration tests passed.
Five local eight-GPU MI355X runs of the three-step TorchTitan Llama FP8 recipe passed with finite metrics, including fixed seeds 0/1/2 and a run through the updated training helper while the inherited port was deliberately occupied.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
It modifies core loss and gradient behavior using an unmerged external dependency without full-model validation on the current parent.
0 open findings
Previously missed (1)
In code that hasn't changed since last review
Add the new documentation page to navigation and TOC
docs/features/turbo_cross_entropy.md:1
This page is not included in the documentation navigation, so the new usage instructions will not be published/discoverable through the rendered docs. The site uses the explicit list in docs/sphinx/_toc.yml.in, and docs/README.md also has no link to this sole docs/features/ page. Please move/link it under an existing section (for example Technical guides) and add it to the TOC.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Full CI remains in progress, and the previously observed MI300X non-finite-metrics failure has not yet been resolved or reproduced.
0 open findings
🧠 Review effort: Balanced
This branch has not been deployed
No deployments
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
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.
Megatron TP1 training can opt into Turbo fused cross entropy through the declared
use_turbo_cross_entropytraining argument. The patch preserves Core's sequence/batch layout and per-token loss contract; unsupported tensor parallelism, dtypes, and unfused configurations retain the configured implementation.turbo_ce_overwrite_inputadditionally permits backward to reuse exclusively owned contiguous logits storage. Both arguments default false inprimus/configs/modules/megatron/primus_turbo.yamland support experiment YAML and Primus CLI overrides. The patch no longer readsPRIMUS_TURBO_CROSS_ENTROPYorPRIMUS_TURBO_CE_OVERWRITE_INPUT. Documentation is linked from the docs index and site navigation.The Turbo dependencies #546 and #550 are merged. CI pins Turbo main at
4e6bd90b4fd9aa40c7945674d83975ee150a7b68, which includes both MoE gather fusion and fused cross entropy.Training subprocess tests now use independent c10d rendezvous ports allocated and held by torchrun. This fixes inherited
MASTER_PORTcollisions in pipeline-warmup and projection tests. A regression test launches two concurrent distributed jobs while the inherited port is occupied. Multi-node test settings are preserved.Validation:
99439f8d4: https://github.com/AMD-AGI/Primus/actions/runs/3811216745612.26768,22.06730,22.74743) and gradients for all three steps. An earlier MI300X NaN failure did not recur; the rendezvous fix addresses port collisions, and no numerical workaround or relaxed metric assertion was added.