Repository navigation
Add megatron/core/ops with its contributor guide and shared helpers (1/4) - #7380
Merged
Merged
Conversation
guihong-nv
force-pushed
the
pr1/move-into-ops
branch
from
September 16, 2026 20:48
1b6bee6 to
6a4ec5f
Compare
Contributor
Author
|
/claude fix |
Contributor
|
❌ Claude fix stopped because a workflow step failed. Inspect the run. |
Contributor
Author
|
/ok to test 6a4ec5f |
guihong-nv
force-pushed
the
pr1/move-into-ops
branch
from
September 17, 2026 22:46
f54476d to
075683e
Compare
4 of 7 tasks
…helpers megatron/core/ops is the implementation home for SSM, sparse-attention and future fused operations. This adds the package README (layout and file roles, how to add a new operation, how to add a new backend kernel to an existing operation, dependency checks, selection, deprecated import paths), pointers from megatron/core/README.md and the contribution guide, the two shared helpers every move uses -- _compat.deprecated_module (PEP 562 forwarders for moved paths) and _backends.require (construction-time optional dependency checks) -- and the regression suite for deprecated paths, whose table is filled in by each move. No existing code changes. Signed-off-by: Guihong Li <guihongl@nvidia.com>
guihong-nv
force-pushed
the
pr1/move-into-ops
branch
from
September 17, 2026 23:33
075683e to
af68f07
Compare
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Phlip79
reviewed
Sep 18, 2026
…warn when a version cannot be determined, document require()'s variadic symbols - README: drop the 'Status (PR 1 of 4)' callout and the other PR-numbered asides; the guide now describes the package conventions without referring to the PR sequence. - _backends.installed_version: every None is logged with its reason (import failure, no __version__ and no distribution metadata, non-PEP-440 string). - _backends.require: explain why symbols is variadic and the remaining options are keyword-only. Signed-off-by: Guihong Li <guihongl@nvidia.com>
Only reject paths present in the forwarding table so the foundation PR permits modules that have not moved yet. Resolve relative imports and cover partial migrations with regression cases. Apply the pinned formatting to the test suite. Signed-off-by: Guihong Li <guihongl@nvidia.com>
guihong-nv
force-pushed
the
pr1/move-into-ops
branch
from
September 18, 2026 17:25
baeda31 to
ca1fffe
Compare
Document construction using current selectors and ModuleSpec APIs, and distinguish intended family layouts from registered migrations. Exercise deprecated_module with synthetic importable modules independently of the migration table. Schedule the ops bucket for both dev and LTS on the latest checkout. Signed-off-by: Guihong Li <guihongl@nvidia.com>
Contributor
Author
|
/ok to test 7661b40 |
balasaajay
approved these changes
Sep 20, 2026
Phlip79
approved these changes
Sep 21, 2026
Cover availability probes, package and distribution versions, required exports, and chained import and lazy-load errors without external kernel dependencies. Signed-off-by: Guihong Li <guihongl@nvidia.com>
Contributor
Author
|
/ok to test ed6a75e |
jaredcasper
approved these changes
Oct 9, 2026
guihong-nv
enabled auto-merge
October 12, 2026 16:36
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/38279933104 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/38283616283 |
This branch was previously deployed
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.
What does this PR do?
Adds
megatron/core/ops, the implementation home for SSM, sparse-attention and future fused operations, together with its contributor guide and the two shared helpers every later move uses. No existing code changes.megatron/core/ops/README.md: layout and file roles; how to add a new operation; how to add a new backend kernel to an existing operation; dependency checks; kernel selection; deprecated import paths. Pointers added tomegatron/core/README.mdanddocs/developer/contribute.md.ops/_compat.deprecated_module: PEP 562 forwarders for moved import paths (oneDeprecationWarning, lazy attribute resolution,from old import *and legacy pickles keep working).ops/_backends.require: construction-time optional-dependency checks with one exception type and the cause chained.tests/unit_tests/ops/test_deprecated_imports.pyand a CI bucket: the regression suite for deprecated paths. Its table (deprecated_paths.py) is empty here and filled by each move PR, so family-specific tests skip until their move lands.This is PR 1 of 4 re-slicing #7239 (which the stack supersedes), per the "Unified Kernel Backend Management" design doc. The moves themselves follow, each a pure move leaving deprecated aliases at the old paths:
2.
ops-move/2-ssm— SSM helpers, Mamba2, GDN/GDN2, GDP, chunkwise CP →megatron/core/ops/ssm(149 files, 39 renames)3.
ops-move/3-attention— DSA, CSA, absorbed MLA, DeepSeek-v4 →megatron/core/ops/attention(78 files, 24 renames)4.
ops-move/4-layers-configs—MambaLayer,MLPLayerand the per-layer configs →megatron/core/transformer(63 files)The previous single-PR head is kept at
guihong-nv:pr1/move-into-ops-fullfor reference; the stack's end state is identical to it apart from dropping an unused test helper.Issue tracking
For PRs from open-source community contributors:
Linked issue:
Contribution process
Pre-checks
jit_fuser/torch.compile, CUDA extension, TE or external-library dispatch, or a scatter/index accumulation), I have added or updated its bit-exact determinism test and registered it intests/unit_tests/determinism/kernels/manifest.py(guide)Code review
Feel free to message or comment @NVIDIA/mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.
Step 1: Mark PR as "Ready for Review"
.github/CODEOWNERS.Final Review might get declined if these requirements are not fulfilled.
Step 2: Final Review
For PRs that change
megatron/core, once all expert reviewers have approved, theFinal Reviewlabel is applied automatically and final reviewers are assigned.For PRs outside
megatron/core, this step is skipped.Step 3: Approved
Once all required reviewers have approved, the
Approvedlabel is applied automatically.Merge
Any member of mcore-engineers will be able to merge your PR.