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

Rework implementation of dpnp.unwrap function #1950

Merged
merged 10 commits into from
Aug 2, 2024
Merged

Conversation

antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented Jul 26, 2024

The PR proposes to rework implementation of dpnp.unwrap function which are quite limited now.
Added support for all keywords provided by numpy.unwrap.

The page with a table of mathematical functions is aligned with actual numpy content.
The all affected tests are updated to cover different use cases.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to 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 filing the PR as a draft?

@antonwolfy antonwolfy self-assigned this Jul 26, 2024
Copy link
Contributor

github-actions bot commented Jul 26, 2024

View rendered docs @ https://intelpython.github.io/dpnp/index.html

tests/test_mathematical.py Outdated Show resolved Hide resolved
tests/test_mathematical.py Outdated Show resolved Hide resolved
@antonwolfy
Copy link
Contributor Author

The timing on PVC with the following example:

a = numpy.random.rand(10**6).astype(dtype) * 1000
_ = numpy.unwrap(a, period=355)

ia = dpnp.array(a)
b = dpnp.unwrap(ia, period=355); b.sycl_queue.wait()

in the table below

dtype numpy dpnp CPU dpnp GPU
f8 30.8 ms 14.9 ms 1.97 ms
f4 27.6 ms 11.5 ms 1.39 ms
i8 11.8 ms 11.2 ms 1.96 ms
i4 11.2 ms 8.63 ms 1.31 ms

@vlad-perevezentsev vlad-perevezentsev self-requested a review August 2, 2024 17:20
Copy link
Collaborator

@vlad-perevezentsev vlad-perevezentsev left a comment

Choose a reason for hiding this comment

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

Looks good!
Thank you @antonwolfy

@antonwolfy antonwolfy merged commit d2c623b into master Aug 2, 2024
43 of 45 checks passed
@antonwolfy antonwolfy deleted the impl-unwrap branch August 2, 2024 17:23
github-actions bot added a commit that referenced this pull request Aug 2, 2024
* Align doc page of Mathematical functions with numpy

* Implement dpnp.unwrap() function

* Enable muted tests

* Add more tests

* Resolve pre-commit issue

* Apply suggestions from code review

Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com>

* Replace dpnp.copyto with dpnp.where

---------

Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com> d2c623b
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