Broaden megatron-core packages.find to megatron* (namespaces), keep plugins#50
Open
Shi-Dong wants to merge 1 commit into
Open
Broaden megatron-core packages.find to megatron* (namespaces), keep plugins#50Shi-Dong wants to merge 1 commit into
Shi-Dong wants to merge 1 commit into
Conversation
Builds on PR #49 (miles_megatron_plugins packaged with megatron-core). Widen the find list to every megatron.* subpackage and enable namespace packages so an editable install exposes megatron.training/legacy/rl without a PYTHONPATH override, while preserving the miles_megatron_plugins entries PR #49 added.
This was referenced May 30, 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
Builds on the merged #49 (
Package miles_megatron_plugins with Megatron Core) by broadening[tool.setuptools.packages.find].includefrommegatron.core*tomegatron*withnamespaces = true, while keepingmiles_megatron_pluginsin the include list.This lets callers (e.g. the miles training runner)
pip install -e .this checkout and import frommegatron.training,megatron.legacy,megatron.rl, etc. without aPYTHONPATHoverride —megatron.training.initializeimports frommegatron.legacyat module load, so a narrower include list breaks transitively.namespaces = trueis required becausemegatron,megatron.legacy, and several sub-packages are PEP-420 namespace packages (no__init__.py).Why
The miles submoduling stack pins this repo as
third_party/Megatron-LMand bundles bothmegatron.*andmiles_megatron_pluginsinto themiles-rlwheel directly from the submodule. That requires the source checkout to expose the fullmegatron*tree (not justmegatron.core) and to keep packaging the plugins. This PR reconciles both needs in one place, on top of the currentmiles-main(post-#49).Supersedes
Replaces the obsolete pair:
Remove miles_megatron_plugins/) — contradicts Package miles_megatron_plugins with Megatron Core #49; we keep the plugins inside Megatron-LM.Broaden packages.find.include) — folded into this single commit on top of the currentmiles-main.Test plan
pip install -e .on this checkout, thenpython -c "import megatron.training, megatron.legacy, miles_megatron_plugins"with noPYTHONPATHoverridemiles-rlwheel from the miles submoduling stack and confirmmegatron*+miles_megatron_pluginsland at the top level of site-packages