Skip to content

oneMKL: return LAPACK info from potrf!/getrf!/sytrf! through LinearAlgebra.LAPACK - #754

Open
michel2323 wants to merge 1 commit into
mainfrom
lapack-info
Open

michel2323 wants to merge 1 commit into
mainfrom
lapack-info

Conversation

@michel2323

Copy link
Copy Markdown
Member

LinearAlgebra.LAPACK.potrf!, getrf! and sytrf! on oneArrays returned A / (A, ipiv) instead of the stdlib shapes (A, info) / (A, ipiv, info). cholesky! and lu! destructure those shapes, so the following failed with a scalar-indexing error:

cholesky(Hermitian(oneArray(S)))
lu(oneArray(A))

getrf! also lacked the stdlib's check keyword, which lu! passes.

The support-library shims already return oneMKL's computation_error info, or -1 for a caught SYCL exception. The wrappers now keep it:

  • Internal _potrf!, _getrf! and _sytrf! return the info.
  • A SYCL failure (-1) throws instead of being ignored.
  • The LinearAlgebra.LAPACK overloads call the internal functions and return the stdlib shapes.
  • oneMKL.potrf!, getrf! and sytrf! keep their current return values, so this is not breaking.
  • The scratchpads are freed after the call.

Tests. The new tests in test/onemkl.jl check LAPACK info, cholesky and lu on oneArrays, and failing pivots against host LAPACK.

oneMKL bug. oneMKL 2026.1 on the Intel Data Center GPU Max reports the failing column of potrf relative to its 32-column panel. For example, column 50 comes back as 18 for real types and as 1042 for complex types. Columns 1 to 32 are correct. The shim forwards computation_error::info() unchanged, so the wrong value comes from oneMKL. The tests mark these cases @test_broken and check that the factor's diagonal still marks the true column, as LAPACK's potf2 does.

Tested on a Data Center GPU Max 1100 with oneAPI_Support_jll 0.11.0: the onemkl tests give 2,747 pass and 60 broken, including the 12 new broken cases.

…gebra.LAPACK

The `LinearAlgebra.LAPACK` overloads returned `A` (potrf!) and `(A, ipiv)`
(getrf!, sytrf!) instead of the stdlib shapes `(A, info)` and
`(A, ipiv, info)`. `cholesky!` and `lu!` destructure those, so
`cholesky(Hermitian(::oneArray))` and `lu(::oneArray)` failed with a
scalar-indexing error. `getrf!` also lacked the stdlib's `check` keyword.

The support-library shims already return oneMKL's `computation_error` info
(-1 for a caught SYCL exception). The wrappers now keep it: internal
`_potrf!`/`_getrf!`/`_sytrf!` return it, a SYCL failure throws, and the
LAPACK overloads use them. `oneMKL.potrf!`/`getrf!`/`sytrf!` keep their
return values. The scratchpads are freed after the call.

Tests: LAPACK info, `cholesky` and `lu` on oneArrays, failing pivots.
oneMKL 2026.1 on the Data Center GPU Max reports the failing column of
potrf relative to its 32-column panel (column 50 comes back as 18, or 1042
for complex types); those cases are `@test_broken`, and the test checks
that the factor's diagonal still marks column j.
@michel2323

Copy link
Copy Markdown
Member Author

The @test_broken cases track #755.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.62069% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.61%. Comparing base (2ec42dc) to head (240b7fc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/mkl/wrappers_lapack.jl 58.62% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #754      +/-   ##
==========================================
- Coverage   86.79%   86.61%   -0.19%     
==========================================
  Files          55       55              
  Lines        5068     5022      -46     
==========================================
- Hits         4399     4350      -49     
- Misses        669      672       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

1 participant