Skip to content

[core] Rename label_domain to topology strategy in scheduling policy#64384

Open
tanmayrauth wants to merge 3 commits into
ray-project:masterfrom
tanmayrauth:rename-label-domain-to-topology-strategy
Open

[core] Rename label_domain to topology strategy in scheduling policy#64384
tanmayrauth wants to merge 3 commits into
ray-project:masterfrom
tanmayrauth:rename-label-domain-to-topology-strategy

Conversation

@tanmayrauth

@tanmayrauth tanmayrauth commented Jun 26, 2026

Copy link
Copy Markdown

The placement-group topology API was migrated to the topology_strategy naming convention everywhere except the raylet scheduling-policy layer, which still used the old label_domain naming.

Rename the remaining label_domain/LabelDomain identifiers to match the topology convention already used in the proto, GCS, and Python layers:

  • LabelDomainSchedulingStrategy -> TopologySchedulingStrategy
  • LabelDomain{,StrictPack}SchedulingPolicy{Interface} -> Topology...
  • target_label_domain_ -> target_topology_assignment_
  • selected_label_domain -> selected_topology_assignment
  • label_domain_scheduling_strategy_ -> topology_scheduling_strategy_
  • label_domain_bundle_scheduling_policy.{cc,h} -> topology_bundle_...

Pure rename; no behavior change.
Closes #64370

@tanmayrauth tanmayrauth requested a review from a team as a code owner June 26, 2026 21:25

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request renames "label domain" scheduling concepts to "topology" or "topology-aware" scheduling across the Ray scheduler codebase, including policy classes, strategy enums, scheduling options, build targets, and associated tests. The feedback points out an ineffective std::move on a const structured binding key in topology_bundle_scheduling_policy.cc that should be simplified to a direct copy.

Comment on lines +119 to +120
result.selected_topology_assignment =
std::make_pair(label_key, std::move(topology_value));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In C++17, structured bindings for map keys (such as topology_value from topology_groups) are deduced as const std::string. Applying std::move to a const object has no effect and silently falls back to a copy, which can be misleading. Removing std::move makes it clear that a copy is occurring.

Suggested change
result.selected_topology_assignment =
std::make_pair(label_key, std::move(topology_value));
result.selected_topology_assignment =
std::make_pair(label_key, topology_value);

The placement-group topology API was migrated to the topology_strategy
naming convention everywhere except the raylet scheduling-policy layer,
which still used the old label_domain naming.

Rename the remaining label_domain/LabelDomain identifiers to match the
topology convention already used in the proto, GCS, and Python layers:

- LabelDomainSchedulingStrategy -> TopologySchedulingStrategy
- LabelDomain{,StrictPack}SchedulingPolicy{Interface} -> Topology...
- target_label_domain_ -> target_topology_assignment_
- selected_label_domain -> selected_topology_assignment
- label_domain_scheduling_strategy_ -> topology_scheduling_strategy_
- label_domain_bundle_scheduling_policy.{cc,h} -> topology_bundle_...

Pure rename; no behavior change. Resolves the leftover TODO(ray-project#64370).

Closes ray-project#64370

Signed-off-by: Tanmay Rauth <t_rauth@apple.com>
@tanmayrauth tanmayrauth force-pushed the rename-label-domain-to-topology-strategy branch from d354b8b to 4ae4c06 Compare June 26, 2026 21:29
@tanmayrauth

Copy link
Copy Markdown
Author

@abrarsheikh can you please review it?

@Sparks0219

Copy link
Copy Markdown
Contributor

This is still a bit confusing, we're using "topology" or "topology assignment" or "topology-aware". Let's just standardize to "topology-strategy".

@ray-gardener ray-gardener Bot added core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Jun 27, 2026
Address review feedback on the label_domain -> topology rename:

- Standardize the inconsistent "topology-aware" wording onto the
  "topology strategy" vocabulary used by the topology_strategy proto
  field and Python API, including pre-existing mentions so nothing
  desyncs. Keep "topology assignment" distinct, as it mirrors the
  merged Get/Set/ClearTopologyAssignment GCS API and proto field.
- Drop the no-op std::move on the const structured-binding key in
  TopologyStrictPackSchedulingPolicy::Schedule (copy is what happens
  anyway).

No behavior change.

Signed-off-by: Tanmay Rauth <t_rauth@apple.com>

@abrarsheikh abrarsheikh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please fix the linter issue. I recommend setting up https://docs.ray.io/en/latest/ray-contribute/development.html#pre-commit-hooks

Signed-off-by: Tanmay Rauth <t_rauth@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename label domain to topology strategy

3 participants