Repository navigation
Support type-2 and type-3 generalized Hermitian eigenproblems - #41197
copybara-service[bot] merged 1 commit into
Conversation
jakevdp
left a comment
There was a problem hiding this comment.
Looks pretty good, thanks! I think the math is solid – just a couple testing changes.
jakevdp
left a comment
There was a problem hiding this comment.
Looks good, thanks! Could you please squash the changes into a single commit?
|
I squashed the changes into a single commit, as requested. I also addressed the numerical test failures reported by CI: the float32/complex64 finite-difference step is now 1/128 without relaxing the gradient tolerances, and the TPU defining-equation residual allows 2e-5 instead of 1e-5 (the reported error was about 1.4e-5). The production implementation is unchanged. With 100 generated cases, the focused CPU tests pass with x64 off (111 passed) and on (163 passed); changed-file pre-commit checks pass. I have not rerun accelerator tests locally, so I am waiting for GPU/TPU CI to validate these adjustments. The earlier oneAPI build failure is in unchanged Triton/LLVM TableGen code, which appears separate from these Python changes. The workflows on the latest head are currently held for maintainer approval ( |
211ce8e to
7ae1ce0
Compare
7ae1ce0 to
c22ca60
Compare
|
CI update at the same single-commit head Two checks remain red:
These look separate from this change based on the failing paths and logs; I have not run a base/head reproduction of those two failures. Could the failed checks be rerun when convenient? I am keeping the numerical implementation and tolerances unchanged while the remaining checks are assessed. |
jax.scipy.linalg.eigh(a, b)currently rejectstype=2andtype=3. This follows up on #41162 by supportingA B v = w vandB A v = w vusing the existing Cholesky reduction and Hermitian eigensolver.For both new problem types, the reduced matrix is
Lᴴ A L, whereB = L Lᴴ. Eigenvectors are transformed back withL⁻ᴴfor type 2 andLfor type 3, preserving the correspondingBorB⁻¹normalization. This uses the standard LAPACK reduction; type 1 retains its existing implementation. The docstring describes all three problem types, and invalidtypevalues raiseValueError.Tests cover SciPy agreement, defining equations, eigenvector normalization, real and complex inputs, broadcasting, JIT, vmap, input symmetrization, invalid arguments, and non-positive-definite
B. Gradient coverage uses the existing forward/reverse finite-difference checks for all three problem types.Related to #5461.
Current validation after the review-requested cleanup and CI-directed test adjustments (CPU, Python 3.12.14, jaxlib 0.11.2, SciPy 1.18.1):
JAX_ENABLE_X64=falseandJAX_NUM_GENERATED_CASES=100: 111 passed, 0 skipped.JAX_ENABLE_X64=trueandJAX_NUM_GENERATED_CASES=100: 163 passed, 0 skipped.Earlier full-module and minimum-SciPy validation before the test-only cleanup (production implementation is unchanged):
JAX_ENABLE_X64=false python -m pytest -n 2 tests/linalg_test.py: 981 passed, 23 skipped.JAX_ENABLE_X64=true python -m pytest -n 2 tests/linalg_test.py: 1074 passed, 26 skipped.-k "GeneralizedEigh or EighType") with SciPy 1.15.0 / NumPy 2.2.6 andJAX_ENABLE_X64=false: 54 passed, 0 skipped.pre-commit run --files jax/_src/scipy/linalg.py tests/linalg_test.py: passed, including Ruff and Pyrefly.The all-files pre-commit run passes every hook except Jupytext, which reports an existing mismatch in the unchanged
docs/autodidax2_part1.py/.mdpair. I reproduced that failure on those files separately and verified that both match the base commit. GPU and TPU tests were not run.CI follow-up: the float32/complex64 finite-difference step is now
1/128, with gradient tolerances unchanged. The defining-equation residual tolerance is2e-5on TPU, following an observed1.4e-5residual in the type-1 broadcast case; other backends retain1e-5. Accelerator CI still needs to validate these test-only adjustments. The production implementation is unchanged.