GPU assembly support on AMD and CUDA - #7042
Conversation
d3c8416 to
60c8298
Compare
There was a problem hiding this comment.
Pull request overview
This PR extracts and wires up GPU matrix assembly/linearization support for Flow (CUDA + HIP/AMD), building on prior GPU POC work, and introduces GPU-oriented model/problem shims plus supporting GPU ISTL utilities.
Changes:
- Add GPU TPFA linearization/assembly path with supporting GPU data transfers (intensive quantities, boundary info, residual/Jacobian buffers).
- Introduce simplified GPU-friendly model/problem wrappers used by the GPU assembly kernels.
- Extend GPU ISTL utilities (typed diagonal block pointers; GpuView access changes) and update build system to compile a
flow_gpuvariant.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/gpuistl/test_GpuSparseTable.cu | Extends kernel test to validate SparseTable::dataSize() usage on device. |
| opm/simulators/linalg/gpuistl/GpuView.hpp | Adjusts operator[] to return const T&; adds an extra include. |
| opm/simulators/linalg/gpuistl/detail/gpusparse_matrix_operations.hpp | Declares typed diagonal block pointer extraction API. |
| opm/simulators/linalg/gpuistl/detail/gpusparse_matrix_operations.cu | Implements getDiagPtrsTyped() and instantiates for MiniMatrix block sizes. |
| opm/simulators/flow/Transmissibility.hpp | Adds accessor for thermal boundary half-transmissibility map. |
| opm/simulators/flow/Transmissibility_impl.hpp | Implements new transmissibility map accessor. |
| opm/simulators/flow/SimplifiedGpuBlackOilModel.hpp | Adds simplified FI black-oil model wrapper and GPU copy/view helpers. |
| opm/simulators/flow/SimplifiedFlowProblemGPU.hpp | Adds simplified GPU problem wrapper for boundary thermal transmissibility (alpha) + module params. |
| opm/simulators/flow/NewTranFluxModule.hpp | Generalizes pressure-diff calculation template to accept alternative module params type. |
| opm/simulators/flow/FlowProblem.hpp | Exposes thermalLawManager() accessor. |
| opm/simulators/aquifers/BlackoilAquiferModel.hpp | Disables SupportsFaceTag include (commented). |
| opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp | Disables grid SupportsFaceTag static_assert (commented). |
| opm/models/discretization/common/tpfalinearizer.hh | Major: adds GPU assembly path (domain/neighbor/boundary transfers, kernels, GPU Jacobian/residual handling). |
| opm/models/discretization/common/fvbaseproperties.hh | Introduces to_gpu_type(_t) mapping and a GpuFIBlackOilModel property hook. |
| opm/models/discretization/common/fvbasediscretization.hh | Adds helpers to fetch all cached IQs (timeIdx 0/1) and a numDof() accessor. |
| opm/models/blackoil/blackoillocalresidualtpfa.hh | Refactors boundary flux handling for GPU/non-static fluid system; adds GPU-related helpers. |
| opm/models/blackoil/blackoilintensivequantities.hh | Adjusts assignment for host/device; adds GPU-switch constructors; changes withOtherFluidSystem() to accept a pointer. |
| opm/models/blackoil/blackoilextbomodules.hh | Replaces a raw throw with OPM_THROW. |
| opm/models/blackoil/blackoildiffusionmodule.hh | Adds accessors for diffusion/tortuosity arrays; marks update as host/device. |
| opm/models/blackoil/blackoilconvectivemixingmodule.hh | Minor fluid-system index usage adjustments; adds a fluidsystem include. |
| flow/flow_gpu.hpp | Adds GPU flow typetag mapping and declarations shared between CUDA/HIP entrypoints. |
| flow/flow_gpu.hip | Adds HIP entrypoint implementation for GPU flow variant. |
| flow/flow_gpu.cu | Adds CUDA entrypoint implementation for GPU flow variant. |
| flow/flow_gpu_main.cpp | Adds standalone main for flow_gpu binary. |
| CMakeLists.txt | Adds gpu Flow model variant and selects .cu/.hip source accordingly. |
| CMakeLists_files.cmake | Adds per-file CUDA flags for new GPU sources and installs new public headers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9b6e313 to
c87cfc5
Compare
|
jenkins build this rocm hipify please |
1 similar comment
|
jenkins build this rocm hipify please |
cf63b1d to
00cda7b
Compare
|
jenkins build this rocm hipify please |
97e819e to
31504de
Compare
|
jenkins build this rocm hipify please |
2 similar comments
|
jenkins build this rocm hipify please |
|
jenkins build this rocm hipify please |
5119d1b to
e2008b5
Compare
|
jenkins build this rocm hipify please |
652c705 to
6df49d5
Compare
|
jenkins build this rocm hipify please |
1 similar comment
|
jenkins build this rocm hipify please |
73fa1a4 to
f5b497e
Compare
|
jenkins build this rocm hipify please |
1 similar comment
|
jenkins build this rocm hipify please |
72bf73f to
ca54eb8
Compare
|
Tests now pass after reverting a small and recent change in OPM/opm-common#5200 |
f810144 to
9a3a4f5
Compare
9a3a4f5 to
5900098
Compare
|
jenkins build this rocm hipify please |
atgeirr
left a comment
There was a problem hiding this comment.
This has been a lot of work, but I think we have reached the point where it can be merged when green!
The GPU assembly support extracted from #7018
Still contains more code than necessary from that branch to support the assembly, but the goal is to reduce this PR to be as small as possible yet support the new GPU linearization.