Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Release PG CPU resources for blocked worker #43270

Merged
merged 4 commits into from Feb 26, 2024

Conversation

jjyao
Copy link
Contributor

@jjyao jjyao commented Feb 20, 2024

Why are these changes needed?

Currently we release CPU resource when a worker process is blocked on ray.get(), however this doesn't work if the CPU resource is inside a PG and this PR fixes it.

Related issue number

Closes #40925

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
@jjyao jjyao marked this pull request as ready for review February 21, 2024 18:15
python/ray/tests/test_basic.py Show resolved Hide resolved
src/ray/raylet/local_task_manager.cc Outdated Show resolved Hide resolved

cluster_resource_scheduler_->GetLocalResourceManager().ReleaseWorkerResources(
allocated_instances);
worker->ClearAllocatedInstances();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is theoretically different from previous logics (we called only one of these 2 APIs). Is it guaranteed if allocated_instances is not null lifetime_allocated_instances is null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup

Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
@jjyao jjyao merged commit 8828d4d into ray-project:master Feb 26, 2024
9 checks passed
@jjyao jjyao deleted the jjyao/pg branch February 26, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core] ReleaseCpuResourcesFromUnblockedWorker doesn't work for PG CPU resource
2 participants