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 failing xgboost test in the cudf.pandas third-party integration tests #17616

Merged
merged 7 commits into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ def test_with_external_memory(
return predt


@pytest.mark.skip(
reason="TypeError: Implicit conversion to a NumPy array is not allowed. Please use `.get()` to construct a NumPy array explicitly."
)
@pytest.mark.parametrize("device", ["cpu", "cuda"])
def test_predict(device: str) -> np.ndarray:
reg = xgb.XGBRegressor(n_estimators=2, device=device)
Expand All @@ -127,6 +124,11 @@ def test_predict(device: str) -> np.ndarray:
predt0 = reg.predict(X_df)

predt1 = booster.inplace_predict(X_df)
# After https://github.com/dmlc/xgboost/pull/11014, .inplace_predict()
# returns a real cupy array when called on a cudf.pandas proxy dataframe.
# So we need to ensure we have a valid numpy array.
if not isinstance(predt1, np.ndarray):
predt1 = predt1.get()
np.testing.assert_allclose(predt0, predt1)

predt2 = booster.predict(xgb.DMatrix(X_df))
Expand Down
Loading