Skip to content

fix(topology): exclude unknown-NVLink-domain nodes from segment selection - #2924

Merged
yuki-97 merged 1 commit into
mainfrom
youngeunk/fix-topology-unknown-domain
Jun 26, 2026
Merged

fix(topology): exclude unknown-NVLink-domain nodes from segment selection#2924
yuki-97 merged 1 commit into
mainfrom
youngeunk/fix-topology-unknown-domain

Conversation

@terrykong

@terrykong terrykong commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes a placement bug in select_segment_nodes (topology-aware NVLink-domain placement, from #2612). Nodes with no NVLink-domain info — e.g. a GPU-less or unprobed Ray head node — collapse into a single NVLINK_DOMAIN_UNKNOWN pseudo-domain with topo_rank = -1, so they sort first and get selected once there are >= segment_size of them. The resulting placement-group constraint {"unknown": 0.001} names a Ray resource that ray.sub never registers, so the bundle can never schedule (retry loop / hard failure on heterogeneous or partial-probe clusters).

The fix skips unknown-domain nodes when building the candidate set, so we only ever pin to real, registered NVLink domains; skipped nodes fall through to remaining_node_ids. No-op on a homogeneous all-GPU cluster.

Testing

Unit tests — added regression tests in tests/unit/distributed/test_topology_placement.py::TestSelectSegmentNodes:

  • test_unknown_domain_nodes_excluded_from_selection and test_unknown_domain_only_raises_instead_of_unschedulable_pg — both fail on the pre-fix code, pass after.
  • Full file: 32 passed on a GB200 node (HEAD e2b6b2a2).

Functional --segment run on GB200 — confirms the fix does not regress topology-aware placement on real hardware. grpo-llama3.2-1b-instruct-1n8g-megatron.yaml, 2 nodes × 4 GPU, cluster.segment_size=2, 5 steps:

  • Topology-aware placement engaged: ✓ Topology-aware allocation: 2 training nodes in 1 NVLink domains (segment_size=2)
  • Reached Step 5/5, exited cleanly (---EXIT:0---), with no unschedulable-PG / ResourceInsufficientError.

(The unknown-domain case itself cannot occur on a clean homogeneous GB200 rack — it is covered by the unit tests; this functional run verifies no regression to the normal placement path.)

Stack

Bottom of a stack — #2613 (feat: Numa aware binding) stacks on top of this.

Before your PR is "Ready for review"

  • Did you write any new necessary tests?
  • Did you run the unit tests locally?

@copy-pr-bot

copy-pr-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@terrykong terrykong changed the title youngeunk/fix topology unknown domain fix(topology): exclude unknown-NVLink-domain nodes from segment selection Jun 24, 2026
@terrykong terrykong added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Jun 24, 2026
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test e2b6b2a

@terrykong terrykong mentioned this pull request Jun 24, 2026
4 tasks
@terrykong
terrykong marked this pull request as ready for review June 24, 2026 23:51
@terrykong
terrykong requested review from a team as code owners June 24, 2026 23:51
…tion

select_segment_nodes ran over the full topology including nodes with no
NVLink-domain info (e.g. a GPU-less/unprobed head node). Those collapse into a
single NVLINK_DOMAIN_UNKNOWN pseudo-domain with topo_rank -1, so they sort
first and get selected once there are >= segment_size of them — but the
resulting placement-group constraint {"unknown": 0.001} names a Ray resource
ray.sub never registers, so the bundle can never schedule (retry loop / hang).

Skip unknown-domain nodes when building the candidate set so we only ever pin
to real, registered NVLink domains; the skipped nodes fall through to
remaining_node_ids. No-op on a homogeneous all-GPU cluster (no unknown nodes).

Adds regression tests (TestSelectSegmentNodes) covering exclusion of unknown
nodes and the unknown-only -> ResourceInsufficientError case; both fail on the
pre-fix code.

Signed-off-by: Terry Kong <terryk@nvidia.com>
@terrykong
terrykong force-pushed the youngeunk/fix-topology-unknown-domain branch from e2b6b2a to 92c4726 Compare June 25, 2026 04:05
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test 92c4726

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yfw to review

@yuki-97
yuki-97 merged commit 4185306 into main Jun 26, 2026
77 checks passed
@yuki-97
yuki-97 deleted the youngeunk/fix-topology-unknown-domain branch June 26, 2026 12:33
ashors1 pushed a commit that referenced this pull request Jun 27, 2026
…tion (#2924)

Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Anna Shors <ashors@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants