Skip to content

Move CUDA/CUDSS to weak deps and deduplicate GPU backend code - #596

Merged
michel2323 merged 15 commits into
masterfrom
ms/deduplicate
Mar 10, 2026
Merged

Move CUDA/CUDSS to weak deps and deduplicate GPU backend code#596
michel2323 merged 15 commits into
masterfrom
ms/deduplicate

Conversation

@michel2323

Copy link
Copy Markdown
Collaborator

@sshin23, I think this is what you asked for in #476. It makes CUDA also just an extension. I would then rebase the oneAPI PR on this.

@codecov

codecov Bot commented Mar 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.78125% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.31%. Comparing base (18a4459) to head (011184f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
lib/MadNLPGPU/src/KKT/gpu_qn.jl 0.00% 17 Missing ⚠️
src/LinearSolvers/lapack_common.jl 85.10% 7 Missing ⚠️
lib/MadNLPGPU/src/KKT/gpu_sparse.jl 92.50% 3 Missing ⚠️
lib/MadNLPGPU/src/KKT/gpu_dense.jl 81.81% 2 Missing ⚠️
src/LinearSolvers/lapack.jl 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #596      +/-   ##
==========================================
+ Coverage   84.16%   85.31%   +1.14%     
==========================================
  Files          52       49       -3     
  Lines        4680     4311     -369     
==========================================
- Hits         3939     3678     -261     
+ Misses        741      633     -108     

☔ View full report in Codecov by Sentry.
📢 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.

@michel2323
michel2323 marked this pull request as ready for review March 6, 2026 15:32
@michel2323

Copy link
Copy Markdown
Collaborator Author

Be aware of potential performance regression with CUDA that might have been introduced during generalization. If there's a benchmark I could run, let me know.

@michel2323

michel2323 commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator Author

@sshin23 Can we merge this? The only addition to base MadNLP is AbstractLAPACKSolver. The reduction in coverage comes from removing/deduplicating covered lines.

@sshin23 sshin23 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great. Thanks @michel2323 !

@michel2323
michel2323 merged commit 6cf9998 into master Mar 10, 2026
11 of 12 checks passed
CUDSS.cudss_set(solver, "deterministic_mode", 1)
end
if !isempty(opt.cudss_device_indices)
return if !isempty(opt.cudss_device_indices)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The return should be at the end of the function.

# `buffer` contains the diagonal of the factorized matrix.

if M.opt.cudss_algorithm == MadNLP.CHOLESKY
return if M.opt.cudss_algorithm == MadNLP.CHOLESKY

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do we have a return here?

@amontoison

Copy link
Copy Markdown
Member

Please do a minor release of MadNLP.jl and then a breaking one for MadNLPGPU.jl after that you merged the PR.

This was referenced May 19, 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.

3 participants