Skip to content

Commit fd5c2cb

Browse files
committed
PR feedback: cuDSS cleanup, guard, schema version, docs, tests, GPU CI
Maintainer feedback on the cuDSS support: - Rebase cleanup: in cudss.cpp swap the transitive utils/iodata.hpp include for utils/labels.hpp, the header that actually defines the MatrixSymmetry / SymbolicFactorization types the file uses (include-what-you-use); drop the dead IoData forward-decl in cudss.hpp and the unused cudss.hpp include in waveportoperator.cpp; and document the intentionally-unused reorder argument in the CuDSSSolver constructor. - Consolidate the "not built with cuDSS" guard to a single config-time check in iodata.cpp (mirroring the SuperLU/STRUMPACK/MUMPS guards), and drop the redundant #else MFEM_ABORT from the ksp.cpp cuDSS case so it matches the empty-guarded MUMPS pattern. - Bump the configuration schema $id to 1-1-0 for the new "cuDSS" Solver.Linear.Type enum value: a new allowed enum value is a backward- compatible SchemaVer REVISION (required by scripts/check-schema-version). Tag the CHANGELOG entry with "SchemaVer 1-1-0" per the bump policy; the notes.md release table is intentionally left untouched (updated only at release time). - Document cuDSS in the install guide (build flag + spack example) and add unit tests: every Solver.Linear.Type value (incl. "cuDSS") validates against the schema, and Type="cuDSS" parses to LinearSolver::CUDSS when built with cuDSS. - Enable cuDSS in the GPU CI: build with +cuda+cudss and add a cuDSS entry to the GPU regression-test solver matrix.
1 parent ebc2555 commit fd5c2cb

11 files changed

Lines changed: 63 additions & 15 deletions

File tree

.github/workflows/spack.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- uses: ./.github/actions/palace-ci
6464
with:
6565
toolchain: gcc
66-
variant: +cuda
66+
variant: +cuda+cudss
6767
run-regression-tests: 'false'
6868

6969
build-x64-gcc-openmp:
@@ -177,13 +177,14 @@ jobs:
177177
- solver: SuperLU
178178
- solver: STRUMPACK
179179
- solver: Default
180+
- solver: cuDSS
180181
runs-on: [self-hosted, gpu-4xlarge]
181182
steps:
182183
- uses: actions/checkout@v6
183184
- uses: ./.github/actions/run-regression-tests
184185
with:
185186
toolchain: gcc
186-
variant: +cuda
187+
variant: +cuda+cudss
187188
linear-solver: ${{ matrix.solver }}
188189

