Skip to content

Conversation

@simonsays1980
Copy link
Contributor

@simonsays1980 simonsays1980 commented Oct 6, 2025

Why are these changes needed?

Computing the num_module_steps_trained_(lifetime)_throughput metrics are biased due to the way how we record throughput times in a loop over module batches. This PR offers a fix to this bias.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run pre-commit jobs to lint the changes in this PR. (pre-commit setup)
  • 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 :(

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
@simonsays1980 simonsays1980 marked this pull request as ready for review October 6, 2025 16:11
@simonsays1980 simonsays1980 requested a review from a team as a code owner October 6, 2025 16:11
Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
@simonsays1980 simonsays1980 added rllib RLlib related issues rllib-multi-agent An RLlib multi-agent related problem. rllib-logging This problem is related to logging metrics labels Oct 6, 2025
cursor[bot]

This comment was marked as outdated.

@kamil-kaczmarek kamil-kaczmarek changed the title LINTER [RLlib] [fix] [metrics] avoid biasing the throughput Oct 7, 2025
Copy link
Contributor

@kamil-kaczmarek kamil-kaczmarek left a comment

Choose a reason for hiding this comment

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

Great catch! Some Small fixes needed.

cursor[bot]

This comment was marked as outdated.

… there.

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
Copy link
Contributor

@kamil-kaczmarek kamil-kaczmarek left a comment

Choose a reason for hiding this comment

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

Hey! Added few more comments to make sure that we report metrics consistently for both learner and differentiable_learner.

Thanks for being patient with this PR!

@simonsays1980 simonsays1980 requested review from a team as code owners October 9, 2025 08:33
cursor[bot]

This comment was marked as outdated.

…tialLearner' and fixed some linting.

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
@simonsays1980 simonsays1980 force-pushed the fix-module-steps-throughputs branch from 7c42aaa to ddcaeab Compare October 9, 2025 09:06
@simonsays1980 simonsays1980 requested review from kamil-kaczmarek and removed request for a team, edoakes and jjyao October 9, 2025 13:54
Copy link
Contributor

@kamil-kaczmarek kamil-kaczmarek left a comment

Choose a reason for hiding this comment

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

Just one last edit and we're good to go 🚀

@kamil-kaczmarek kamil-kaczmarek added the go add ONLY when ready to merge, run all tests label Oct 14, 2025
@simonsays1980 simonsays1980 merged commit 6cbe29d into ray-project:master Oct 18, 2025
6 checks passed
justinyeh1995 pushed a commit to justinyeh1995/ray that referenced this pull request Oct 20, 2025
## Why are these changes needed?

Computing the `num_module_steps_trained_(lifetime)_throughput` metrics
are biased due to the way how we record throughput times in a loop over
module batches. This PR offers a fix to this bias.

## Related issue number

<!-- For example: "Closes ray-project#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 pre-commit jobs to lint the changes in this PR.
([pre-commit
setup](https://docs.ray.io/en/latest/ray-contribute/getting-involved.html#lint-and-formatting))
- [x] 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.
- [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
   - [ ] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
Co-authored-by: Kamil Kaczmarek <kaczmarek.poczta@gmail.com>
xinyuangui2 pushed a commit to xinyuangui2/ray that referenced this pull request Oct 22, 2025
## Why are these changes needed?

Computing the `num_module_steps_trained_(lifetime)_throughput` metrics
are biased due to the way how we record throughput times in a loop over
module batches. This PR offers a fix to this bias.

## Related issue number

<!-- For example: "Closes ray-project#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 pre-commit jobs to lint the changes in this PR.
([pre-commit
setup](https://docs.ray.io/en/latest/ray-contribute/getting-involved.html#lint-and-formatting))
- [x] 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.
- [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
   - [ ] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
Co-authored-by: Kamil Kaczmarek <kaczmarek.poczta@gmail.com>
Signed-off-by: xgui <xgui@anyscale.com>
elliot-barn pushed a commit that referenced this pull request Oct 23, 2025
## Why are these changes needed?

Computing the `num_module_steps_trained_(lifetime)_throughput` metrics
are biased due to the way how we record throughput times in a loop over
module batches. This PR offers a fix to this bias.

## 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 pre-commit jobs to lint the changes in this PR.
([pre-commit
setup](https://docs.ray.io/en/latest/ray-contribute/getting-involved.html#lint-and-formatting))
- [x] 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.
- [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
   - [ ] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
Co-authored-by: Kamil Kaczmarek <kaczmarek.poczta@gmail.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
landscapepainter pushed a commit to landscapepainter/ray that referenced this pull request Nov 17, 2025
## Why are these changes needed?

Computing the `num_module_steps_trained_(lifetime)_throughput` metrics
are biased due to the way how we record throughput times in a loop over
module batches. This PR offers a fix to this bias.

## Related issue number

<!-- For example: "Closes ray-project#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 pre-commit jobs to lint the changes in this PR.
([pre-commit
setup](https://docs.ray.io/en/latest/ray-contribute/getting-involved.html#lint-and-formatting))
- [x] 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.
- [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
   - [ ] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
Co-authored-by: Kamil Kaczmarek <kaczmarek.poczta@gmail.com>
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
## Why are these changes needed?

Computing the `num_module_steps_trained_(lifetime)_throughput` metrics
are biased due to the way how we record throughput times in a loop over
module batches. This PR offers a fix to this bias.

## Related issue number

<!-- For example: "Closes ray-project#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 pre-commit jobs to lint the changes in this PR.
([pre-commit
setup](https://docs.ray.io/en/latest/ray-contribute/getting-involved.html#lint-and-formatting))
- [x] 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.
- [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
   - [ ] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
Co-authored-by: Kamil Kaczmarek <kaczmarek.poczta@gmail.com>
Signed-off-by: Aydin Abiar <aydin@anyscale.com>
Daraan added a commit to Daraan/ray that referenced this pull request Nov 20, 2025
Signed-off-by: Daniel Sperber <github.blurry@9ox.net>
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 rllib RLlib related issues rllib-logging This problem is related to logging metrics rllib-multi-agent An RLlib multi-agent related problem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants