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] Improve warning message when read task is large #46942

Merged
merged 3 commits into from
Aug 3, 2024

Conversation

bveeramani
Copy link
Member

Why are these changes needed?

When a read task is large, Ray Data prints a message like this for each read task:

WARNING: the read task size (17157648427 bytes) is larger than the reported output size of the task (None bytes). This may be a size reporting bug in the datasource being read from.

The message isn't actionable, hard to understand, and spammy (it can be printed thousands of times). To address these issues, this PR makes Ray Data emit a warning like this once:

UserWarning: The serialized size of your read function named 'read_fn' is 128.0MB. This size relatively large. As a result, Ray might excessively spill objects during execution. To fix this issue, avoid accessing self or other large objects in 'read_fn'.

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 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>
@@ -149,9 +149,14 @@ def __init__(self, read_fn: Callable[[], Iterable[Block]], metadata: BlockMetada
self._metadata = metadata
self._read_fn = read_fn

def get_metadata(self) -> BlockMetadata:
@property
def metadata(self) -> BlockMetadata:
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing this from a method to a property for consistency with the newly-added read_fn property

@bveeramani bveeramani enabled auto-merge (squash) August 2, 2024 22:05
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Aug 2, 2024
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
@github-actions github-actions bot disabled auto-merge August 3, 2024 19:59
@bveeramani bveeramani enabled auto-merge (squash) August 3, 2024 20:00
@bveeramani bveeramani merged commit b29bb0a into ray-project:master Aug 3, 2024
5 of 6 checks passed
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.

2 participants