Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

[core] split scheduler into smaller targets to improve build performance#51641

Merged
aslonnie merged 3 commits intoray-project:masterfromZiy1-Tan:build_sche
Mar 28, 2025

Conversation

Ziy1-Tan
Copy link
Contributor

@Ziy1-TanZiy1-Tan commentedMar 24, 2025
edited
Loading

Why are these changes needed?

Related issue number

Closes#51634

Before:

INFO: Elapsed time: 600.027s, Critical Path: 94.84sINFO: 3687 processes: 460 disk cache hit, 1400 internal, 1827 linux-sandbox.INFO: Build completed successfully, 3687 total actions

After:

INFO: Elapsed time: 440.950s, Critical Path: 89.94sINFO: 3932 processes: 1647 internal, 2285 linux-sandbox.INFO: Build completed successfully, 3932 total actions

Reproduce steps:

bazel cleansudo sync; sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"bazel build //:scheduler

About26.5% compile time reduction.

Checks

  • I've signed off every commit(by using the -s flag, i.e.,git commit -s) in this PR.
  • I've runscripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed forhttps://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 indoc/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 athttps://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

dentiny reacted with thumbs up emojidentiny reacted with rocket emoji
@Ziy1-Tan
Copy link
ContributorAuthor

Hey,@dentiny! Would you mind to take a look?

@jcotant1jcotant1 added the coreIssues that should be addressed in Ray Core labelMar 24, 2025
@dentiny
Copy link
Contributor

About 21.8% compile time reduction.

Thanks for the benchmark! Curious what target are you building?

