[Feat] Integrate Megatron-LM core_v0.17.1 - #116
Conversation
|
Updated this PR with the Megatron-LM installation and usage documentation:
This follow-up changes documentation and the integration submodule revision only; it does not change runtime code. |
There was a problem hiding this comment.
Pull request overview
This PR integrates Megatron-LM support into DMI by introducing a pinned Megatron integration submodule and aligning DMI’s record “device gate” behavior with the restored selective-recomputation contract (rejected occurrences publish nothing; accepted zero-row occurrences still publish a descriptor-backed zero-byte task).
Changes:
- Add the
third_party/DMI-Megatron-IntegrationGit submodule and document Megatron-LM usage/installation. - Update record producer kernels so a false device gate returns without publishing any task (no ring counter advancement).
- Update native tests and the integration API documentation to reflect the revised gating contract.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
native/csrc/ring/producer.cu |
Changes record producer kernels to skip publication entirely when the device gate rejects. |
tests/native/ring/test_producer.cu |
Updates gating test to assert “no publication / no ring state change” on gate rejection. |
tests/native/ring/test_ring_engine.cu |
Removes a record reservation reclaim test that depended on the prior “publish empty task when gated off” behavior. |
docs/integration-api-v1.md |
Documents the restored contract: gated-off occurrences must be pre-selected on host and be absent from the record stream. |
docs/megatron.md |
Adds Megatron-LM backend usage guide (installation + activation). |
docs/install.md |
Updates core installation guide to include the new Megatron integration submodule and checkout/environment guidance. |
README.md |
Updates project positioning and quick links to include Megatron-LM training support. |
.gitmodules |
Adds the pinned Megatron integration submodule entry. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Samfisheryu
left a comment
There was a problem hiding this comment.
Re-tested the reported router-topk capacity-dropping case on one GPU. Training now passes, dropped-route sentinel IDs are preserved, and all dropped-slot weights are zero. No remaining blockers.
Summary
Add Megatron-LM support to DMI through the standalone
DMI-Megatron-Integrationrepository. DMI pins the integration repository as a submodule at commit7838d16, and that repository pins the matchingMegatron-LM-DMIfork at commit93f45d9, based on Megatron-LMcore_v0.17.1.The integration repository owns the Megatron adapter, hook definitions, metadata propagation, runtime activation, record schemas, ClickHouse materialization and reconstruction, and Megatron-specific validation. DMI core remains framework-neutral.
What changed
third_party/DMI-Megatron-Integrationas a reproducibly pinned Git submodule.Compatibility
The gate change affects only rejected generic record-producer occurrences. Existing accepted records, zero-row records, dynamic-size reservation reclamation, legacy inference producers, record schemas, and storage formats remain unchanged.
Existing Hugging Face and vLLM integrations continue to use their established paths. Megatron-specific behavior remains in
DMI-Megatron-IntegrationandMegatron-LM-DMI.Validation
Scope
This PR adds the Megatron integration entry point to DMI and includes the core gate correction required by that integration.