Skip to content

Conversation

@srinathk10
Copy link
Contributor

@srinathk10 srinathk10 commented Nov 19, 2025

Thank you for contributing to Ray! 🚀
Please review the Ray Contribution Guide before opening a pull request.

⚠️ Remove these instructions before submitting your PR.

💡 Tip: Mark as draft if you want early feedback, or ready for review when it's complete.

Description

Briefly describe what this PR accomplishes and why it's needed.

[Data] Tune Concurrency Cap Backpressure objectstore budget ratio

Fix threshold when backpressure should kickin as more intuitive

OBJECT_STORE_BUDGET_RATIO = available budget / (available budget + usage)

Related issues

Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234".

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
@srinathk10 srinathk10 requested a review from a team as a code owner November 19, 2025 08:07
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the concurrency cap backpressure policy to use a more robust available / total ratio for object store usage, instead of available / used. This is a good improvement. The corresponding tests have been updated and expanded. I've found a potential logic bug in the surrounding conditional check for this new ratio that could lead to incorrect backpressure behavior. Additionally, there's a minor inaccuracy in a test comment that could be clarified. Overall, the direction is great, but the identified issue should be addressed.

Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
@srinathk10 srinathk10 changed the title [Data] Tune Concurrency Cap Backpressure Policy Threshold [Data] Tune Concurrency Cap Backpressure objectstore budget ratio Nov 19, 2025
Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
@srinathk10
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the concurrency cap backpressure policy to use a more intuitive object store budget ratio (available / total instead of available / used). The changes include renaming the relevant constant and environment variable, updating the calculation logic, and adjusting the tests accordingly. The refactoring of EWMA_ALPHA_UP to a class constant is a nice improvement for code clarity. The tests have also been improved with more assertions. However, I've found a potential logic bug in how zero object store usage is handled, which could lead to incorrect backpressure behavior. Please see my detailed comment.

@srinathk10
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the concurrency cap backpressure policy by introducing a more intuitive formula for the object store budget ratio. The changes also include moving a magic number to a class constant and significantly improving the test suite with more robust checks. Overall, these are great improvements. I've identified one potential issue with an edge case where memory usage is zero, which could lead to incorrect backpressure behavior, and have provided a suggestion to address it.

@ray-gardener ray-gardener bot added the data Ray Data-related issues label Nov 19, 2025
Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
@srinathk10
Copy link
Contributor Author

/gemini review

@srinathk10 srinathk10 added the go add ONLY when ready to merge, run all tests label Nov 19, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the concurrency cap backpressure logic to use a more intuitive object store budget ratio (available / total instead of available / used). The changes are well-implemented, with corresponding updates to constants, comments, and logging. The tests have also been updated to match the new logic and enhanced with additional assertions to verify behavior, which is a great improvement. I've added a couple of minor suggestions to make the test mocks more robust by ensuring memory values remain non-negative.

Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
@raulchen raulchen merged commit 07aef29 into master Nov 19, 2025
6 checks passed
@raulchen raulchen deleted the srinathk10/concurrency_cap_fixes branch November 19, 2025 23:57
400Ping pushed a commit to 400Ping/ray that referenced this pull request Nov 21, 2025
…y-project#58813)

> Thank you for contributing to Ray! 🚀
> Please review the [Ray Contribution
Guide](https://docs.ray.io/en/master/ray-contribute/getting-involved.html)
before opening a pull request.

> ⚠️ Remove these instructions before submitting your PR.

> 💡 Tip: Mark as draft if you want early feedback, or ready for review
when it's complete.

## Description
> Briefly describe what this PR accomplishes and why it's needed.

### [Data] Tune Concurrency Cap Backpressure objectstore budget ratio

Fix threshold when backpressure should kickin as more intuitive 

`OBJECT_STORE_BUDGET_RATIO = available budget / (available budget +
usage)
`

## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

---------

Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
ykdojo pushed a commit to ykdojo/ray that referenced this pull request Nov 27, 2025
…y-project#58813)

> Thank you for contributing to Ray! 🚀
> Please review the [Ray Contribution
Guide](https://docs.ray.io/en/master/ray-contribute/getting-involved.html)
before opening a pull request.

> ⚠️ Remove these instructions before submitting your PR.

> 💡 Tip: Mark as draft if you want early feedback, or ready for review
when it's complete.

## Description
> Briefly describe what this PR accomplishes and why it's needed.

### [Data] Tune Concurrency Cap Backpressure objectstore budget ratio

Fix threshold when backpressure should kickin as more intuitive

`OBJECT_STORE_BUDGET_RATIO = available budget / (available budget +
usage)
`

## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

---------

Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
Signed-off-by: YK <1811651+ykdojo@users.noreply.github.com>
SheldonTsen pushed a commit to SheldonTsen/ray that referenced this pull request Dec 1, 2025
…y-project#58813)

> Thank you for contributing to Ray! 🚀
> Please review the [Ray Contribution
Guide](https://docs.ray.io/en/master/ray-contribute/getting-involved.html)
before opening a pull request.

> ⚠️ Remove these instructions before submitting your PR.

> 💡 Tip: Mark as draft if you want early feedback, or ready for review
when it's complete.

## Description
> Briefly describe what this PR accomplishes and why it's needed.

### [Data] Tune Concurrency Cap Backpressure objectstore budget ratio

Fix threshold when backpressure should kickin as more intuitive 

`OBJECT_STORE_BUDGET_RATIO = available budget / (available budget +
usage)
`

## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

---------

Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray fails to serialize self-reference objects

3 participants