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

ENH: Array API dispatching #2096

Draft
wants to merge 49 commits into
base: main
Choose a base branch
from

Conversation

samir-nasibli
Copy link
Contributor

@samir-nasibli samir-nasibli commented Oct 8, 2024

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

  • I have reviewed my changes thoroughly before submitting this pull request.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with update and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have added a respective label(s) to PR if I have a permission for that.
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

Performance

  • I have measured performance for affected algorithms using scikit-learn_bench and provided at least summary table with measured data, if performance change is expected.
  • I have provided justification why performance has changed or why changes are not expected.
  • I have provided justification why quality metrics have changed or why changes are not expected.
  • I have extended benchmarking suite and provided corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.

Copy link

mergify bot commented Oct 8, 2024

⚠️ The sha of the head commit of this PR conflicts with #2079. Mergify cannot evaluate rules on this PR. ⚠️

@samir-nasibli samir-nasibli mentioned this pull request Oct 8, 2024
10 tasks
# Stricter NumPy-based Array API implementation. The
# array_api_strict.Array instances always have a dummy "device" attribute.
"array_api_strict",
"dpctl.tensor",
Copy link
Contributor Author

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.

yield array_namespace


def yield_namespace_device_dtype_combinations(include_numpy_namespaces=True):
Copy link
Contributor Author

@samir-nasibli samir-nasibli Oct 8, 2024

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

samir-nasibli added a commit to samir-nasibli/scikit-learn-intelex that referenced this pull request Oct 13, 2024
# _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)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Asser_all_finite checks +

@icfaust
Copy link
Contributor

icfaust commented Dec 6, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Array API enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants