Skip to content

Update mkl_lapack::batch_error handling in getrf_batch / getri_batch #2458

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

Merged
merged 14 commits into from
May 19, 2025

Conversation

vlad-perevezentsev
Copy link
Collaborator

@vlad-perevezentsev vlad-perevezentsev commented May 19, 2025

This PR suggests improvements to the handling of oneapi::mkl::lapack::batch_error in oneapi::mkl::lapack::getrf_batch and oneapi::mkl::lapack::getri_batch

OneMKL batched functions throw a single oneapi::mkl::lapack::batch_error interpreted as computation_error for all failed matrices (ids()). Now set dev_info[...] = 1 for each to determinate singular matrix.

This change allows a consistent raising of LinAlgError in dpnp.linalg.inv() for both non-batched and batched singular matrices and unskipping tests with singular matrices for dpnp.linalg.inv() , dpnp.linalg.det, dpnp.linalg.slogdet

  • 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@vlad-perevezentsev vlad-perevezentsev changed the title Update mkl_lapacl::batch_error handling in getrf_batch / getri_batch Update mkl_lapack::batch_error handling in getrf_batch / getri_batch May 19, 2025
Copy link
Contributor

github-actions bot commented May 19, 2025

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

Copy link
Contributor

github-actions bot commented May 19, 2025

Array API standard conformance tests for dpnp=0.18.0dev3=py312he4f9c94_17 ran successfully.
Passed: 1231
Failed: 0
Skipped: 9

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 71.757%. remained the same
when pulling 3dc2164 on handle_batch_error_mkl
into 55deb00 on master.

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.

LGTM! Thank you @vlad-perevezentsev

@vlad-perevezentsev vlad-perevezentsev merged commit 56ccf86 into master May 19, 2025
64 of 68 checks passed
@vlad-perevezentsev vlad-perevezentsev deleted the handle_batch_error_mkl branch May 19, 2025 21:36
github-actions bot added a commit that referenced this pull request May 19, 2025
…atch` (#2458)

This PR suggests improvements to the handling of
`oneapi::mkl::lapack::batch_error` in `oneapi::mkl::lapack::getrf_batch`
and `oneapi::mkl::lapack::getri_batch`

OneMKL batched functions throw a single
`oneapi::mkl::lapack::batch_error` interpreted as computation_error for
all failed matrices (ids()). Now set dev_info[...] = 1 for each to
determinate singular matrix.

This change allows a consistent raising of `LinAlgError` in
`dpnp.linalg.inv()` for both non-batched and batched singular matrices
and unskipping tests with singular matrices for `dpnp.linalg.inv()` ,
`dpnp.linalg.det`, `dpnp.linalg.slogdet` 56ccf86
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