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

[Datasets] Unrevert Arrow table copy method change. #19534

Conversation

clarkzinzow
Copy link
Contributor

@clarkzinzow clarkzinzow commented Oct 20, 2021

Unreverts the reversion of #19494. This PR also changes the Arrow table copy method to a per-column copy via chunk concatenation, which

  1. Is guaranteed to be single-copy.
  2. Is guaranteed to preserve the original data (no roundtrip with other representation that might perform casting).

Opening the PR to let the failing example run in CI since I wasn't able to reproduce the failure locally.

Related issue number

Closes #19476

Checks

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

@ericl
Copy link
Contributor

ericl commented Oct 20, 2021

LGTM if it passes the linear dataset test

assert len(chunk) == b - a
bufs = chunk.buffers()
print(len(bufs))
assert bufs[1].address != og_bufs[1].address
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@clarkzinzow
Copy link
Contributor Author

@ericl I updated this to use chunk concatenation to copy instead of the NumPy roundtrip, this should be guaranteed to be single-copy and should prevent any data coercions from happening. Please take another look!

Co-authored-by: Eric Liang <ekhliang@gmail.com>
@clarkzinzow clarkzinzow changed the title [Datasets] [WIP] Unrevert Arrow table copy method change. [Datasets] Unrevert Arrow table copy method change. Oct 20, 2021
@clarkzinzow clarkzinzow added the tests-ok The tagger certifies test failures are unrelated and assumes personal liability. label Oct 20, 2021
@clarkzinzow
Copy link
Contributor Author

@ericl Datasets tests and Ray Train examples are passing, MacOS failures appear to be unrelated, so this is gtg in terms of CI.

@ericl ericl merged commit 88c5fcd into ray-project:master Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests-ok The tagger certifies test failures are unrelated and assumes personal liability.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Datasets] Copying within Arrow block slicing breaks tensor column support.
3 participants