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

Fix RF integer overflow #4563

Merged
merged 3 commits into from
Feb 10, 2022
Merged

Conversation

RAMitchell
Copy link
Contributor

@RAMitchell RAMitchell commented Feb 8, 2022

The following script results in an illegal memory access:

import cupy as cp
from cuml.ensemble import RandomForestClassifier
X = cp.random.random((1000000, 2500),dtype=cp.float32)
assert(X.size > 2**31)
y = cp.zeros(X.shape[0])
y[::2]=1.0

model = RandomForestClassifier()
model.fit(X,y)
pred = model.predict(X)

Fixed by some targeted casting of integers to 64 bit.

See #2459.

@RAMitchell RAMitchell requested a review from a team as a code owner February 8, 2022 12:55
@RAMitchell
Copy link
Contributor Author

@vinaydes @venkywonka would be great if you can give a short review.

Copy link
Contributor

@venkywonka venkywonka left a comment

Choose a reason for hiding this comment

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

don't see any problemo. Thank you rory!

@venkywonka venkywonka added the improvement Improvement / enhancement to an existing function label Feb 8, 2022
@cjnolet cjnolet added this to PR-WIP in v22.04 Release via automation Feb 8, 2022
@cjnolet cjnolet added the non-breaking Non-breaking change label Feb 8, 2022
v22.04 Release automation moved this from PR-WIP to PR-Reviewer approved Feb 8, 2022
@dantegd
Copy link
Member

dantegd commented Feb 9, 2022

rerun tests

@dantegd
Copy link
Member

dantegd commented Feb 9, 2022

@gpucibot merge

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.04@f677006). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             branch-22.04    #4563   +/-   ##
===============================================
  Coverage                ?   85.73%           
===============================================
  Files                   ?      239           
  Lines                   ?    19585           
  Branches                ?        0           
===============================================
  Hits                    ?    16792           
  Misses                  ?     2793           
  Partials                ?        0           
Flag Coverage Δ
dask 46.18% <0.00%> (?)
non-dask 78.73% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out 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 f677006...bbd7968. Read the comment docs.

@rapids-bot rapids-bot bot merged commit 06783ff into rapidsai:branch-22.04 Feb 10, 2022
v22.04 Release automation moved this from PR-Reviewer approved to Done Feb 10, 2022
vimarsh6739 pushed a commit to vimarsh6739/cuml that referenced this pull request Oct 9, 2023
The following script results in an illegal memory access:
```python
import cupy as cp
from cuml.ensemble import RandomForestClassifier
X = cp.random.random((1000000, 2500),dtype=cp.float32)
assert(X.size > 2**31)
y = cp.zeros(X.shape[0])
y[::2]=1.0

model = RandomForestClassifier()
model.fit(X,y)
pred = model.predict(X)
```

Fixed by some targeted casting of integers to 64 bit.

See rapidsai#2459.

Authors:
  - Rory Mitchell (https://github.com/RAMitchell)

Approvers:
  - Venkat (https://github.com/venkywonka)
  - Corey J. Nolet (https://github.com/cjnolet)

URL: rapidsai#4563
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CUDA/C++ improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants