-
Notifications
You must be signed in to change notification settings - Fork 179
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
ENH: Array API dispatching #2096
base: main
Are you sure you want to change the base?
ENH: Array API dispatching #2096
Conversation
added array-api-compat to test env
|
sklearnex/utils/_array_api.py
Outdated
# Stricter NumPy-based Array API implementation. The | ||
# array_api_strict.Array instances always have a dummy "device" attribute. | ||
"array_api_strict", | ||
"dpctl.tensor", |
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.
Should be reverted, since stock scikit-learn testing not well designed for having input data being located on single target device.
sklearnex/utils/_array_api.py
Outdated
yield array_namespace | ||
|
||
|
||
def yield_namespace_device_dtype_combinations(include_numpy_namespaces=True): |
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.
just for testing were added. Will be removed due to https://github.com/intel/scikit-learn-intelex/pull/2096/files#r1792608548
added versioning for the get_nnamespace
…m/samir-nasibli/scikit-learn-intelex into enh/array_api_dispatching_testing
# _convert_to_numpy not designed for numpy.ndarray inputs. | ||
assert_allclose(_convert_to_numpy(X_df, xp), _convert_to_numpy(X_df_res, xp)) | ||
else: | ||
assert_allclose(X_df, X_df_res) |
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.
Asser_all_finite checks +
Convert_or_pass is going to cause some problems. This won't show up in any of the CIs as currently configured, but low precision hardware is going to have troubles. Secondly, non dpnp, dpctl inputs are going to have lots of troubles on to_table, as the dlpack interface is not in place. The best way to solve these issues is to 1) fix the dlpack problem, and 2) add the ability to pass a queue into to_table, which then the data conversion should be done in pybind11 than in python (i.e. check the dtypes, see if they don't match the queue's device, convert via copy and create the table). |
Description
Based on #2079
Adding
dpctl
into conformance testing.Some development from #2014
TBD
Checklist to comply with before moving PR from draft:
PR completeness and readability
Testing
Performance