189190
test-x64-gcc-openmp:

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ The format of this changelog is based on
1212
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
1313
[Semantic Versioning](https://semver.org/).
1414

15+
## [Unreleased]
16+
17+
#### New Features
18+
19+
- Added support for the [NVIDIA cuDSS](https://docs.nvidia.com/cuda/cudss/index.html)
20+
high-performance CUDA sparse direct solver, selectable via
21+
`config["Solver"]["Linear"]["Type"] = "cuDSS"` for the KSP and wave port solvers.
22+
Enable at build time with `PALACE_WITH_CUDSS=ON` (requires `PALACE_WITH_CUDA=ON`).
23+
SchemaVer 1-1-0 [PR 717](https://github.com/awslabs/palace/pull/717).
24+
1525
## [0.17.0] - 2026-06-28
1626

1727
#### New Features

docs/src/install.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ spack install palace
5454

5555
This will install the default version of *Palace*. Spack supports installing
5656
_variants_ of *Palace*. For instance, if you want to install *Palace* with CUDA,
57-
MUMPS and SLEPc, call
57+
MUMPS, SLEPc and the NVIDIA cuDSS GPU sparse direct solver, call
5858

5959
```bash
60-
spack install palace +mumps +slepc +cuda cuda_arch=90
60+
spack install palace +mumps +slepc +cuda +cudss cuda_arch=90
6161
```
6262

6363
where `cuda_arch` is determined by the [generation of your
@@ -192,6 +192,9 @@ Additional build options are (with default values in brackets):
192192
- `PALACE_WITH_SUPERLU [ON]` : Build with SuperLU_DIST sparse direct solver
193193
- `PALACE_WITH_STRUMPACK [OFF]` : Build with STRUMPACK sparse direct solver
194194
- `PALACE_WITH_MUMPS [OFF]` : Build with MUMPS sparse direct solver
195+
- `PALACE_WITH_CUDSS [OFF]` : Build with NVIDIA cuDSS sparse direct solver (requires
196+
`PALACE_WITH_CUDA=ON`; the cuDSS installation directory can be specified with
197+
`CUDSS_DIR`)
195198
- `PALACE_WITH_SLEPC [ON]` : Build with SLEPc eigenvalue solver
196199
- `PALACE_WITH_ARPACK [OFF]` : Build with ARPACK eigenvalue solver
197200
- `PALACE_WITH_LIBXSMM [ON]` : Build with LIBXSMM backend for libCEED
@@ -281,7 +284,9 @@ source code for these dependencies is downloaded during the build process:
281284

282285
For solving eigenvalue problems, at least one of SLEPc or ARPACK-NG must be specified.
283286
Typically only one of the SuperLU_DIST, STRUMPACK, and MUMPS dependencies is required but
284-
all can be built so the user can decide at runtime which solver to use.
287+
all can be built so the user can decide at runtime which solver to use. On CUDA builds, the
288+
NVIDIA cuDSS GPU-resident sparse direct solver is additionally available via
289+
`PALACE_WITH_CUDSS` (selected at runtime with `"Type": "cuDSS"`).
285290

286291
For unit testing, *Palace* relies on the [Catch2
287292
library](https://github.com/catchorg/Catch2), which is automatically downloaded

palace/linalg/cudss.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#if defined(MFEM_USE_CUDSS)
88

9-
#include "utils/iodata.hpp"
9+
#include "utils/labels.hpp"
1010

1111
namespace palace
1212
{
@@ -30,8 +30,11 @@ mfem::CuDSSSolver::MatType GetCuDSSMatType(MatrixSymmetry sym)
3030

3131
} // namespace
3232

33-
CuDSSSolver::CuDSSSolver(MPI_Comm comm, MatrixSymmetry sym, SymbolicFactorization reorder,
34-
bool reorder_reuse, int print)
33+
// cuDSS does not expose a reordering-strategy selection (it only supports reordering
34+
// reuse), so the SymbolicFactorization argument is accepted for interface parity with the
35+
// other direct solvers (see MakeWrapperSolver in ksp.cpp) but is intentionally unused.
36+
CuDSSSolver::CuDSSSolver(MPI_Comm comm, MatrixSymmetry sym,
37+
SymbolicFactorization /*reorder*/, bool reorder_reuse, int print)
3538
: mfem::CuDSSSolver(comm)
3639
{
3740
SetMatrixSymType(GetCuDSSMatType(sym));

palace/linalg/cudss.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
namespace palace
1515
{
1616

17-
class IoData;
18-
1917
//
2018
// A wrapper for cuDSS.
2119
//

palace/linalg/ksp.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@ ConfigurePreconditionerSolver(const config::LinearSolverData &linear,
196196
pc = MakeWrapperSolver<OperType, CuDSSSolver>(linear, comm, pc_mat_sym,
197197
linear.sym_factorization,
198198
linear.reorder_reuse, print);
199-
#else
200-
MFEM_ABORT(
201-
"Solver was not built with cuDSS support, please choose a different solver!");
202199
#endif
203200
break;
204201
case LinearSolver::DEFAULT:

palace/models/waveportoperator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "linalg/ams.hpp"
99
#include "linalg/arpack.hpp"
1010
#include "linalg/blockprecond.hpp"
11-
#include "linalg/cudss.hpp"
1211
#include "linalg/gmg.hpp"
1312
#include "linalg/hypre.hpp"
1413
#include "linalg/iterative.hpp"

palace/utils/iodata.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,10 @@ void IoData::CheckConfiguration()
593593
MFEM_VERIFY(solver.linear.type != LinearSolver::MUMPS,
594594
"Linear solver MUMPS requested but Palace was not built with MUMPS support!");
595595
#endif
596+
#if !defined(MFEM_USE_CUDSS)
597+
MFEM_VERIFY(solver.linear.type != LinearSolver::CUDSS,
598+
"Linear solver cuDSS requested but Palace was not built with cuDSS support!");
599+
#endif
596600

597601
// Configure settings for quadrature rules and partial assembly.
598602
BilinearForm::pa_order_threshold = solver.pa_order_threshold;

scripts/schema/config-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "urn:palace:schema:1-0-0",
3+
"$id": "urn:palace:schema:1-1-0",
44
"title": "Configuration File Schema",
55
"description": "Palace configuration file schema for 3D electromagnetic simulations.",
66
"type": "object",

test/unit/test-config.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,3 +1516,18 @@ TEST_CASE("ConcretizeDefaults", "[config][Serial]")
15161516
CHECK(mat_gaps.empty());
15171517
}
15181518
}
1519+
1520+
#if defined(MFEM_USE_CUDSS)
1521+
TEST_CASE("Linear solver Type cuDSS parses when built with cuDSS", "[config][Serial]")
1522+
{
1523+
// With cuDSS support built in, Solver.Linear.Type = "cuDSS" must parse to the
1524+
// CUDSS enum and not trip the "not built with cuDSS" configuration guard.
1525+
json config = {{"Problem", {{"Type", "Electrostatic"}, {"Output", "test_output"}}},
1526+
{"Model", {{"Mesh", "test.msh"}}},
1527+
{"Domains", {{"Materials", {{{"Attributes", {1}}}}}}},
1528+
{"Boundaries", json::object()},
1529+
{"Solver", {{"Linear", {{"Type", "cuDSS"}}}}}};
1530+
IoData iodata(config, false);
1531+
CHECK(iodata.solver.linear.type == LinearSolver::CUDSS);
1532+
}
1533+
#endif

0 commit comments

Comments
 (0)