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] Cache runtime env core worker #48928

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

dentiny
Copy link
Contributor

@dentiny dentiny commented Nov 26, 2024

Followup PR for #48749
This PR caches json and protobuf deserialization for serialized runtime env.
Checked with benchmark (https://github.com/ray-project/ray/blob/master/release/benchmarks/distributed/test_many_tasks.py), verified throughput improves from ~11550 to ~ 13565, which is ~17%.

@dentiny dentiny force-pushed the hjiang/cache-runtime-env-core-worker branch 2 times, most recently from ef4760a to ae5543b Compare November 26, 2024 00:49
Signed-off-by: hjiang <[email protected]>
Signed-off-by: hjiang <[email protected]>
@dentiny dentiny force-pushed the hjiang/cache-runtime-env-core-worker branch from ae5543b to 321dc87 Compare November 26, 2024 00:51
@dentiny dentiny added the go add ONLY when ready to merge, run all tests label Nov 26, 2024
Copy link
Collaborator

@jjyao jjyao left a comment

Choose a reason for hiding this comment

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

Is the 17% improvement observed on the CI release test or local laptop?

src/ray/core_worker/core_worker.h Outdated Show resolved Hide resolved
@dentiny
Copy link
Contributor Author

dentiny commented Nov 26, 2024

Is the 17% improvement observed on the CI release test or local laptop?

From local

Signed-off-by: hjiang <[email protected]>
@dentiny dentiny requested a review from jjyao November 26, 2024 06:02
@jjyao
Copy link
Collaborator

jjyao commented Nov 26, 2024

Is the 17% improvement observed on the CI release test or local laptop?

From local

Can you test the real release test and see the performance impact?

/// Serialized runtime info env are cached.
mutable std::mutex runtime_env_serialization_mutex_;
/// Maps serialized runtime env to **immutable** deserialized protobuf.
mutable boost::compute::detail::lru_cache<std::string,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we temporarily change this back to std::unordered_map so that this PR compiles and we can see the real perf impact on the release test. I'm curious whether the release test will see the same perf improvement as what you observed locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this with the modification of release test to add env var runtime env?

rynewang pushed a commit that referenced this pull request Nov 28, 2024
A shared lru cache is needed for my PR:
#48928

Signed-off-by: hjiang <[email protected]>
@dentiny dentiny force-pushed the hjiang/cache-runtime-env-core-worker branch from fd5b0bd to b52df48 Compare December 3, 2024 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants