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

Avoid overflow for fixed_point cudf::cast and performance optimization #9772

Merged
merged 3 commits into from
Dec 1, 2021

Conversation

codereport
Copy link
Contributor

@codereport codereport commented Nov 24, 2021

This resolves #9000.

When using cudf::cast for a wider decimal type to a narrower decimal type, you can overflow. This PR modifies the code path for this specific use case so that the "rescale" happens for the type cast. A small perf improvement was added when you have identical scales to avoid rescaling.

CI depends on #9766

@codereport codereport added 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. 4 - Needs Review Waiting for reviewer to review or respond improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Nov 24, 2021
@codereport codereport self-assigned this Nov 24, 2021
@codereport codereport requested a review from a team as a code owner November 24, 2021 16:03
@codereport codereport requested review from cwharris and vuule November 24, 2021 16:03
cpp/src/unary/cast_ops.cu Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 24, 2021

Codecov Report

Merging #9772 (1291e67) into branch-22.02 (967a333) will decrease coverage by 0.01%.
The diff coverage is 9.24%.

❗ Current head 1291e67 differs from pull request most recent head 3c083ab. Consider uploading reports for the commit 3c083ab to get more accurate results
Impacted file tree graph

@@               Coverage Diff                @@
##           branch-22.02    #9772      +/-   ##
================================================
- Coverage         10.49%   10.47%   -0.02%     
================================================
  Files               119      119              
  Lines             20305    20368      +63     
================================================
+ Hits               2130     2133       +3     
- Misses            18175    18235      +60     
Impacted Files Coverage Δ
python/cudf/cudf/__init__.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/column.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/string.py 0.00% <ø> (ø)
python/cudf/cudf/core/frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/groupby/groupby.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/index.py 0.00% <ø> (ø)
python/cudf/cudf/core/indexed_frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/multiindex.py 0.00% <0.00%> (ø)
python/cudf/cudf/utils/utils.py 0.00% <0.00%> (ø)
python/dask_cudf/dask_cudf/io/csv.py 96.00% <100.00%> (+0.10%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11c3dfe...3c083ab. Read the comment docs.

@codereport codereport added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team 4 - Needs Review Waiting for reviewer to review or respond labels Nov 24, 2021
@codereport
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 677e632 into rapidsai:branch-22.02 Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Casting decimal64 into decimal32 fails with some values
4 participants