Skip to content
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

[Data] Estimate object store memory from in-flight tasks #42504

Merged
merged 13 commits into from Jan 25, 2024

Conversation

bveeramani
Copy link
Member

@bveeramani bveeramani commented Jan 19, 2024

Why are these changes needed?

Ray Data's streaming executor launches as many as 50 tasks in a single scheduling step. If the executor doesn't account for the potential output of in-flight tasks, it launches too many tasks (since tasks don't immediately output data) and causes spilling.

This PR fixes the issue by considering data buffered at the Ray Core level to computations of topology resource usage.

Related issue number

Fixes #42374

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

Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
@bveeramani bveeramani marked this pull request as ready for review January 24, 2024 00:10
@@ -311,10 +311,13 @@ def base_resource_usage(self) -> ExecutionResources:
def current_resource_usage(self) -> ExecutionResources:
# Both pending and running actors count towards our current resource usage.
num_active_workers = self._actor_pool.num_total_actors()
object_store_memory = self.metrics.obj_store_mem_cur
if self.metrics.obj_store_mem_pending is not None:
object_store_memory += self.metrics.obj_store_mem_pending
Copy link
Contributor

Choose a reason for hiding this comment

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

(not blocking this PR. just a note.)
I plan to move this method to OpRuntimeMetrics. Currently it's weird that we have 2 different places reporting resource metrics.

bveeramani and others added 5 commits January 24, 2024 20:16
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
@bveeramani bveeramani merged commit 0c0ed96 into ray-project:master Jan 25, 2024
8 of 9 checks passed
@bveeramani bveeramani deleted the conservative-estimate branch January 25, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data] Ray Data is not respecting object store memory limit
3 participants