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 dpnp.linalg.lstsq() implementation #1792

Merged
merged 17 commits into from
Apr 29, 2024
Merged

Conversation

vlad-perevezentsev
Copy link
Collaborator

This PR adds a new dpnp.linalg.lstsq) function to calculate the least-squares solution using dpnp.linalg.svd().
Also it adds a new helper function check_2d to check if the input arrays are two-dimensional.

  • 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?

Copy link
Contributor

github-actions bot commented Apr 19, 2024

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

dpnp/linalg/dpnp_utils_linalg.py Outdated Show resolved Hide resolved
tests/third_party/cupy/linalg_tests/test_solve.py Outdated Show resolved Hide resolved
tests/third_party/cupy/linalg_tests/test_solve.py Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_iface_linalg.py Show resolved Hide resolved
dpnp/linalg/dpnp_iface_linalg.py Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_iface_linalg.py Outdated Show resolved Hide resolved
Copy link
Contributor

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

@vlad-perevezentsev vlad-perevezentsev merged commit f6f660c into master Apr 29, 2024
56 checks passed
@vlad-perevezentsev vlad-perevezentsev deleted the impl_lstsq_1 branch April 29, 2024 10:17
github-actions bot added a commit to antonwolfy/dpnp that referenced this pull request Apr 29, 2024
* Add dpnp.linalg.lstsq impl via svd call

* Add cupy tests

* Add copy of s to compute follows data

* Add tests in test_sycl_queue and test_usm_type

* Add related_arrays param to dpnp_svd/svd_batch to follow compute follows data

* Move above and add docstings for _nrm2_last_axis

* Add dpnp tests

* Fix codespell check

* Get uv_type given related_arrays in dpnp_svd

* Check rcond type

* Use empty_like in dpnp_svd

* rcond as int, float or None

* Unlock fix_random() for TestRandint2

---------

Co-authored-by: Anton <[email protected]> f6f660c
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