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

Use Conda XGBoost #17959

Merged
merged 2 commits into from
Feb 10, 2025
Merged

Conversation

jakirkham
Copy link
Member

Description

Switch to Conda XGBoost in Conda-based test of third-party dependencies.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@jakirkham jakirkham added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 8, 2025
@jakirkham jakirkham requested a review from a team as a code owner February 8, 2025 02:27
@jakirkham jakirkham requested a review from bdice February 8, 2025 02:27
@github-actions github-actions bot added Python Affects Python cuDF API. cudf.pandas Issues specific to cudf.pandas labels Feb 8, 2025
@jakirkham jakirkham added the conda label Feb 8, 2025
Copy link
Contributor

@Matt711 Matt711 left a comment

Choose a reason for hiding this comment

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

So this should close #17952 by getting rid of the warnings?

@jakirkham
Copy link
Member Author

I don't think so

That likely needs a change in this test

@pytest.mark.parametrize("device", ["cpu", "cuda"])
def test_predict(device: str) -> np.ndarray:
reg = xgb.XGBRegressor(n_estimators=2, device=device)
X, y = make_regression(n_samples, n_features, random_state=11)
X_df = pd.DataFrame(X)
reg.fit(X_df, y)
booster = reg.get_booster()
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))
np.testing.assert_allclose(predt0, predt2)
predt3 = booster.inplace_predict(X)
np.testing.assert_allclose(predt0, predt3)
return predt0

@jakirkham
Copy link
Member Author

This is just following up on your's and Bradley's suggestions in PR ( #17947 ) starting with comment ( #17947 (comment) )

@galipremsagar
Copy link
Contributor

/merge

@galipremsagar galipremsagar added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Feb 10, 2025
@rapids-bot rapids-bot bot merged commit 300d816 into rapidsai:branch-25.04 Feb 10, 2025
110 checks passed
@jakirkham jakirkham deleted the use_conda_xgboost branch February 10, 2025 18:50
@jakirkham
Copy link
Member Author

Thanks Matthew and Prem! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge conda cudf.pandas Issues specific to cudf.pandas improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants