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

Update dpnp.linalg.qr() function #1673

Merged
merged 43 commits into from
Feb 8, 2024
Merged

Update dpnp.linalg.qr() function #1673

merged 43 commits into from
Feb 8, 2024

Conversation

vlad-perevezentsev
Copy link
Collaborator

This PR update dpnp.linalg.qr() function to calculate the QR decomposition using oneapi::mkl::lapack::geqrf and oneapi::mkl::lapack::orgqr
The implementation is written as a pybind11 extension above required LAPACK functions.
The changes are related to support of all types and support of function argument as mode

  • 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 Jan 31, 2024

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

dpnp/backend/extensions/lapack/geqrf.cpp Show resolved Hide resolved
dpnp/backend/extensions/lapack/geqrf.cpp Show resolved Hide resolved
dpnp/backend/extensions/lapack/geqrf.cpp Show resolved Hide resolved
dpnp/backend/extensions/lapack/geqrf_batch.cpp Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Outdated Show resolved Hide resolved
tests/test_sycl_queue.py Show resolved Hide resolved
tests/third_party/cupy/linalg_tests/test_decomposition.py Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Outdated Show resolved Hide resolved
@vlad-perevezentsev
Copy link
Collaborator Author

vlad-perevezentsev commented Feb 7, 2024

I skipped QR tests on CPU for two reasons:

  1. We need dpcpp_linux-64>=2024.1.0 available in external CI cause of issue [CMPLRLLVM-53771]
  2. The current coverage build uses an old version of MKL (2023.2.0) that has a race condition issue in LAPACK batch implementations [#3413] that causes tests to fail.

Use of new MKL version packages for coverage build will be when dpcpp_linux-64 2024.1.0 is released.

dpnp/linalg/dpnp_utils_linalg.py Outdated 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 Outdated Show resolved Hide resolved
dpnp/linalg/dpnp_utils_linalg.py Show resolved Hide resolved
dpnp/backend/extensions/lapack/geqrf_batch.cpp 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 1e86753 into master Feb 8, 2024
44 of 45 checks passed
@vlad-perevezentsev vlad-perevezentsev deleted the impl_qr_new branch February 8, 2024 12:52
github-actions bot added a commit to antonwolfy/dpnp that referenced this pull request Feb 8, 2024
* Impl dpnp.linalg.qr for 2d array

* Add cupy tests for dpnp.linalg.qr

* Add batch implementation of dpnp.linalg.qr

* Remove an old impl of dpnp_qr

* Update test_qr in test_sycl_queue

* Add test_qr in test_usm_type

* Use _real_type for _orgqr

* Use _real_type for _orgqr_batch

* Update dpnp tests for dpnp.linalg.qr

* Pass scratchpad_size to the error message test

* Add additional checks

* Extend error handler for mkl batch funcs

* Add ungqr mkl extension to support complex dtype

* Update tau array size check for orgqr

* Add ungqr_batch mkl extension to support complex dtype

* Add arrays type check

* Fix test_det_singular_matrix

* Expand tests for dpnp.linalg.qr with complex types

* Update examples

* Remove astype for output arrays

* Use empty_like instead of empty

* Use ht_list_ev with dpctl.SyclEvent.wait_for

* Add _triu_inplace func

* Use copy_usm for a_t array overwritten by geqrf/geqrf_batch

---------

Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com> 1e86753
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.

2 participants