Skip to content

Fix complex GMRES inner products - #378

Open
2002WYT wants to merge 1 commit into
NVIDIA:mainfrom
2002WYT:fix/complex-gmres-inner-product
Open

Fix complex GMRES inner products#378
2002WYT wants to merge 1 commit into
NVIDIA:mainfrom
2002WYT:fix/complex-gmres-inner-product

Conversation

@2002WYT

@2002WYT 2002WYT commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Fix the complex-valued inner products used by device code and GMRES Arnoldi orthogonalization.

Fixes #377

Root cause

The device implementation of dotc(...) in src/blas.cu calls Cublas::dot(...).

For complex double precision, this maps to the unconjugated cublasZdotu, while dotc(x, y) is expected to compute the Hermitian inner product x^H y.

After restoring the correct dotc semantics, the GMRES Modified Gram-Schmidt projection also needs its arguments swapped. The current expression computes w^H v_k, whereas Arnoldi orthogonalization requires v_k^H w.

Changes

  • Use Cublas::dotc(...) in the two device implementations of dotc(...).
  • Change the GMRES projection argument order from dot(w, v_k) to dot(v_k, w).

Testing

Tested using the 3x3 complex reproducer from #377 with:

  • AMGX mode: dZZI
  • GMRES restart: 10
  • No preconditioner
  • Same matrix, RHS, initial guess, and solver configuration

Results:

Original v2.5.0 Patched
Total iterations 500 3
Final residual 2.955383e-05 4.981581e-16
Status Did not converge Converged

The same reproducer was also tested after applying the patch to the current main branch.

Full reproduction details and logs are available in #377.

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.

[Issue] Device dotc uses unconjugated cuBLAS dotu and breaks complex GMRES orthogonalization

1 participant