- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to solve a batch of (square) linear systems using the compact/interleaved QR factorization routine, mkl_?geqrf_compact. However, I am struggling to find the documented "compact" way to complete the linear system solve AX=B using the QR factorization. The matrices I'm interested in have a strange structure, meaning that the non-pivoting LU factorization is not applicable.
In standard LAPACK, I would use dormqr to compute Q^T B and then dtrsm for the back-substitution R X = (Q^T B).
Additionally, are there any technical white papers or articles (for instance, in Intel Parallel Universe Magazine) that provide a deep dive into the Compact/Interleaved solver suite?
Thank in advance for any advice.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any chance this could be part of the oneMKL 2026.0 release?
Essentially, what I'd need is similar to the ArmPL function,
or in MKL API, this would be
- mkl_?ormqr_compact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ivanp
Thanks for submitting this request. We’ve tracked this request in our internal systems so it can be reviewed as part of our regular planning process. Given other higher‑priority items, this feature has not been planned for near-term implementation yet.
In the meantime, if you have a Priority Support account, you may also submit questions through our Priority Support channel at https://supporttickets.intel.com/ for faster response on technical issues and product-related inquiries.
Regards,
Chao Y.
Intel MKL Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Meanwhile, I have generated my own implemention of the compact ?ormqr routine using Claude Code. The code can be found here: https://github.com/ivan-pi/cqr
I ran a benchmark on Sapphire Rapids for a batch of 10000 matrices across different sizes obtaining the following results:
~/cqr> ./build/bench_qr_compact 10000 3
QR solve throughput: compact batched (mkl_dgeqrf_compact -> cqr_mkl_dormqr_compact -> mkl_dtrsm_compact)
vs per-matrix (LAPACKE_dgeqrf -> LAPACKE_dormqr -> cblas_dtrsm)
matrices=10000 reps=3 simdlen=8 (AVX512) OpenMP threads=1
n | batched (s) Mmat/s | unbatched (s) Mmat/s | speedup | max fwd err
-----+----------------------+----------------------+---------+-------------
10 | 0.0017 5.76 | 0.0167 0.60 | 9.60x | 1.78e-15 (rtol 2.2e-13)
20 | 0.0066 1.52 | 0.0409 0.24 | 6.22x | 2.44e-15 (rtol 4.4e-13)
30 | 0.0194 0.52 | 0.0647 0.15 | 3.34x | 3.11e-15 (rtol 6.7e-13)
40 | 0.0488 0.20 | 0.0980 0.10 | 2.01x | 3.55e-15 (rtol 8.9e-13)
50 | 0.0975 0.10 | 0.1838 0.05 | 1.88x | 3.33e-15 (rtol 1.1e-12)
60 | 0.1712 0.06 | 0.2544 0.04 | 1.49x | 4.44e-15 (rtol 1.3e-12)
80 | 0.4141 0.02 | 0.4821 0.02 | 1.16x | 5.55e-15 (rtol 1.8e-12)
100 | 0.8086 0.01 | 0.9542 0.01 | 1.18x | 4.55e-15 (rtol 2.2e-12)
-----+----------------------+----------------------+---------+-------------
geometric-mean speedup (batched vs unbatched) across sizes: 2.50xTo get an impression of the relative costs of dgeqrf_compact, dormqr_compact and dtrsm_compact, versus the non-compact variants, I have sampled the execution of the benchmark with perf (sampling at 999 Hz and last branch records for the callgraph). The generated flamegraph is shown below; the compact routines are shaded in pink:
The compact dormqr routine is a small fraction of the total samples. The non-compact version (LAPACKE_dormqr) accounted for 9.47 % of the samples, compared to 0.56 % for the compact version.
It is nice to see that the compact/batched approach pays off.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page