Skip to content

[Data] Actor Pool get correct logical resource usage#61528

Open
machichima wants to merge 3 commits intoray-project:masterfrom
machichima:61395-actor-pool-correct-logical-resources
Open

[Data] Actor Pool get correct logical resource usage#61528
machichima wants to merge 3 commits intoray-project:masterfrom
machichima:61395-actor-pool-correct-logical-resources

Conversation

@machichima
Copy link
Contributor

Description

ActorPoolMapOperator report logical resource usage based on statically-defined ray_remote_args. If ray_remote_args_fn is defined, then the operator can launch tasks with more logical resources than the statically defined ray_remote_args. This leads to resource manager undercounting logical resource usage. We should record the actual resources we used.

In this PR, we did the following changes:

actor_pool_map_operator.py:

  • Get the resources after considering _ray_remote_args_fn
  • Add _ActorResourceUsageTracker to keep track of resource usage for total and pending to provide O(1) resource usage lookup

test_executor_resource_management.py:

  • Add test to ensure current_logical_usage reflects dynamic resources from ray_remote_args_fn for ActorPoolMapOperator

test_actor_pool_map_operator.py:

  • Ensure getting correct pending/current resource usage when actor phase transit

Related issues

Closes #61395

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
@machichima machichima requested a review from a team as a code owner March 5, 2026 13:56
@ray-gardener ray-gardener bot added data Ray Data-related issues community-contribution Contributed by the community labels Mar 5, 2026
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 data Ray Data-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Data] Get correct logical resource usage

1 participant