Skip to content

GPU Properties POC - #7018

Open
multitalentloes wants to merge 8 commits into
OPM:masterfrom
multitalentloes:full_gpu_sim_v1
Open

multitalentloes wants to merge 8 commits into
OPM:masterfrom
multitalentloes:full_gpu_sim_v1

Conversation

@multitalentloes

Copy link
Copy Markdown
Member

New PR including work on GPU property computation that takes over for #6612.

This PR currently contains the code needed to run properties and matrix assembly for SPE11 cases (Gas+Water+Thermal) on the GPU, the two main components of a basic non-linear solver besides the linear solver which is already implemented.

My plan is to extract parts of the diff gradually in smaller PRs to get it merged.

Marked as irrelevant for the manual as this should be further improved upon and validated to be robust, as well as supporting a broader set of cases first.

@multitalentloes multitalentloes added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Apr 29, 2026
This was referenced Apr 29, 2026
@multitalentloes
multitalentloes force-pushed the full_gpu_sim_v1 branch 2 times, most recently from 7a1a612 to 249dca8 Compare May 6, 2026 08:33
@multitalentloes
multitalentloes force-pushed the full_gpu_sim_v1 branch 2 times, most recently from 039d722 to 9635597 Compare June 5, 2026 08:26
kjetilly and others added 2 commits August 6, 2026 09:58
misc improvements

move files

remove unused code

support nv and amd gpus simultaneously
also remove some dead comments

rename gpu version of fvbaseelementcontext

deduplicate code in compiled files

minor fix

GPU assembly support on AMD and CUDA

restructure and format
reduce tpfalinearizer diff with new headerfiles
improve template argument orders
use less template arguments
clang-format new files and tpfalinearizer
ensure compilation on CPU without warnings
rename files and structs
avoid extra BOIQ copy in kernel
avoid extra BOIQ copy in getter
extract source terms to separate header

Co-authored-by: Atgeirr Flø Rasmussen <atgeirr.rasmussen@sintef.no>

improve GPU assembly implementation
update gpusparsematrix test

create new tpfalinearizerstructs file
extract what must be visible from both gpuparams
and tpfalinearizer itself

remove unused function and move comment to correct place

remove unused code

Simpler and renamed accessor.

protect flow_gpu_main from being compiled on all systems

use references instead of ptr

improve boiq ctor pattern

make refs const refs

improve bc computation and change cmake

simplify copy_to_gpu and remove alugrid from .cu

reduce diff & add extra dune undef

fix formatting in newtranfluxmodule

make preprocessor statements more precise
if you have cuda but do not wish to use the gpu assembly
then stuff was included that did not make sense, that is
hopefully now resolved

fix rebasing issues

remove nullfvbaseelementcontext.hh

improve cmake structure

remove timing code in IQ dispatcher

remove more timing code and implement simplifcations

remove extra test file

make linearize access safer
extra if check makes norne work locally

add includes

remove dead line of code

make test compilable w hipcc

change default, add tests

update tests

remove unneeded decorator
use uniqueptr more
update docs
simplify test docs
@multitalentloes
multitalentloes marked this pull request as ready for review August 10, 2026 13:09
@kjetilly
kjetilly requested a balanced review from Copilot September 12, 2026 06:32
@kjetilly

Copy link
Copy Markdown
Contributor

jenkins build this serial rocm hipify please

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The current integration breaks default CUDA CO2STORE updates and can produce stale or incorrect rock-property values.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds an experimental CUDA path for GPU-based thermal gas-water property evaluation and intensive-quantity computation.

Changes:

  • Adds GPU-compatible Flow problem, TypeTags, and dispatcher.
  • Integrates opt-in GPU property computation into FIBlackOilModel.
  • Adds CUDA tests and build registration.
File summaries
File Description
CMakeLists.txt Registers CUDA compilation and tests.
CMakeLists_files.cmake Adds new sources and public headers.
opm/models/blackoil/blackoilintensivequantities.hh Adds GPU-to-CPU field overlay.
opm/simulators/flow/FIBlackoilModel.hpp Routes intensive-quantity updates to GPU.
opm/simulators/flow/FlowProblemParameters.cpp Registers the experimental option.
opm/simulators/flow/FlowProblemParameters.hpp Defines the option default.
opm/simulators/flow/GpuFlowProblem.hpp Implements GPU-compatible problem state.
opm/simulators/linalg/gpuistl/GpuBlackoilIntensiveQuantitiesDispatcher.cu Implements GPU dispatch and transfer logic.
opm/simulators/linalg/gpuistl/GpuBlackoilIntensiveQuantitiesDispatcher.hpp Declares dispatcher API and support traits.
opm/simulators/linalg/gpuistl/GpuFlowGasWaterEnergyTypeTags.hpp Defines GPU-specific TypeTags.
tests/gpuistl/test_blackoilintensivequantities_gpu.cu Tests GPU intensive quantities and dispatch.
tests/gpuistl/test_gpu_ecl_thermal_law_manager.cu Tests GPU thermal-law evaluation.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 6
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread opm/simulators/flow/FIBlackoilModel.hpp Outdated
Comment thread opm/simulators/flow/GpuFlowProblem.hpp
Comment thread opm/simulators/flow/GpuFlowProblem.hpp
Comment thread opm/simulators/linalg/gpuistl/GpuBlackoilIntensiveQuantitiesDispatcher.cu Outdated
Comment on lines +1024 to +1027
const std::string deckPath = "/workspaces/opm/thecaseiwant/deck/THECASEIWANT.DATA";
if (!std::filesystem::exists(deckPath)) {
BOOST_TEST_MESSAGE("Skipping: deck not found at " << deckPath);
return;
@multitalentloes multitalentloes changed the title GPU Simulation POC GPU Properties POC Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants