feat(megatron-run): support command prefix - #1029
Merged
podkidyshev merged 1 commit intoSep 11, 2026
Merged
Conversation
saivishal1999
requested review from
jj10306,
podkidyshev,
rutayan-nv and
srivatsankrishnan
as code owners
September 10, 2026 19:29
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughChangesMegatron command prefix
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The optional command prefix is applied to generated Megatron Slurm commands without becoming a Megatron CLI option, while the default behavior remains unchanged. The change is mergeable with no concrete blocking risk identified. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
podkidyshev
approved these changes
Sep 11, 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
Adds
command_prefixsupport to MegatronRun so workloads can prepend a wrapper command before the Megatron training entrypoint.This is intended to replace patch-based command wrapping used by some recipes, for example:
With this field, the generated command becomes:
/cloudai_install/bindpcie -- python /megatron/pretrain_hybrid.py ...
The field is excluded from Megatron CLI arguments, so it controls CloudAI command generation only and is not forwarded to the training script.
Test / Verification Plan
Config validation:
command_prefix = "/cloudai_install/bindpcie --"locally to representative MegatronRun test TOMLs.verify-configswith this CloudAI branch:Command-generation validation:
Compared generated dry-run output against the previous patch-based command wrapping flow.
Dry-ran representative MegatronRun scenarios:
Result:
test_cmdmatched the patch-based flow after normalizing local output/install paths.srun_cmdmatched the patch-based flow after normalizing local output/install paths.nsys profile ... /cloudai_install/bindpcie -- python /megatron/pretrain_hybrid.py ...--command-prefixis not forwarded to Megatron CLI args.