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

FIX: fixing spmd tests utilities for dpctl inputs #1999

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

samir-nasibli
Copy link
Contributor

Description

DPCTL doesn't support some numpy-like ufunc functionality, For example, loop of ufunc does not support argument 0 of type dpctl.tensor._usmarray.usm_ndarray which has no callable conjugate method.

Make sense before some manipulations with resulted dpctl or any other non-numpy arrays convert to numpy before and do comparison with expected numpy arrays.

Found on #1861


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

  • The unit tests pass successfully.
  • I have run it locally and tested the changes extensively.

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.

@samir-nasibli
Copy link
Contributor Author

/intelci: run

Copy link
Contributor

@icfaust icfaust left a comment

Choose a reason for hiding this comment

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

Small change in naming convention to keep it compact. Otherwise good to go.

sklearnex/tests/_utils_spmd.py Outdated Show resolved Hide resolved
sklearnex/tests/_utils_spmd.py Outdated Show resolved Hide resolved
Copy link
Contributor

@olegkkruglov olegkkruglov left a comment

Choose a reason for hiding this comment

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

LGTM, please make sure the naming dispute is settled

@samir-nasibli
Copy link
Contributor Author

/intelci: run

Copy link
Contributor

@icfaust icfaust left a comment

Choose a reason for hiding this comment

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

I approve. Just for posterity, and alternate solution as we have talked about elsewhere would have been to use get_namespace. This may be a better convention going forward than using parametrized numpy dtypes, assert(data.dtype == getattr(get_namespace(data)[0], dtype.__name__))

@samir-nasibli
Copy link
Contributor Author

I approve. Just for posterity, and alternate solution as we have talked about elsewhere would have been to use get_namespace. This may be a better convention going forward than using parametrized numpy dtypes, assert(data.dtype == getattr(get_namespace(data)[0], dtype.__name__))

I think this less common for our primitives, so better to convert to one dataframe format then compare.

@samir-nasibli samir-nasibli merged commit 18d0428 into uxlfoundation:main Sep 2, 2024
22 of 24 checks passed
@samir-nasibli samir-nasibli deleted the fix/spmd_test_utils branch September 2, 2024 11:04
@samir-nasibli
Copy link
Contributor Author

@mergify backport rls/2024.7.0-rls

Copy link

mergify bot commented Sep 2, 2024

backport rls/2024.7.0-rls

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Sep 2, 2024
* FIX: fixing spmd tests utilities for dpctl inputs

(cherry picked from commit 18d0428)
samir-nasibli added a commit that referenced this pull request Sep 2, 2024
* FIX: fixing spmd tests utilities for dpctl inputs

(cherry picked from commit 18d0428)

Co-authored-by: Samir Nasibli <[email protected]>
samir-nasibli added a commit to samir-nasibli/scikit-learn-intelex that referenced this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants