For the 1×1 input 3+4i, ArmPL’s LAPACKE_zgeqrf returns success but leaves R=3+4i and tau=0. This is a valid QR factorization, but it differs from reference LAPACK’s real-diagonal convention. Is this difference intentional? It affects downstream code, including PyTorch’s complex QR derivative (`torch.linalg.qr` forward gradients disagree with finite differences for complex128 on Windows ARM64 with ArmPL · Issue #206869 · pytorch/pytorch), that relies on that convention.
3+4i
LAPACKE_zgeqrf
R=3+4i
tau=0
Minimal repro using native ARM64 Python and the official Windows installer DLL; no NumPy or PyTorch required:
import ctypes as c lib = c.CDLL(r"C:\Program Files\Arm Performance Libraries\armpl_26.07\bin\armpl_lp64.dll") z = c.c_double * 2 # One complex double: real and imaginary parts. a, tau = z(3, 4), z() info = lib.LAPACKE_zgeqrf(102, 1, 1, a, 1, tau) print(info, complex(*a), complex(*tau))
Observed: 0 (3+4j) 0j
0 (3+4j) 0j
Reference behavior: R=-5+0j, tau=1.6+0.8j. ArmPL’s own zlarfg_ returns those values when called directly on the same scalar. The question is not whether R should be positive or negative, but whether its diagonal should be real.
R=-5+0j
tau=1.6+0.8j
zlarfg_
R
github.com/.../zgeqrf.f
Hi there,
Many thanks for reporting this and for providing a reproducer. We are planning to include the fix in the next release of ArmPL so that our QR factorization functions match reference LAPACK's convention for these inputs.
In the meantime the fix is available in the open-source perf-libs-linalg library, as part of this commit. We would welcome any feedback.
Regards,
Nick
Thanks! do we have a prerelease of ArmPL dll / lib? so I could include into torch and try
I'm very sorry but we currently have no plans to issue a prerelease build of ArmPL. We are currently planning to make our next main release in January 2027.