DOC: Describe behaviors from array API#2707
DOC: Describe behaviors from array API#2707david-cortes-intel merged 5 commits intouxlfoundation:mainfrom
Conversation
|
|
||
| When passing array API inputs to methods such as ``.predict()`` of estimators with array API support, the output | ||
| will always be of the same class as the inputs, but be aware that array attributes of fitted models (e.g. ``coef_`` | ||
| in a linear model) will not necessarily be of the same class as array API inputs passed to ``.fit()``, even though |
There was a problem hiding this comment.
@icfaust Feel free to add a better paragraph here.
There was a problem hiding this comment.
I'll give it a look! Thanks for the work!
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| DPCTL or DPNP inputs are not required to use `config_context(target_offload=device)`. | ||
| `sklearnex` will use input usm_ndarray sycl context for device offloading. | ||
| .. note:: | ||
| Unlike |sklearn|, |sklearnex| does not require `array-api-compat <https://github.com/data-apis/array-api-compat>`__ |
There was a problem hiding this comment.
This note unfortunately needs to be removed. array-api-compat is necessary via sklearn's get_namespace which is used throughout on our side, as well as in validate_data. We just don't insist on array-api-compat in the onedal module/estimators (hence why its either lazy loaded there or functions like get_namespace are avoided).
There was a problem hiding this comment.
Removed.
| While full array API support is currently not implemented for all classes, :external+dpnp:doc:`dpnp.ndarray <reference/ndarray>` | ||
| and :external+dpctl:doc:`dpctl.tensor <api_reference/dpctl/tensor>` inputs are supported by all the classes | ||
| that have :ref:`GPU support <oneapi_gpu>`. Note however that if array API support is not enabled in |sklearn|, | ||
| when passing these classes as inputs, data will be transferred to host and then back to device instead of being | ||
| used directly. |
3d86aeb
into
uxlfoundation:main
Description
This PR updates the doc section about array API support to reflect the behaviors of the library as of today.
Since it looks like there won't be major changes in the dispatching logic for a while, the PR tries to describe all of the current behaviors, even if they might not sound very logical.
I am not 100% certain that I'm getting all the details right so @icfaust please give it a thorough read. In particular, I am not sure when sklearnex models will have attributes that are array API classes and when not.
During the changes here, I noticed that the doc page for array API was linking to examples that pass dpnp/dpctl data, but those weren't using array API so data was being moved back and forth regardless. Since those do not have 'array_api' in their names I simply removed them and added a more descriptive example.
Checklist:
Completeness and readability
Testing