[Feature] Add --mg-fl-prefer argument for Megatron-LM-FL vendor selection#1183
Merged
lxd-cumt merged 1 commit intoflagos-ai:mainfrom Apr 3, 2026
Merged
Conversation
…tion Add a new command-line argument --mg-fl-prefer to select the preferred vendor backend (cuda/musa/txda) for Megatron-LM-FL plugin override dispatch. The value is synced to the MG_FL_PREFER environment variable at training startup, enabling YAML-based configuration of vendor selection alongside the existing --te-fl-prefer mechanism.
aoyulong
approved these changes
Apr 3, 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
--mg-fl-preferCLI argument to select the preferred vendor backend (cuda/musa/txda) for Megatron-LM-FL plugin override dispatchMG_FL_PREFERenvironment variable at training startup, following the same pattern as--te-fl-prefer/TE_FL_PREFERChanges
flagscale/train/megatron/training/arguments_fs.py--mg-fl-preferargument with choices['cuda', 'musa', 'txda'], default empty stringflagscale/train/megatron/training/training.pyargs.mg_fl_prefertoos.environ['MG_FL_PREFER']inpretrain(), alongside the existingTE_FL_PREFERsync logicUsage
CLI:
YAML config:
Test plan
--mg-fl-prefer musasetsMG_FL_PREFER=musain the environment--mg-fl-preferdoes not setMG_FL_PREFER--te-fl-preferargument