Skip to content

Thread socket argument through MInf API - #6513

Merged
tdene merged 1 commit into
NVIDIA:mainfrom
tdene:tde/serve_sock
Aug 14, 2026
Merged

tdene merged 1 commit into
NVIDIA:mainfrom
tdene:tde/serve_sock

Conversation

@tdene

@tdene tdene commented Aug 13, 2026

Copy link
Copy Markdown
Contributor
  • I, the PR author, have personally reviewed every line of this PR.

What does this PR do?

⚠️ For major changes (either in lines of code or in its impact), please make sure to first share a design doc with the team. If you're unsure what's the best way to do so, contact @NVIDIA/mcore-oncall.

Issue tracking

For PRs from open-source community contributors:

  • New features: a linked issue is required. Please open a feature request and reference it here before submitting the PR.
  • Small updates (bug fixes, minor improvements): a linked issue is recommended and will accelerate the PR review process.

Linked issue:

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code Typing guidelines
  • I have added relevant documentation
  • I have run the autoformatter.sh on my PR

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"

  1. When your PR is ready, click Ready for Review.
  2. An oncall reviewer is auto-assigned and expert reviewers are notified based on your changes.
    • Some PRs may jump straight to step 2. This is determined by .github/CODEOWNERS.

⚠️ Only mark as ready once merge-conflicts are resolved and the CI is passing.
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, the Final Review label 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 Approved label is applied automatically.

Merge

Any member of mcore-engineers will be able to merge your PR.

Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

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.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the Final Review PR is in the "final review" stage label Aug 13, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added Approved All necessary approvals have been made and removed Final Review PR is in the "final review" stage labels Aug 13, 2026
@tdene
tdene enabled auto-merge August 13, 2026 21:28
@tdene
tdene added this pull request to the merge queue Aug 13, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31751169913

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31752551299

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31752940303

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31755641698

Merged via the queue into NVIDIA:main with commit f9cc544 Aug 14, 2026
97 of 99 checks passed
@tdene
tdene deleted the tde/serve_sock branch August 14, 2026 02:29
ksivaman pushed a commit to ksivaman/Megatron-LM that referenced this pull request Sep 1, 2026
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
nemo-autobot-origin Bot pushed a commit to svcnemo-autobot/Megatron-LM that referenced this pull request Oct 15, 2026
Repair commit for the 2026-10-13 main-to-dev sync merge 4ade8e7.

- inference: restore main NVIDIA#5301 pre-bound socket support (the sock
  parameter) in start_text_gen_server. The slice's NVIDIA#6513 makes
  MegatronLLM.serve() and MegatronAsyncLLM.serve() pass sock=, but dev's
  server lacked NVIDIA#5301, so serve() raised TypeError on the primary rank.
  Add tests that bind both serve() calls to the real signature and cover
  the pre-bound socket path.
- inference: restore main NVIDIA#5348/NVIDIA#6584 mamba-cache scratch reservation and
  budget-too-small / PP-limiting-stage errors in DynamicInferenceContext
  (the dev warn-and-disable path was an artifact of revert NVIDIA#7283), and
  restore test_mamba_cache_budget_too_small_raises.
- megatron_fsdp experimental: keep the symmetric-memory all-gather buffer
  rendezvous working on the dev torch build, which lacks
  symm_mem.is_symm_mem_tensor.
- functional moe_perf: restore the per-iteration CUDA RNG tracker state
  reset from NVIDIA#7094.
- unit test doubles: align with merged APIs (RecordingCheckpoint
  retain_input_tensors, paged-stash config cuda_graph fields, profile_ranks
  in test_training, contextmanager import and the dev pipeline_p2p_fixed_shape
  config field in test_schedules).
- unit test isolation: reset the global CUDA graph record after the dev
  TestMHCWithCudaGraph local-impl tests and before main NVIDIA#6432's
  TestTransformerLayerCudaGraphManagers, so its create_cudagraphs() does not
  capture stale mHC layers recorded under the cudagraphable RNG tracker.
- unit test teardown: Utils.destroy_model_parallel resets the TE FP8 global
  state and the HybridEP buffer that cache process groups, and retires the
  groups parallel_state created; a new autouse conftest fixture destroys them
  once the test finishes. They are not destroyed inside destroy_model_parallel
  because a test may re-initialize and keep using a group it captured earlier
  (test_upcycling_TE reuses its ProcessGroupCollection). Before this, each test
  leaked its NCCL communicators. The tests/unit_tests/transformer bucket then
  crossed vm.max_map_count (65530) at test_vision_cuda_graphs, on both this
  branch and dev c75a269. Before destroying the retired groups, the fixture
  clears DTensor's per-thread sharding-propagation caches (Python and native).
  They key on value-equal DeviceMeshes, so a later test that builds a mesh with
  the same layout would otherwise get placements on the earlier mesh, whose
  group is destroyed (test_gpt_hybrid_interop fsdp4-dense).
- rl unit tests: a bucket-scoped autouse conftest fixture runs gc.collect()
  before the retired groups are destroyed. test_get_logprobs_cuda_graphs leaves
  CUDA graphs that captured those communicators reachable only through
  reference cycles, and ncclCommDestroy waits for them to be freed, so the
  teardown hung. Collecting suite-wide instead changed object lifetimes in other
  buckets, so the collection stays in tests/unit_tests/rl.

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 16, 2026
Repair commit for the 2026-10-13 main-to-dev sync merge 1eaec47.

- inference: restore main NVIDIA#5301 pre-bound socket support (the sock
  parameter) in start_text_gen_server. The slice's NVIDIA#6513 makes
  MegatronLLM.serve() and MegatronAsyncLLM.serve() pass sock=, but dev's
  server lacked NVIDIA#5301, so serve() raised TypeError on the primary rank.
  Add tests that bind both serve() calls to the real signature and cover
  the pre-bound socket path.
