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] Removing unnecessary data copy in convert_udf_returns_to_numpy #39188

Merged
merged 4 commits into from
Sep 5, 2023

Conversation

raulchen
Copy link
Contributor

@raulchen raulchen commented Aug 31, 2023

Why are these changes needed?

This increases the perf of image_loader_microbenchmark.py by ~10%.

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: Hao Chen <chenh1024@gmail.com>
Signed-off-by: Hao Chen <chenh1024@gmail.com>
Signed-off-by: Hao Chen <chenh1024@gmail.com>
Copy link
Contributor

@c21 c21 left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -488,7 +488,10 @@ def _concat_same_type(
[e for a in to_concat for e in a]
)
else:
storage = pa.concat_arrays([c.storage for c in to_concat])
if len(to_concat) == 1:
storage = to_concat[0].storage
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a comment for why this is needed, for reader in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turns out that the PyArrow Block copy code path expects this function to copy data. I reverted this change in this PR, as it doesn't impact the final benchmark perf.

This reverts commit 75b7581.

Signed-off-by: Hao Chen <chenh1024@gmail.com>
@raulchen raulchen changed the title [data] Removing unnecessary data copy [data] Removing unnecessary data copy in convert_udf_returns_to_numpy Sep 1, 2023
@raulchen raulchen merged commit a38eb53 into ray-project:master Sep 5, 2023
21 of 48 checks passed
@raulchen raulchen deleted the reduce-data-copy branch September 5, 2023 18:29
harborn pushed a commit to harborn/ray that referenced this pull request Sep 8, 2023
jimthompson5802 pushed a commit to jimthompson5802/ray that referenced this pull request Sep 12, 2023
…ray-project#39188)

---------

Signed-off-by: Hao Chen <chenh1024@gmail.com>
Signed-off-by: Jim Thompson <jimthompson5802@gmail.com>
vymao pushed a commit to vymao/ray that referenced this pull request Oct 11, 2023
…ray-project#39188)

---------

Signed-off-by: Hao Chen <chenh1024@gmail.com>
Signed-off-by: Victor <vctr.y.m@example.com>
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.

None yet

2 participants