Repository navigation
Fix concurrent VMM allocator extension builds - #7494
Merged
yashaswikarnati merged 1 commit intoOct 20, 2026
Merged
Conversation
Signed-off-by: ykarnati <ykarnati@nvidia.com>
|
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. |
ko3n1g
approved these changes
Sep 18, 2026
Member
|
Curious why this MR is closed but not merged? It's also required for the MLM/main branch. I ran into this bug for the MLM/main branch today. |
Contributor
Author
|
/ok to test c217021 |
fanshiqing
approved these changes
Oct 19, 2026
deepakn94
approved these changes
Oct 19, 2026
cspades
approved these changes
Oct 19, 2026
yashaswikarnati
enabled auto-merge
October 19, 2026 16:01
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/39333130866 |
nemo-autobot-origin Bot
pushed a commit
to svcnemo-autobot/Megatron-LM
that referenced
this pull request
Oct 22, 2026
Repair main-to-dev sync compatibility for the 2026-10-20 slice (main 13a9d46 merged into dev ff4fbc9): - moe/router: InferenceTopKRouter._compiled_topk_routing accepts and forwards precomputed_indices, matching the base router call site. - tensor_parallel/random: MHCCheckpointManager subclasses CheckpointWithoutOutputManager so main's checkpoint consumers accept it. - moe/token_dispatcher: _HybridEPManager.setup_metadata clears the stale num_permuted_tokens budget when no capacity factor is configured. - tests: align dev-only tests with main API changes (test_training TrainingConfig and TrainState, test_mhc_schedule _model_chunk_state, test_hybrid_hash_routing tensor_parallel import, test_route_metadata_cpu token_dispatcher fake, MTP argmax acceptance-count test). - tests: test_train_step_schedule_plumbing provides the cfg.train, cfg.validation, cfg.ddp and TrainState inputs main's train_step and setup_model_and_optimizer now read. - tests: test_virtual_experts quantile cases select the micro_batch estimation scope that main's quantile estimator implements; the merged default keeps dev's global_batch scope. - tests/test_utils/recipes/gb200/unit-tests.yaml: drop the duplicated tests/unit_tests/ssm/test_gated_delta_net.py bucket produced by the merge, restoring the one-bucket-per-file unit-test scope contract. - tests: test_hybrid_distillation_entry expects the multimodal_dev entry point to leave runtime services and tokenizer vocabulary resolution to initialize_megatron, which main NVIDIA#8272 made their owner. - examples/mimo_bagel/train.py: read the training iteration from get_train_state() for the PP>1 data seed and the loss-alignment audit log, because main NVIDIA#7932 no longer sets args.curr_iteration or args.iteration (review 5609274485). - pyproject.toml: carry main NVIDIA#7494's [tool.setuptools.package-data] entry so wheel and sdist installs ship megatron/core/allocator/csrc/vmm_symm_allocator.cpp (review 5609274485). Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>
nemo-autobot-origin Bot
pushed a commit
to svcnemo-autobot/Megatron-LM
that referenced
this pull request
Oct 22, 2026
Repair main-to-dev sync compatibility for the 2026-10-20 slice (main 0156c21 merged into dev ae76c60): - moe/router: InferenceTopKRouter._compiled_topk_routing accepts and forwards precomputed_indices, matching the base router call site. - tensor_parallel/random: MHCCheckpointManager subclasses CheckpointWithoutOutputManager so main's checkpoint consumers accept it. - moe/token_dispatcher: _HybridEPManager.setup_metadata clears the stale num_permuted_tokens budget when no capacity factor is configured. - tests: align dev-only tests with main API changes (test_training TrainingConfig and TrainState, test_mhc_schedule _model_chunk_state, test_hybrid_hash_routing tensor_parallel import, test_route_metadata_cpu token_dispatcher fake, MTP argmax acceptance-count test). - tests: test_train_step_schedule_plumbing provides the cfg.train, cfg.validation, cfg.ddp and TrainState inputs main's train_step and setup_model_and_optimizer now read. - tests: test_virtual_experts quantile cases select the micro_batch estimation scope that main's quantile estimator implements; the merged default keeps dev's global_batch scope. - tests/test_utils/recipes/gb200/unit-tests.yaml: drop the duplicated tests/unit_tests/ssm/test_gated_delta_net.py bucket produced by the merge, restoring the one-bucket-per-file unit-test scope contract. - tests: test_hybrid_distillation_entry expects the multimodal_dev entry point to leave runtime services and tokenizer vocabulary resolution to initialize_megatron, which main NVIDIA#8272 made their owner. - examples/mimo_bagel/train.py: read the training iteration from get_train_state() for the PP>1 data seed and the loss-alignment audit log, because main NVIDIA#7932 no longer sets args.curr_iteration or args.iteration (review 5609274485). - pyproject.toml: carry main NVIDIA#7494's [tool.setuptools.package-data] entry so wheel and sdist installs ship megatron/core/allocator/csrc/vmm_symm_allocator.cpp (review 5609274485). Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>
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?
Prevent ranks from rewriting the VMM allocator's C++ source while another rank compiles it. PyTorch's
load_inline()publishesmain.cppbefore taking its build lock; on a cold cache, competing writers can truncate the source while the compiler is reading it, potentially producing a shared library without the expected Python module initializer.Move the existing C++ into
megatron/core/allocator/csrc/vmm_symm_allocator.cppand build it withcpp_extension.load(). Include the source in wheels and source distributions. Preserve the allocator's behavior, extension name, build directory, and success/failure caches. Add regression coverage for packaged-source loading and failure caching, and include the C++ path in the allocator's existing determinism exemption.Validation
torch.distributed.runwith the normal repository conftest.<cstdlib>include.git diff --checkpassed.Local validation used the existing
megatron-lm:localdevelopment image (PyTorch2.13.0a0+8145d630e8.nv26.06) and its bundled CUDA compatibility libraries. Current main's CI image pin is 26.08, so this is not exact CI-image parity. No GPU memory allocation or NCCL collective was exercised. The unit-test fixture attempted an unavailable dataset download; these two tests do not use that dataset.Issue tracking
Small build-race fix; no issue linked.
Contribution process
Pre-checks
tools/autoformat.shin check mode (Black, isort, Ruff, and Pylint passed; optional mypy was unavailable in the container)All PRs start as drafts.