- inference: restore main NVIDIA#5348/NVIDIA#6584 mamba-cache scratch reservation and
  budget-too-small / PP-limiting-stage errors in DynamicInferenceContext
  (the dev warn-and-disable path was an artifact of revert NVIDIA#7283), and
  restore test_mamba_cache_budget_too_small_raises.
- megatron_fsdp experimental: keep the symmetric-memory all-gather buffer
  rendezvous working on the dev torch build, which lacks
  symm_mem.is_symm_mem_tensor.
- functional moe_perf: restore the per-iteration CUDA RNG tracker state
  reset from NVIDIA#7094.
- unit test doubles: align with merged APIs (RecordingCheckpoint
  retain_input_tensors, paged-stash config cuda_graph fields, profile_ranks
  in test_training, contextmanager import and the dev pipeline_p2p_fixed_shape
  config field in test_schedules).
- unit test isolation: reset the global CUDA graph record after the dev
  TestMHCWithCudaGraph local-impl tests and before main NVIDIA#6432's
  TestTransformerLayerCudaGraphManagers, so its create_cudagraphs() does not
  capture stale mHC layers recorded under the cudagraphable RNG tracker.
- unit test teardown: Utils.destroy_model_parallel resets the TE FP8 global
  state and the HybridEP buffer that cache process groups, and retires the
  groups parallel_state created; a new autouse conftest fixture destroys them
  once the test finishes. They are not destroyed inside destroy_model_parallel
  because a test may re-initialize and keep using a group it captured earlier
  (test_upcycling_TE reuses its ProcessGroupCollection). Before this, each test
  leaked its NCCL communicators. The tests/unit_tests/transformer bucket then
  crossed vm.max_map_count (65530) at test_vision_cuda_graphs, on both this
  branch and dev c75a269. Before destroying the retired groups, the fixture
  clears DTensor's per-thread sharding-propagation caches (Python and native).
  They key on value-equal DeviceMeshes, so a later test that builds a mesh with
  the same layout would otherwise get placements on the earlier mesh, whose
  group is destroyed (test_gpt_hybrid_interop fsdp4-dense).
- rl unit tests: a bucket-scoped autouse conftest fixture runs gc.collect()
  before the retired groups are destroyed. test_get_logprobs_cuda_graphs leaves
  CUDA graphs that captured those communicators reachable only through
  reference cycles, and ncclCommDestroy waits for them to be freed, so the
  teardown hung. Collecting suite-wide instead changed object lifetimes in other
  buckets, so the collection stays in tests/unit_tests/rl.

Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>

This branch was previously deployed

2 inactive deployments
public — 606438c2 Deployed Aug 13, 2026 by copy-pr-bot[bot] via finalize / publish-docs #5997
test — 606438c2 Deployed Aug 13, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #18905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved All necessary approvals have been made complexity: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants