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] Small optimizations from accelerated DAG experiment #41418

Merged
merged 12 commits into from
Nov 30, 2023

Conversation

ericl
Copy link
Contributor

@ericl ericl commented Nov 27, 2023

Why are these changes needed?

This ports a few micro-optimizations from the accelerated DAG experiment branch (https://github.com/ray-project/ray/pull/40991/files). The optimizations here help the most for accelerated DAG programs, but also help a bit to reduce get()/put() call overheads for normal Ray programs:

Before:

  • 55% of get() time in plasma:: code
  • 54% of put() time in plasma:: code

After:

  • 62% of get() time in plasma:: code
  • 76% of put() time in plasma:: code

Signed-off-by: Eric Liang <ekhliang@gmail.com>
Signed-off-by: Eric Liang <ekhliang@gmail.com>
Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

it's cool this is all we need for the optimization! Some nit comments, but generally lgtm

@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Nov 28, 2023
@ericl
Copy link
Contributor Author

ericl commented Nov 28, 2023

Addressed. Good idea on the static assert, I was trying to get constexpr to work but this is much more straightforward.

@ericl ericl removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Nov 28, 2023
Signed-off-by: Eric Liang <ekhliang@gmail.com>
Signed-off-by: Eric Liang <ekhliang@gmail.com>
@@ -393,12 +393,12 @@ void ReferenceCounter::RemoveLocalReferenceInternal(const ObjectID &object_id,
RAY_CHECK(!object_id.IsNil());
auto it = object_id_refs_.find(object_id);
if (it == object_id_refs_.end()) {
RAY_LOG(WARNING) << "Tried to decrease ref count for nonexistent object ID: "
<< object_id;
RAY_LOG_EVERY_MS(WARNING, 5000)
Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, I assume these warning logs are impacting the performance, but does that mean it is more frequently printed when an accelerated DAG is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's definitely an issue we need to look into in the future, once we fix the ref counting.

Signed-off-by: Eric Liang <ekhliang@gmail.com>
Signed-off-by: Eric Liang <ekhliang@gmail.com>
Signed-off-by: Eric Liang <ekhliang@gmail.com>
Signed-off-by: Eric Liang <ekhliang@gmail.com>
@ericl ericl added the tests-ok The tagger certifies test failures are unrelated and assumes personal liability. label Nov 30, 2023
@ericl ericl merged commit 2287bea into ray-project:master Nov 30, 2023
os.environ.get("RAY_ENABLE_AUTO_CONNECT", "") != "0"
and not ray.is_initialized()
):
if enable_auto_connect and not ray.is_initialized():
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Beat me to fixing this. It's a small thing but notoriously showing up in every profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants