Repository navigation
[training] fix: restore alltoall when flex backend is cleared - #5740
Merged
Merged
Conversation
Signed-off-by: Yu Yao <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test dd3d79b |
Contributor
|
LGTM. The added guard in validate_flex_dispatcher_backend closes a gap where a flex dispatcher type with a cleared backend previously passed validation; it now falls back to alltoall. The new test covers this override path. Suggested test cases:
|
This branch was previously deployed
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
Supported trigger and impact
The shared recipe runner accepts trailing configuration overrides after the recipe factory returns. A flex-enabled MoE recipe such as Qwen3-Next therefore accepts model.moe_flex_dispatcher_backend=null after the factory has selected the flex dispatcher.
Previously that override cleared only the backend. Bridge validation accepted the resulting flex dispatcher with no backend, and pinned Megatron-Core then raised ValueError: Invalid backend: None while constructing the MoE layer. This prevents an otherwise documented alltoall configuration from starting training.
This is a recurrence of the invariant documented in #2861. Its earlier fix was scoped to the legacy performance launcher; the unified recipe finalization path remained exposed.
Root cause and fix
ConfigContainer calls validate_flex_dispatcher_backend after post-factory overrides and model finalization. That validation checked hardware support for named DeepEP and HybridEP backends but did not reconcile flex with a cleared backend.
The fix uses the existing alltoall fallback at this final shared boundary before Megatron-Core model construction. It does not change backend hardware support or enable any new mode.
Regression evidence
Fail before:
Pass after:
Scope
No Megatron-Core changes, public API changes, dependency changes, CI changes, or backend availability changes are included.