Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #392 +/- ##
==========================================
- Coverage 84.65% 84.53% -0.12%
==========================================
Files 38 38
Lines 9030 9048 +18
==========================================
+ Hits 7644 7649 +5
- Misses 1386 1399 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
CSR is the only cuSPARSE layout with a direct sparse solver behind it: cuDSS refuses CSC outright and cuSOLVER's sparse QR only takes CSR, so a CSC prototype leaves Krylov as the only option.
Each combination of eltype, prototype layout, solver and linsolve is one test line now, so the known-bad ones can be `@test_broken` instead of living in a comment. CUDSS joins the test environment: without it there is no direct sparse linear solve on the device at all.
hexaeder
marked this pull request as ready for review
October 14, 2026 15:25
The default BitSet is as wide as its largest index, so tracing the whole network
was quadratic in its size: 90 s at dim 2e5, 4 s with Set{Int}.
This comment has been minimized.
This comment has been minimized.
Contributor
Benchmark Resultshttps://github.com/JuliaDynamics/NetworkDynamics.jl/actions/runs/38615481256/artifacts/11924273504 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
End-to-end GPU solving
Gets from "the RHS evaluates on the GPU" to "you can
solvea network on the GPU".On this branch
adaptgives aCuSparseMatrixCSRJacobian prototype. CSR is the only layout with a directsparse solver on the device (cuDSS LU, cuSOLVER QR); CSC leaves only Krylov.
Network.jac_prototypeisRef{Union{Nothing,AbstractSparseMatrix}}, so it survivesadapt.abstolfollows the state eltype (1e-10 is out of reach in Float32), and atspaneltype that differs from the state warns.showfor device-backedNWState/NWParameterno longer scalar-indexes.SparseAggregatorwith dual numbers on the device goes through cuSPARSE instead of thegeneric matvec.
get_jac_prototypetraces withSet{Int}index sets. The defaultBitSetmade it quadraticin the network size (90 s → 4 s at 2·10⁵ states).
test/GPU_test.jlruns a list of solve configs and checks that DAE init really ran on thedevice. Buildkite skips the CPU-only sweeps.
Status
@test_broken, needs ForwardDiff #816Still open: component callbacks don't run on device networks, and the adapted
DiffCacheistoo small (warning on the first
get_tmp).Scaling
benchmark/gpu_scaling.jl: square lattice of swing and PQ buses (mass-matrix DAE, half of thestates algebraic), flat start, t ∈ [0, 5].
is about 5× faster than threaded CPU (4 s vs 21 s).
offloading the linear solve to cuDSS (
CudssOffloadLUin the script) is as fast at the topand faster below. It also works with callbacks, so it may be the more practical route
going forward.
an O(n²)
findallon the diagonal mass matrix during solver setup. Unpatched, the CPU needs210 s at 10⁵ vertices.