-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Closed
Labels
Description
When setting verbosity
to 3 the memory logger should log all allocation and deallocation on GPU. But I encountered the deallocatation error when input is cudf, saying that the pointer in SpasePage::data is never allocated, which is obviously not true.
This is a reminder for myself. Also @RAMitchell might have some inputs here.
def test_cudf():
X = np.random.randn(kRows, kCols)
y = np.random.randn(kRows)
df = pd.DataFrame(X)
df = cudf.from_pandas(df)
dtrain = xgb.DMatrix(df, label=y)
bst = xgb.train({'tree_method': 'gpu_hist', 'verbosity': 2},
dtrain=dtrain,
evals=[(dtrain, 'X')],
num_boost_round=2)
print('Pickle')
import pickle
with open('model.bst', 'bw') as fd:
pickle.dump(bst, fd)
with open('model.bst', 'br') as fd:
bst: xgb.Booster = pickle.load(fd)
dtest = xgb.DMatrix(df, label=y)
bst.set_param({'gpu_id': '0'})
bst.predict(dtest)