-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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] Automatically cast tensor columns when building Pandas blocks. #26924
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…cks. (ray-project#26684) This PR tries to automatically cast tensor columns to our TensorArray extension type when building Pandas blocks, logging a warning and falling back to the opaque object-typed column if the cast fails. This should allow users to remain mostly tensor extension agnostic. TensorArray now eagerly validates the underlying tensor data, raising an error if e.g. the underlying ndarrays have heterogeneous shapes; previously, TensorArray wouldn't validate this on construction and would instead let failures happen downstream. This means that our internal TensorArray use needs to follow a try-except pattern, falling back to a plain NumPy object column.
matthewdeng
changed the title
[wip] cherry-pick tensordtype changes
[Datasets] Automatically cast tensor columns when building Pandas blocks.
Jul 23, 2022
matthewdeng
added
tests-ok
The tagger certifies test failures are unrelated and assumes personal liability.
and removed
do-not-merge
Do not merge this PR!
labels
Jul 23, 2022
matthewdeng
requested review from
ericl,
scv119,
clarkzinzow,
jjyao,
jianoaix,
maxpumperla,
pcmoritz,
richardliaw,
edoakes and
simon-mo
as code owners
July 23, 2022 14:49
scv119
approved these changes
Jul 23, 2022
you probably need @richardliaw approval. |
richardliaw
approved these changes
Jul 23, 2022
@matthewdeng is this good to merge? |
ericl
reviewed
Jul 25, 2022
except TypeError as e: | ||
# Fall back to existing NumPy array. | ||
if ray.util.log_once("datasets_tensor_array_cast_warning"): | ||
logger.warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make this an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this in a follow-up!
6 tasks
Rohan138
pushed a commit
to Rohan138/ray
that referenced
this pull request
Jul 28, 2022
…cks. (ray-project#26924) This PR just applies the changes from the following PRs: [Datasets] Automatically cast tensor columns when building Pandas blocks. ray-project#26684 reverted by Revert "[Datasets] Automatically cast tensor columns when building Pandas blocks." ray-project#26921 [AIR - Datasets] Fix TensorDtype construction from string and fix example. ray-project#26904 This fixes the test failures introduced in the originally reverted PRs. Signed-off-by: Rohan138 <[email protected]>
Stefan-1313
pushed a commit
to Stefan-1313/ray_mod
that referenced
this pull request
Aug 18, 2022
…cks. (ray-project#26924) This PR just applies the changes from the following PRs: [Datasets] Automatically cast tensor columns when building Pandas blocks. ray-project#26684 reverted by Revert "[Datasets] Automatically cast tensor columns when building Pandas blocks." ray-project#26921 [AIR - Datasets] Fix TensorDtype construction from string and fix example. ray-project#26904 This fixes the test failures introduced in the originally reverted PRs. Signed-off-by: Stefan van der Kleij <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
This PR just applies the changes from the following PRs:
CI tests are all green: https://buildkite.com/ray-project/ray-builders-pr/builds/39699
Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.