Skip to content

Expose ILU0 numeric boost configuration for CUDA and HIP - #466

Open
kakeueda wants to merge 5 commits into
developfrom
kakeru/add-setter-boost
Open

Expose ILU0 numeric boost configuration for CUDA and HIP#466
kakeueda wants to merge 5 commits into
developfrom
kakeru/add-setter-boost

Conversation

@kakeueda

@kakeueda kakeueda commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Description

The numeric boost tolerance and value in the CUDA ILU0 solver are hard-coded to 1e-6. This PR makes them configurable through the existing setCliParam() interface.

To see the effect of these values I tested the solver with FIDAP012 from the NIST Matrix Market, a nonsymmetric linear system arising from a fluid dynamics problem

./build/examples/sysGmres.exe \
  -m ~/tmp/matrixmarket/fidap012.mtx \
  -r ~/tmp/matrixmarket/fidap012_rhs1.mtx \
  -b cuda \
  -i fgmres

The number of iterations changed as follows:

Boost value Number of FGMRES iterations Final relative residual
1e-6 1121 9.9392e-13
1e-7 143 9.2850e-13
1e-8 143 9.2850e-13

Some problems are sensitive to this value.

Proposed changes

  • Added a zero_diagonal parameter to the CPU ILU0 solver through the existing setCliParam() interface.
  • Added boost_tolerance and boost_value parameters to the CUDA/HIP ILU0 solvers through the existing setCliParam() interface.
  • Added SystemSolver::getPreconditionerSolver() so users can configure ILU0 numerical stabilization parameters through SystemSolver.
  • Updated testSysGmres and MatrixFactorizationTests to configure ILU0 parameters.
  • Fixed misplaced entries in CHANGELOG.md.

Checklist

  • All tests pass (make test and make test_install per testing instructions). Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • I have manually run the non-experimental examples and verified that residuals are close to machine precision. (In your build directory run: ./examples/<your_example>.exe -h to get instructions how to run examples). Code tested on:
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows Re::Solve style guidelines.
  • [N/A] There are unit tests for the new code.
  • The new code is documented.
  • [N/A] The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

@kakeueda

kakeueda commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

I’d appreciate any help with HIP testing

@tamar-dewilde tamar-dewilde left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on HIP. All 64 tests and install validation passed.

Comment thread resolve/SystemSolver.hpp

LinSolverDirect& getFactorizationSolver();
LinSolverDirect& getRefactorizationSolver();
LinSolverDirect& getPreconditionerSolver();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says this getter lets users configure the numeric boost through SystemSolver. How should users call setZeroDiagonal() through it? The getter returns LinSolverDirect&, which does not declare that method, so the direct call does not compile.

I could only call the setter by including LinSolverDirectCuSparseILU0.hpp and casting the returned solver to that concrete type. Is that the intended use, or should LinSolverDirect provide a common way to access this setting? LinSolverDirectCpuILU0 already has the same setter.

@kakeueda kakeueda Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing this out! I added the BOOST_TOLERANCE and BOOST_VALUE parameter IDs and the corresponding cli param settings so users can now configure the numeric boost through SystemSolver rather than casting it to a concrete type.

I also implemented numeric boost support for HIP since it was needed for the configuration test added to testSysGmres.cpp.

Can you test this again on HIP?

@kakeueda kakeueda changed the title Expose CUDA ILU0 boost configuration Expose ILU0 numeric boost configuration for CUDA and HIP Aug 7, 2026
@kakeueda

kakeueda commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

One remaining inconsistency is that CPU ILU0 still uses zero_diagonal for both the zero-pivot threshold and replacement value. Separating them also requires changing CPU ILU0’s numerical behavior. I left it out of this PR.

@kakeueda
kakeueda requested a review from tamar-dewilde August 7, 2026 12:28
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.

2 participants