Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
ndgrigorian merged 8 commits intomasterIntelPython/dpctl:masterfrom
divide-by-scalar-integerIntelPython/dpctl:divide-by-scalar-integerCopy head branch name to clipboard
Sep 5, 2024
Merged

Add dpctl.tensor._tensor_elementwise_impl._divide_by_scalar utility function and use it in statistical functions#1820
ndgrigorian merged 8 commits intomasterIntelPython/dpctl:masterfrom
divide-by-scalar-integerIntelPython/dpctl:divide-by-scalar-integerCopy head branch name to clipboard

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?

@github-actions
Copy link

github-actions bot commented Sep 4, 2024

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

@github-actions
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
dpctl/tensor/_clip.py Show resolved Hide resolved
dpctl/tensor/_statistical_functions.py Outdated Show resolved Hide resolved
@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
@oleksandr-pavlyk oleksandr-pavlyk self-requested a review September 5, 2024 13:08
@github-actions
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
@ndgrigorian ndgrigorian force-pushed the divide-by-scalar-integer branch from 775ba90 to 6bde41f Compare September 5, 2024 16:32
@github-actions
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
@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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.