Skip to content

refactor!: remove the CUDA and MAGMA linear solvers - #660

Draft
leonardocarreras wants to merge 2 commits into
sogno-platform:masterfrom
leonardocarreras:refactor/drop-cuda-solvers
Draft

refactor!: remove the CUDA and MAGMA linear solvers#660
leonardocarreras wants to merge 2 commits into
sogno-platform:masterfrom
leonardocarreras:refactor/drop-cuda-solvers

Conversation

@leonardocarreras

@leonardocarreras leonardocarreras commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Closes #164, closes #646.

Context: The GPU adapters are broken and no GitHub Actions job builds them.

Removes the three adapters, the MAGMA plugin and the CUDA enum values, and drops CUDA, MAGMA and cricket from the Rocky container. dpsimpy and the C++ examples build clean; the image was not rebuilt.

Signed-off-by: Leonardo Carreras <leonardo.carreras@eonerc.rwth-aachen.de>

@github-actions github-actions Bot 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.

DPsim LLM review

Claim vs. code: matches the description.

TL;DR: One low-confidence process-compliance issue was flagged in CODEOWNERS; no functional correctness, scaling, or scheduling problems were reported for the CUDA/MAGMA solver removal itself.

Found 1 medium (0 anchored to lines below).

🔵 Optional / low-confidence (1)
  • Missing SPDX header in CODEOWNERS [medium · 35% confidence · unconfirmed] in CODEOWNERS:1
Claim vs. implementation
  • Claimed: Remove the CUDA and MAGMA linear solvers, related build/config support, docs, and Rocky container GPU dependencies.
  • Done: Deletes the CUDA/MAGMA solver adapters, MAGMA plugin, enum and factory support, related CMake/config/docs/workflow references, and removes the MAGMA find module and code ownership entries.
  • Difference: none
How this review was produced

13 specialized finder passes raised 26 findings over the diff and the full changed sources. After de-duplication, 25 were re-checked against the current file and the base-class / interface headers it inherits (code as truth), escalating survivors to a stronger model: 24 refuted as unsupported, 1 kept (1 tentative).

Refuted by verification:

  • Remove unused CUDA and MAGMA find_package calls (CMakeLists.txt): The current file has find_package(GSL) at line 144, not CUDA or MAGMA, and the CUDA/MAGMA calls were removed in the diff.
  • Remove non-portable CUDA build workaround (CMakeLists.txt): Line 29 is FETCH_PYBIND, and there is no CUDA workaround block in the current file.
  • Update solver implementation table in documentation (docs/hugo/content/en/docs/Developer Guide/Solvers/alternative-solvers.md): The current table lists only KLU, SparseLU, DenseLU, and Plugin; no CUDA adapter rows remain.
  • Remove unused enum values from DirectLinearSolverImpl (dpsim/include/dpsim/MNASolverDirect.h): The enum on line 39 now contains only Undef, KLU, SparseLU, DenseLU, and Plugin; the CUDA values are not present in the full file.
  • Remove unused includes for GPU adapters (dpsim/include/dpsim/MNASolverDirect.h): The removed GPU include block is absent from the current header, so there is no lingering include of GpuDenseAdapter.h, GpuSparseAdapter.h, or GpuMagmaAdapter.h.
  • Remove dead case labels for GPU adapters in createDirectSolverImplementation (dpsim/src/MNASolverDirect.cpp): The current switch only has DenseLU, SparseLU, and KLU cases; the CUDA case labels are absent from the full source.
  • Remove dead CUDA option references from feature summary (CMakeLists.txt): The feature summary section no longer contains WITH_CUDA; line 268 is add_feature_info(KLU WITH_KLU ...).
  • Remove outdated CUDA references from documentation (docs/hugo/content/en/docs/Developer Guide/Solvers/alternative-solvers.md): The alert text now ends with “depends entirely on how DPsim was configured.” and no longer mentions CUDA builds.
  • Remove outdated note about GPU adapters in documentation (docs/hugo/content/en/docs/Developer Guide/Solvers/alternative-solvers.md): The alert block contains no GPU adapter references in the current source.
  • Replace noisy INFO log with DEBUG in stampVariableSystemMatrix (dpsim/src/MNASolverDirect.cpp): The INFO log at line 71 is present in the current file and is an intentional status message in stampVariableSystemMatrix.
  • Replace noisy INFO log with DEBUG in stampVariableSystemMatrix (dpsim/src/MNASolverDirect.cpp): The INFO log at line 80 is present in the current file and logs the base matrix during matrix stamping.
  • Remove WITH_CUDA and WITH_MAGMA from dpsim Config.h.in (dpsim/include/dpsim/Config.h.in): The current file no longer contains WITH_CUDA, WITH_CUDA_SPARSE, or WITH_MAGMA; only WITH_PYBIND is on line 25.
  • Remove WITH_CUDA and WITH_MAGMA from dpsim-villas Config.h.in (dpsim-villas/include/dpsim-villas/Config.h.in): The current file no longer contains WITH_CUDA, WITH_CUDA_SPARSE, or WITH_MAGMA; line 15 is WITH_PYBIND instead.
  • Remove WITH_CUDA_SPARSE option that is no longer referenced (CMakeLists.txt): WITH_CUDA_SPARSE does not appear anywhere in the current file.
  • Update note about GPU adapters in solver documentation (docs/hugo/content/en/docs/Developer Guide/Solvers/alternative-solvers.md): The note about build configuration is generic and does not mention removed GPU backends.

Automated, non-blocking review. May be wrong. Models: find mistral-small-4-119b-2603, gpt-oss-120b → verify gpt-5.4-mini → final gpt-5.5.

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.70%. Comparing base (9900538) to head (7ddea02).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #660      +/-   ##
==========================================
- Coverage   72.84%   72.70%   -0.15%     
==========================================
  Files         512      512              
  Lines       33068    33179     +111     
  Branches    17880    17929      +49     
==========================================
+ Hits        24090    24124      +34     
- Misses       8910     9054     +144     
+ Partials       68        1      -67     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Signed-off-by: Leonardo Carreras <leonardo.carreras@eonerc.rwth-aachen.de>
@leonardocarreras
leonardocarreras marked this pull request as draft August 10, 2026 08:11
@leonardocarreras

Copy link
Copy Markdown
Contributor Author

Hi @n-eiling, hi @fwege, would this set of changes be okay for you?

We would appreciate your input, or heads-up about your plans or any comment. Of the people I know, you are the most familiar with the GPU work in the software.

Other points:

  • if you are using the GPU solvers and plan to update it, we are happy to keep them and drop this PR.
  • we could keep things like dependencies (for example cricket) if they are needed for any other purpose.

I keep it as draft for the moment.

@leonardocarreras leonardocarreras added this to the v2: Breaking changes milestone Aug 24, 2026
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.

GPU - CUDA and DPsim: delete Linear solvers using CUDA do not work or yield wrong results

1 participant