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
Show file tree
Hide file tree
Changes from 3 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
14 changes: 13 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- unit-tests-cudf-pandas
- pandas-tests
- pandas-tests-diff
- third-party-integration-tests-cudf-pandas
Matt711 marked this conversation as resolved.
Show resolved Hide resolved
Matt711 marked this conversation as resolved.
Show resolved Hide resolved
- telemetry-setup
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
Expand Down Expand Up @@ -326,7 +327,18 @@ jobs:
node_type: cpu4
build_type: pull-request
run_script: "ci/cudf_pandas_scripts/pandas-tests/diff.sh"

# TODO: Remove this CI job after https://github.com/rapidsai/cudf/issues/17490 is resolved
third-party-integration-tests-cudf-pandas:
needs: wheel-build-cudf
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
node_type: "gpu-v100-latest-1"
arch: "amd64"
container_image: "rapidsai/ci-conda:latest"
run_script: |
ci/cudf_pandas_scripts/third-party-integration/test.sh python/cudf/cudf_pandas_tests/third_party_integration_tests/dependencies.yaml
Matt711 marked this conversation as resolved.
Show resolved Hide resolved
telemetry-summarize:
runs-on: ubuntu-latest
needs: pr-builder
Expand Down
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,13 @@ 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.
# TODO: We should remove the call to .get() when .inplace_predict()
Matt711 marked this conversation as resolved.
Show resolved Hide resolved
# returns a cudf.pandas proxy numpy array
Matt711 marked this conversation as resolved.
Show resolved Hide resolved
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