Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inclusive scan for large sizes (#6234)
- Loading branch information
1 parent
7756192
commit 29745c6
Showing
7 changed files
with
61 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import numpy as np | ||
import xgboost as xgb | ||
import cupy as cp | ||
import time | ||
import pytest | ||
|
||
|
||
# Test for integer overflow or out of memory exceptions | ||
def test_large_input(): | ||
available_bytes, _ = cp.cuda.runtime.memGetInfo() | ||
# 15 GB | ||
required_bytes = 1.5e+10 | ||
if available_bytes < required_bytes: | ||
pytest.skip("Not enough memory on this device") | ||
n = 1000 | ||
m = ((1 << 31) + n - 1) // n | ||
assert (np.log2(m * n) > 31) | ||
X = cp.ones((m, n), dtype=np.float32) | ||
y = cp.ones(m) | ||
dmat = xgb.DeviceQuantileDMatrix(X, y) | ||
xgb.train({"tree_method": "gpu_hist", "max_depth": 1}, dmat, 1) |