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

Add dpctl.tensor._tensor_elementwise_impl._divide_by_scalar utility function and use it in statistical functions #1820

Merged
merged 8 commits into from
Sep 5, 2024

Conversation

ndgrigorian
Copy link
Collaborator

@ndgrigorian ndgrigorian commented Sep 4, 2024

This PR proposes adding a utility function _divide_by_scalar to the _tensor_elementwise_impl sub-module.

This function improves the performance of division where the denominator is a Python scalar by avoiding a call to asarray and allocating device memory.

This function is also deployed to the statistical functions.

Slips in a change to remove a superfluous wait() from _clip.py

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

Copy link

github-actions bot commented Sep 4, 2024

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Copy link

github-actions bot commented Sep 4, 2024

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_392 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Sep 4, 2024

Coverage Status

coverage: 87.893% (-0.007%) from 87.9%
when pulling 6bde41f on divide-by-scalar-integer
into b5e56e0 on master.

@ndgrigorian ndgrigorian marked this pull request as ready for review September 4, 2024 22:58
@oleksandr-pavlyk oleksandr-pavlyk changed the title Add dpctl.tensor._tensor_elementwise_impl._divide_by_scalar utility function Add dpctl.tensor._tensor_elementwise_impl._divide_by_scalar utility function and use it in statistical functions Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_393 ran successfully.
Passed: 895
Failed: 0
Skipped: 119

Apply review suggestions
Copy link

github-actions bot commented Sep 5, 2024

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_393 ran successfully.
Passed: 895
Failed: 0
Skipped: 119

@ndgrigorian ndgrigorian merged commit aad69b0 into master Sep 5, 2024
43 of 48 checks passed
@ndgrigorian ndgrigorian deleted the divide-by-scalar-integer branch September 5, 2024 18:05
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