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

[BUG] GpuAdd and GpuMultiply do not include failOnError #3472

Closed
revans2 opened this issue Sep 13, 2021 · 10 comments · Fixed by #3537
Closed

[BUG] GpuAdd and GpuMultiply do not include failOnError #3472

revans2 opened this issue Sep 13, 2021 · 10 comments · Fixed by #3537
Assignees
Labels
audit_3.2.0 bug Something isn't working P0 Must have for release

Comments

@revans2
Copy link
Collaborator

revans2 commented Sep 13, 2021

Describe the bug
Add and Multiply added in failOnError fields.

This is similar to #2078 but for overflow. We either need to fall back to the GPU in these cases or implement the feature. Note that this impacts Canonicalization too.

@firestarman
Copy link
Collaborator

... We either need to fall back to the GPU in ...

fall back to the CPU ?

@revans2
Copy link
Collaborator Author

revans2 commented Sep 14, 2021

Yes that was a typo. We should fall back to the CPU unless we have a good way to detect overflow and we want to add it in.

@Salonijain27 Salonijain27 added P0 Must have for release and removed ? - Needs Triage Need team to review and classify labels Sep 14, 2021
@firestarman
Copy link
Collaborator

firestarman commented Sep 15, 2021

We can leverage the same solution with Java to detect overflow for “Add” op.
addExact(int x, int y) and addExact(long x, long y) are using the same algorithm to check if overflow occurs, which is likely to apply to Byte and Short.

Concerning the "Multiply" op, unfortunately it is much more complitcated, so we can fall back to CPU now.

Any idea ?

@revans2
Copy link
Collaborator Author

revans2 commented Sep 15, 2021

Yes we could detect a sign change like add exact is doing. This will not work for the AST version of add so we still will need to fall back in that case. We also will have to be careful with Decimal vs non-Decimal add.

@revans2
Copy link
Collaborator Author

revans2 commented Sep 15, 2021

I just saw that UnaryMinus also has a fail on error added in...

@revans2
Copy link
Collaborator Author

revans2 commented Sep 15, 2021

multiplyExact is more complicated, but it should work here too. We support everything that is a part of it. I would file a follow on issue though, for us to implement our own kernel to be able to do the checking ourselves.

@firestarman
Copy link
Collaborator

I just saw that UnaryMinus also has a fail on error added in...

So do almost all the expressions in file arithmetic.scala, e.g. Subtract, Abs...

@firestarman
Copy link
Collaborator

Yes we could detect a sign change like add exact is doing. This will not work for the AST version of add so we still will need to fall back in that case. We also will have to be careful with Decimal vs non-Decimal add.

Yes seems we need to always fall back to CPU when ansi is enabled. Since there is no reliable way to know whether the AST version will be used.
We can add failOnError support after implementing overflow checks in cuDF kernels.

@jlowe
Copy link
Member

jlowe commented Sep 16, 2021

Since there is no reliable way to know whether the AST version will be used.

There's a separate tagForAst which controls the logic of tagging whether this can be converted to AST, so if you want to only allow conversion in the non-AST case that should be possible to do. tagForAst can check for failOnError and preclude use in the AST.

@firestarman
Copy link
Collaborator

There's a separate tagForAst which controls the logic of tagging whether this can be converted to AST, so if you want to only allow conversion in the non-AST case that should be possible to do. tagForAst can check for failOnError and preclude use in the AST.

Thanks Jason ,will check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit_3.2.0 bug Something isn't working P0 Must have for release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants