Skip to content

Add tpu usage metrics to reporter_agent - #53678

Merged
can-anyscale merged 18 commits into
ray-project:masterfrom
richardsliu:metric
Jun 14, 2025
Merged

can-anyscale merged 18 commits into
ray-project:masterfrom
richardsliu:metric

Conversation

@richardsliu

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Adding TPU usage metrics for tensorcore_utilization and hbm_utilization to reporter_agent.

Related issue number

Checks

richardsliu and others added 6 commits June 9, 2025 21:17
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
richardsliu and others added 4 commits June 9, 2025 14:18
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>

@alanwguo alanwguo left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@can-anyscale, does this PR interfere at all with your OTEL migration PR?

Comment thread python/ray/dashboard/consts.py Resolved
@can-anyscale

Copy link
Copy Markdown
Contributor

thanks for tagging @alanwguo , not at all, looking great

Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
@richardsliu

Copy link
Copy Markdown
Contributor Author

Added a few additional runtime metrics, please take another look.

@alanwguo alanwguo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you also add some visualizations of these metrics to default_dashboard_panels.py?

This will add this to the core grafana dashboard used in the ray dashboard.
We can also add it to be embedded into the Ray Dashboard UI in the Metrics.tsx file.

This can be done as a follow-up PR as well.

Overall, this PR looks good. I'm testing e2e before approving.

@richardsliu

Copy link
Copy Markdown
Contributor Author

Sounds good, I'll modify the dashboard in a follow up PR.

@mascharkh mascharkh moved this to In Progress in K8s and Ray (go/k8s-ray-oss) Jun 12, 2025
@mascharkh mascharkh assigned mascharkh, jjyao and alanwguo and unassigned mascharkh Jun 12, 2025
@alanwguo alanwguo added the go add ONLY when ready to merge, run all tests label Jun 12, 2025
@alanwguo

Copy link
Copy Markdown
Contributor

@jjyao can you review and merge?

@jjyao jjyao unassigned alanwguo and jjyao Jun 12, 2025
@jjyao

jjyao commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

@can-anyscale @MengjinYan could you review this PR since you are working on metrics right now.

@can-anyscale can-anyscale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

try:
for family in text_string_to_metric_families(metrics):
for sample in family.samples:
if sample.name == "memory_bandwidth_utilization":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seem weird to have all of these sample name hardcoded here; how often these name changes; if they change will we have malformed metric collected

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
@richardsliu

Copy link
Copy Markdown
Contributor Author

@can-anyscale Fixed, please take another look.

@can-anyscale can-anyscale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just one additional question

Signed-off-by: Richard Liu <[email protected]>
@richardsliu

Copy link
Copy Markdown
Contributor Author

@can-anyscale Done.

@can-anyscale can-anyscale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, did you test this end-to-end and see the right metric reported, etc.?

@richardsliu

Copy link
Copy Markdown
Contributor Author

Yes, I can see the metrics reported in Prometheus. I am adding the dashboard changes in a follow up PR.

@can-anyscale
can-anyscale merged commit b030d5b into ray-project:master Jun 14, 2025
@github-project-automation github-project-automation Bot moved this from In Progress to Done in K8s and Ray (go/k8s-ray-oss) Jun 14, 2025
elliot-barn pushed a commit that referenced this pull request Jun 18, 2025
<!-- Thank you for your contribution! Please review
https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before
opening a pull request. -->

<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->

## Why are these changes needed?

Adding TPU usage metrics for tensorcore_utilization and hbm_utilization
to reporter_agent.

## Related issue number

<!-- For example: "Closes #1234" -->

## Checks

- [X] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [X] I've run `scripts/format.sh` to lint the changes in this PR.
- [X] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [X] 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.
- [X] 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
   - [X] Unit tests
   - [X] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
elliot-barn pushed a commit that referenced this pull request Jul 2, 2025
<!-- Thank you for your contribution! Please review
https://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before
opening a pull request. -->

<!-- Please add a reviewer to the assignee section when you create a PR.
If you don't have the access to it, we will shortly find a reviewer and
assign them to your PR. -->

## Why are these changes needed?

Adding TPU usage metrics for tensorcore_utilization and hbm_utilization
to reporter_agent.

## Related issue number

<!-- For example: "Closes #1234" -->

## Checks

- [X] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [X] I've run `scripts/format.sh` to lint the changes in this PR.
- [X] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [X] 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.
- [X] 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
   - [X] Unit tests
   - [X] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: Richard Liu <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
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

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants