Remove miles_megatron_plugins/ (moved to radixark/miles)#32
Draft
Shi-Dong wants to merge 1 commit into
Draft
Conversation
The miles_megatron_plugins package is semantically part of miles (it
implements the miles <-> megatron contracts), not part of Megatron-LM.
It is being moved into the radixark/miles repository as a top-level
Python package, so that it is exposed via the miles wheel rather than
via a PYTHONPATH=/root/Megatron-LM hack.
The `from miles_megatron_plugins...` imports inside Megatron-LM source
files (transformer_layer, transformer_block, attention, gpt_model,
gpt_layer_specs, distributed_data_parallel, tensor_parallel/{layers,
matmul_tp_inv}, models/gpt/{gpt_model, gpt_layer_specs}, extensions/
sglang, etc.) continue to work because miles is always installed before
megatron.core is imported in production, and miles now exposes
miles_megatron_plugins as a top-level package via its setup.py
find_packages include.
Coordinated change: the matching radixark/miles PR adds
miles_megatron_plugins/ at the top level of the miles repo and bumps
the third_party/Megatron-LM submodule pointer to this branch.
2 tasks
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
miles_megatron_plugins/frommiles-main.radixark/milesas a top-level Python package; see the matching miles PR (linked once opened).Why
miles_megatron_pluginsimplements the miles ↔ megatron contracts (true-on-policy backends, matmul / attention / rope replacements, sglang glue). It is conceptually miles' code that Megatron-LM imports back, not Megatron-LM's own code.Today it lives inside this fork's working tree and is only on
sys.pathbecause miles' production setup usesPYTHONPATH=/root/Megatron-LM. That PYTHONPATH hack does not survive packaging miles as a wheel forpip install miles. Moving the package into miles makes it part of miles' regular Python package and removes the dependency on PYTHONPATH for this specific package.The
from miles_megatron_plugins.* import ...statements scattered across Megatron-LM source files (transformer_layer,transformer_block,attention,gpt_model,gpt_layer_specs,distributed_data_parallel,tensor_parallel/layers,tensor_parallel/matmul_tp_inv,models/gpt/{gpt_model, gpt_layer_specs},extensions/sglang, …) continue to work in production because miles is always installed beforemegatron.coreis imported, and the matching miles PR addsmiles_megatron_pluginsas a top-level package in miles'setup.pyfind_packagesinclude list. Python's import system resolves themiles_megatron_pluginsname via miles' installed location instead of via a sibling directory in the Megatron-LM checkout.Test plan
import megatron.core.transformer.transformer_layersucceeds).radixark/miles:devimage:python -c "import sys; import miles_megatron_plugins.true_on_policy.contracts; print(miles_megatron_plugins.__file__)"resolves to a path under/root/miles/, not/root/Megatron-LM/.Merge ordering note
This PR should not merge into
miles-mainuntil the matching miles PR is ready. Once that PR's CI is green, this can merge. After that, the miles PR can flip its.gitmodulesbranch =back frommiles/move-plugins-to-milestomiles-main.