Skip to content

Add cuDSS support via mfem::CuDSSSolver#717

Draft
Pennycook wants to merge 4 commits into
awslabs:mainfrom
Pennycook:cudss
Draft

Add cuDSS support via mfem::CuDSSSolver#717
Pennycook wants to merge 4 commits into
awslabs:mainfrom
Pennycook:cudss

Conversation

@Pennycook

Copy link
Copy Markdown

cuDSS is a high-performance CUDA library for Direct Sparse Solvers.

This commit enables the use of cuDSS in Palace by:

  • Wrapping mfem::CuDSSSolver in a new palace::CuDSSSolver;
  • Enabling the use of CuDSSSolver for KSP and WavePort; and
  • Adding cuDSS configuration options to CMake, for both Palace and MFEM.

I've opened this as a draft for now because it depends on mfem/mfem#5124, which has not yet been merged.

An example of building with cuDSS:

cmake .. -DPALACE_WITH_CUDA=ON -DPALACE_WITH_CUDSS=ON -DCUDSS_DIR="/path/to/cudss/"

cuDSS is a high-performance CUDA library for Direct Sparse Solvers.

This commit enables the use of cuDSS in Palace by:
- Wrapping mfem::CuDSSSolver in a new palace::CuDSSSolver;
- Enabling the use of CuDSSSolver for KSP and WavePort; and
- Adding cuDSS configuration options to CMake, for both Palace and MFEM.
The patch adding cuDSS to mfem has not yet been merged.
This patch has been merged into MFEM. The changes are already included in the
version of MFEM required for cuDSS, and so the patch no longer applies cleanly.
@Pennycook

Copy link
Copy Markdown
Author

I fixed the formatting, but I'm not sure what to do about the other failures.

The license check is failing because the test assumes the header will match exactly, but I added a new copyright line to two files. One possible solution would be to rewrite the test to check for the copyright notice and SPDX license identifier separately, but I think that's outside the scope of this PR.

I think the other tests are failing because they're using the Spack route of installation, which I didn't update. It's not obvious to me that there's a way to make this work, besides waiting for the mfem Spack package to expose cuDSS support.

@hughcars hughcars 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.

We'll take this for a spin, one small comment on the patching process but generally looks good.

set(EXTERN_MFEM_GIT_TAG
"d9d6526cc1749980a2ba1da16e2c1ca1e07d82ec" CACHE STRING
"e217864f168acb1d7bdb3fd7c5aa73ef81951237" CACHE STRING
"Git tag for external MFEM build"

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.

For a POC this will work, but we have a facility for assembling patches for MFEM into palace. If we don't want to wait for the minor version bump in mfem (no idea when that'll be), the facility would be to assemble the patch for just the mfem PR, plucked onto our "palace head" state of mfem, which is 4.9 + the patch stack. This is a bit involved, so if you want I can do this for you (it's best achieved using spack nowadays).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, please, that would be very helpful. I only intended that commit to be temporary.

It probably still makes sense to wait for things to be merged into mfem as they are, before you assemble the patch -- I don't expect that the PR will change before it's merged, but I can't rule it out either.

@hughcars hughcars 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.

Hi @Pennycook,

I took a stab at cleaning things up as mentioned in the comments and there's a draft PR onto your fork at Pennycook#1. Most of that is noise from merging origin/main into your branch. If you merge into your fork it'll reduce down to a much smaller diff. The main thing was assembling the diffs.

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