BUILD.bazel Outdated
ray_cc_library(
name = "scheduling_options",
hdrs = ["src/ray/raylet/scheduling/policy/scheduling_options.h"],
deps = [":ray_common"],
Copy link
Contributor

Choose a reason for hiding this comment

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

"ray_common" is a giant dependency, please use necessary sub-dependencies

Copy link
Contributor

Choose a reason for hiding this comment

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

If you think it too hard, I'm ok with leaving a TODO and make a new PR

BUILD.bazel Outdated
":local_resource_manager",
":ray_common",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_googletest//:gtest",
Copy link
Contributor

Choose a reason for hiding this comment

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

depending ongtest for production code is not correct, please use"@com_google_googletest//:gtest_prod" instead

":cluster_resource_scheduler",
":cluster_task_manager_interface",
":local_task_manager_interface",
":scheduler_resource_reporter",
Copy link
Contributor

Choose a reason for hiding this comment

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

Miss a few common libraries and abseil libraries


ray_cc_library(
name = "cluster_task_manager_interface",
hdrs = ["src/ray/raylet/scheduling/cluster_task_manager_interface.h"],
Copy link
Contributor

Choose a reason for hiding this comment

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

please add dependencies for all headers

#include"ray/rpc/server_call.h"
#include"src/ray/protobuf/node_manager.pb.h"

BUILD.bazel Outdated
"@com_google_absl//absl/memory",
"@com_google_absl//absl/random",
"@com_google_absl//absl/random:bit_gen_ref",
"@com_google_absl//absl/strings",
"@com_google_googletest//:gtest",
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, should usegtest_prod

BUILD.bazel Outdated
name = "affinity_with_bundle_scheduling_policy",
srcs = ["src/ray/raylet/scheduling/policy/affinity_with_bundle_scheduling_policy.cc"],
hdrs = ["src/ray/raylet/scheduling/policy/affinity_with_bundle_scheduling_policy.h"],
deps = [":scheduling_policy"],
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please also add

#include"ray/common/bundle_location_index.h"

Copy link
Contributor

@dentinydentiny left a comment

Choose a reason for hiding this comment

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

Thanks for the effort! Overall it LGTM, my comments are:

  • Don't usegtest as dependency for production targets
  • Add all dependent targets to avoid implicit dependencies
  • Don't useray_common, which is a giant target only made for backward compatibility

If you think it's hard / overwhelming to make all these changes on one iteration, I'm ok with you leaving TODO items and make new PRs.

@dentiny
Copy link
Contributor

Let me know if you have any problems / questions, happy to help :)

Ziy1-Tan reacted with heart emoji

@Ziy1-Tan
Copy link
ContributorAuthor

About 21.8% compile time reduction.

Thanks for the benchmark! Curious what target are you building?

The target //:scheduler only. I have updated some reproduce steps.

@Ziy1-Tan
Copy link
ContributorAuthor

Replacement of:ray_common is tracked at#51677. cc@dentiny

BUILD.bazel Outdated
":node_label_scheduling_policy",
":random_scheduling_policy",
":spread_scheduling_policy",
"//src/ray/util",
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for being picky, but could you please remove the header inclusion and dependency ofray/util?

I don't think it's used anywhere

BUILD.bazel Outdated
hdrs = ["src/ray/raylet/scheduling/policy/hybrid_scheduling_policy.h"],
deps = [
":scheduling_policy",
"//src/ray/util",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, could you please remove the header and deps forray/util?

BUILD.bazel Outdated
hdrs = ["src/ray/raylet/scheduling/policy/random_scheduling_policy.h"],
deps = [
":scheduling_policy",
"//src/ray/util",
Copy link
Contributor

Choose a reason for hiding this comment

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

BUILD.bazel Outdated
deps = [
":hybrid_scheduling_policy",
":scheduling_policy",
"//src/ray/util",
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

container util seems useless as well:

BUILD.bazel Outdated
deps = [
":scheduling_policy",
"//src/ray/util",
"//src/ray/util:container_util",
Copy link
Contributor

Choose a reason for hiding this comment

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

container_util seems unused

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

const auto &node = map_find_or_die(nodes_, node_id); still need this header.

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, thank you for checking!

BUILD.bazel Outdated
":random_scheduling_policy",
":spread_scheduling_policy",
"//src/ray/util",
"//src/ray/util:container_util",
Copy link
Contributor

Choose a reason for hiding this comment

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

Seem unused, could you please try remove?

hdrs = ["src/ray/raylet/scheduling/local_resource_manager.h"],
deps = [
":gcs_client_lib",
":ray_common",
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi could you please paste the TODO (and also the github issue) everywhere, so we don't miss?

Copy link
Contributor

@dentinydentiny left a comment

Choose a reason for hiding this comment

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

Thank you so much for the change! Overall LGTM, just a few last comments:

  • Let's leave github issue links everywhere so we don't forget;
  • ray/util andray/container_util seems largely unused, let's cleanup the header inclusion and dependencies

Ziy1-Tan reacted with thumbs up emoji
@dentiny
Copy link
Contributor

The microcheck failure doesn't seem to be related to your change, so let's ignore it for now.

Copy link
Contributor

@dentinydentiny left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for your contribution!
I just enabled CI for you, feel free to ping me when it passes.

Ziy1-Tan reacted with laugh emoji
@dentinydentiny added the goadd ONLY when ready to merge, run all tests labelMar 27, 2025
Signed-off-by: Ziy1-Tan <ajb459684460@gmail.com>
Signed-off-by: Ziy1-Tan <ajb459684460@gmail.com>
@Ziy1-Tan
Copy link
ContributorAuthor

LGTM! Thank you for your contribution! I just enabled CI for you, feel free to ping me when it passes.

Thank you for your reviews! I think it's time to merge.

@dentiny
Copy link
Contributor

@aslonnie /@jjyao /@edoakes could you please help merge this pr?

@aslonnieaslonnie merged commit1cef714 intoray-project:masterMar 28, 2025
5 checks passed
justinrmiller pushed a commit to justinrmiller/ray that referenced this pull requestMar 30, 2025
…nce (ray-project#51641)Closesray-project#51634Before:```INFO: Elapsed time: 600.027s, Critical Path: 94.84sINFO: 3687 processes: 460 disk cache hit, 1400 internal, 1827 linux-sandbox.INFO: Build completed successfully, 3687 total actions```After:```INFO: Elapsed time: 440.950s, Critical Path: 89.94sINFO: 3932 processes: 1647 internal, 2285 linux-sandbox.INFO: Build completed successfully, 3932 total actions```Reproduce steps:```bazel cleansudo sync; sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"bazel build //:scheduler```About **26.5%** compile time reduction.---------Signed-off-by: Ziy1-Tan <ajb459684460@gmail.com>Signed-off-by: Justin Miller <justinrmiller@gmail.com>
pavelkushtia pushed a commit to pavelkushtia/ray that referenced this pull requestApr 6, 2025
…nce (ray-project#51641)Closesray-project#51634 Before:```INFO: Elapsed time: 600.027s, Critical Path: 94.84sINFO: 3687 processes: 460 disk cache hit, 1400 internal, 1827 linux-sandbox.INFO: Build completed successfully, 3687 total actions```After:```INFO: Elapsed time: 440.950s, Critical Path: 89.94sINFO: 3932 processes: 1647 internal, 2285 linux-sandbox.INFO: Build completed successfully, 3932 total actions```Reproduce steps:```bazel cleansudo sync; sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"bazel build //:scheduler```About **26.5%** compile time reduction.---------Signed-off-by: Ziy1-Tan <ajb459684460@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dentinydentinydentiny approved these changes

Assignees
No one assigned
Labels
coreIssues that should be addressed in Ray Coregoadd ONLY when ready to merge, run all tests
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[core/scheduler] Split giant ray core C++ target into small ones
4 participants
@Ziy1-Tan@dentiny@aslonnie@jcotant1

[8]ページ先頭

©2009-2025 Movatter.jp