Skip to content

Remove CPU profiler from Ray Service Replica, Proxy & Controller #54438

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

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

Conversation

ok-scale
Copy link
Contributor

@ok-scale ok-scale commented Jul 8, 2025

Why are these changes needed?

The method ray.serve._private.replica.ReplicaActor._save_cpu_profile_data accesses two non-existent instance attributes, self.cpu_profiler and self.cpu_profiler_log. This PR removes the method and the associated variables as there is no usage.

They can be added back by referencing git history.

Related issue number

Closes #53677

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 :(

@Copilot Copilot AI review requested due to automatic review settings July 8, 2025 20:18
@ok-scale ok-scale requested a review from a team as a code owner July 8, 2025 20:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes unused CPU profiling code from the Ray Serve replica, proxy, and controller components.

  • Eliminates configure_component_cpu_profiler imports and initializations.
  • Deletes the _save_cpu_profile_data methods.
  • Removes the now-unneeded marshal import.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
python/ray/serve/_private/replica.py Removed CPU profiler import, initialization, and save method
python/ray/serve/_private/proxy.py Removed CPU profiler import, initialization, and save method
python/ray/serve/_private/controller.py Removed marshal import, CPU profiler import, initialization, and save method

@ok-scale ok-scale added the go add ONLY when ready to merge, run all tests label Jul 8, 2025
Copy link
Contributor

@abrarsheikh abrarsheikh left a comment

Choose a reason for hiding this comment

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

Ok to remove profiling from all replica/controller/proxy since I don't think its part of anyones workflow.
But I want to also note that the reported issue is only with replica; proxy and controller cpu profiler should be correctly.

@zcin zcin requested a review from edoakes July 10, 2025 21:21
Copy link
Contributor

@zcin zcin left a comment

Choose a reason for hiding this comment

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

if we're removing all usage then let's also remove configure_component_cpu_profiler and RAY_SERVE_ENABLE_CPU_PROFILING

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