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

Fall back to CPU for RoundCeil and RoundFloor expressions #5798

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

nartal1
Copy link
Collaborator

@nartal1 nartal1 commented Jun 9, 2022

This contributes to test failures in #5769 esp test_floor* and test_ceil* tests.
While debugging above failures found another bug where a simple ceil on Decimal type was failing.

scala> df.printSchema
root
 |-- value: decimal(18,1) (nullable = true)


scala> df.selectExpr("ceil(value)").collect
22/06/08 17:31:32 WARN GpuOverrides: 
*Exec <ProjectExec> will run on GPU
  *Expression <Alias> CEIL(cast(value#35 as decimal(18,1))) AS CEIL(value)#45 will run on GPU
    *Expression <Ceil> CEIL(cast(value#35 as decimal(18,1))) will run on GPU
      *Expression <Cast> cast(value#35 as decimal(18,1)) will run on GPU
  !Exec <FileSourceScanExec> cannot run on GPU because CSV reading is not 100% compatible when reading doubles. To enable it please set spark.rapids.sql.csv.read.double.enabled to true.

res10: Array[org.apache.spark.sql.Row] = Array([68719476737]

Looks like it was introduced while working on RoundCeil where the maxPrecision was added. Above bug is fixed when the maxPrecision calculation is reverted.
Currently we support RoundCeil/RoundFloor only when scale=0. We have a case where the tests fail when DecimalType(18,0) is given as input. So we are falling back to CPU whenever there is RoundCeil and RoundFloor expr in this PR.
Created a follow-on issue to debug above case and enable these expressions - #5797

Signed-off-by: Niranjan Artal <nartal@nvidia.com>
Signed-off-by: Niranjan Artal <nartal@nvidia.com>
@nartal1 nartal1 added the bug Something isn't working label Jun 9, 2022
@nartal1 nartal1 added this to the Jun 6 - Jun 17 milestone Jun 9, 2022
@nartal1 nartal1 requested a review from tgravescs June 9, 2022 00:45
@nartal1 nartal1 self-assigned this Jun 9, 2022
@nartal1
Copy link
Collaborator Author

nartal1 commented Jun 9, 2022

build

@nartal1 nartal1 merged commit e6935b4 into NVIDIA:branch-22.06 Jun 9, 2022
res-life pushed a commit to res-life/spark-rapids that referenced this pull request Jun 13, 2022
res-life added a commit that referenced this pull request Jun 14, 2022
* Revert "Fall back to CPU for RoundCeil and RoundFloor expressions (#5798)"

This reverts commit e6935b4.

* Support RoundCeil and RoundFloor when scale is zero

Signed-off-by: Chong Gao <res_life@163.com>

Co-authored-by: Chong Gao <res_life@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants