-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Handle cudf.pandas
proxy objects properly
#11014
Conversation
cudf.pandas
proxy objects properly
@trivialfis Can you review this? |
python-package/xgboost/data.py
Outdated
@@ -846,6 +846,22 @@ def _is_cudf_df(data: DataType) -> bool: | |||
return lazy_isinstance(data, "cudf.core.dataframe", "DataFrame") | |||
|
|||
|
|||
def _is_cudf_pandas_df(data: DataType) -> bool: | |||
return ( | |||
str(type(data)) == "<class 'pandas.core.frame.DataFrame'>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a lazy isinstance method in the compat module, can we use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! We can, Verified in local testing this works.
Added this to the 2.1.3 release. Will push some changes at Monday for |
Changes from my commit:
|
Please help test and review the change. |
Can confirm this works locally. |
--------- Co-authored-by: Hyunsu Cho <phcho@nvidia.com> Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
--------- Co-authored-by: GALI PREM SAGAR <sagarprem75@gmail.com> Co-authored-by: Hyunsu Cho <phcho@nvidia.com>
cudf.pandas
proxy objects will not passis_cudf....
checks and rather they tend to only passis_pandas...
. But the pandas code-flows have manyto_numpy
calls that are introducing slow-downs incase ofcudf.pandas
objects. This PR bypasses this problem by introducing a mechanism to extract propercudf
objects out ofcudf.pandas
objects. That way there is no slow-down.