fix(packaging): AUT-1323 include megatron.post_training in package disco - #6290
Closed
svcnemo-autobot wants to merge 2 commits into
Closed
fix(packaging): AUT-1323 include megatron.post_training in package disco#6290svcnemo-autobot wants to merge 2 commits into
svcnemo-autobot wants to merge 2 commits into
Conversation
Contributor
|
This PR has been automatically converted to draft because all PRs must start as drafts. When you are ready for review, click Ready for Review to begin the review process. This will:
See the contribution guide for more details. |
svcnvidia-nemo-ci
marked this pull request as draft
August 5, 2026 19:35
Contributor
|
/ok to test 16c8a9f |
Commit bf71c14 added megatron/post_training/ but did not add it to pyproject.toml's [tool.setuptools.packages.find] include list. This causes ModuleNotFoundError when megatron.training imports from megatron.post_training (e.g. checkpointing.py imports print_distributed_quant_summary and maybe_enable_modelopt). Add megatron.post_training and megatron.post_training.* to the include list so the module is packaged in the wheel. Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>
Commit bf71c14 added megatron/post_training/ but did not add it to pyproject.toml's [tool.setuptools.packages.find] include list. This causes ModuleNotFoundError when megatron.training imports from megatron.post_training. Additionally, megatron/post_training/utils.py eagerly imported modelopt at module level, breaking imports without ModelOpt installed. Add megatron.post_training and megatron.post_training.* to the include list. Move modelopt imports into the functions that use them. Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>
nemo-autobot-origin
Bot
force-pushed
the
fix/post-training-package
branch
from
August 5, 2026 20:43
f43c850 to
f998a88
Compare
Contributor
|
/ok to test f998a88 |
nemo-autobot-origin
Bot
force-pushed
the
fix/post-training-package
branch
from
August 5, 2026 22:49
a9b45a6 to
f998a88
Compare
ko3n1g
marked this pull request as ready for review
August 5, 2026 23:12
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.
Background
Commit bf71c14 added
megatron/post_training/but did not add it topyproject.toml's[tool.setuptools.packages.find]include list. This causesModuleNotFoundError: No module named 'megatron.post_training'whenmegatron.trainingimports from it. Additionally,megatron/post_training/utils.pyeagerly importedmodeloptat module level, breaking imports without ModelOpt installed.What changed
megatron.post_trainingandmegatron.post_training.*to the[tool.setuptools.packages.find]include list.modelopt,modelopt.torch.quantization, andis_quantizedimports into the functions that use them so the module is importable without modelopt.Details
flowchart LR A[bf71c14 adds post_training/] --> B[pyproject.toml missing entry] B --> C[ModuleNotFoundError on import] C --> D[Add to packages.find + guard modelopt] D --> E[Module packaged and importable without modelopt]Tested
python3 -m buildproduces wheel with 19post_trainingentriespip install --no-deps+import megatron.post_trainingsucceedsimport megatron.post_training.utilsandmegatron.post_training.checkpointingsucceed without modelopt installed