Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an ordering for cuDSS #317

Merged
merged 3 commits into from
Apr 15, 2024
Merged

Add an ordering for cuDSS #317

merged 3 commits into from
Apr 15, 2024

Conversation

amontoison
Copy link
Contributor

Copy link
Member

@sshin23 sshin23 left a comment

Choose a reason for hiding this comment

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

Thanks, @amontoison! I only have small comments

lib/MadNLPGPU/src/cudss.jl Outdated Show resolved Hide resolved
@amontoison
Copy link
Contributor Author

@sshin23 How can I test this new option with the following tests:
https://github.com/MadNLP/MadNLP.jl/blob/master/lib/MadNLPGPU/test/madnlpgpu_test.jl#L4-L8
?

@sshin23
Copy link
Member

sshin23 commented Apr 5, 2024

It can be done by adding

    [
        "LapackGPU-CUSOLVERRF",
        ()->MadNLP.Optimizer(
            linear_solver=MadNLPGPU.CUDSSSolver,
            print_level=MadNLP.ERROR
            ordering=MadNLPGPU.METIS
        ),
        [],
    ],

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.80%. Comparing base (fcbbbda) to head (30c493c).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #317   +/-   ##
=======================================
  Coverage   69.80%   69.80%           
=======================================
  Files          39       39           
  Lines        3888     3888           
=======================================
  Hits         2714     2714           
  Misses       1174     1174           

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

@amontoison
Copy link
Contributor Author

We have a segmentation fault with cuDSS if we provide our own permutation... :(

@sshin23
Copy link
Member

sshin23 commented Apr 6, 2024

Hmm... maybe1-based indexing is causing an issue again? If it is possible to turn off the ordering, manual ordering is always an option.

https://github.com/MadNLP/MadNLP.jl/blob/master/lib/MadNLPGPU/src/cusolverrf.jl#L237-L252

@amontoison
Copy link
Contributor Author

Hmm... maybe1-based indexing is causing an issue again? If it is possible to turn off the ordering, manual ordering is always an option.

https://github.com/MadNLP/MadNLP.jl/blob/master/lib/MadNLPGPU/src/cusolverrf.jl#L237-L252

cuDSS uses METIS internally but we want to compare the linear solvers on CPU / GPU with the same ordering.
The goal of this PR is to provide a permutation determined outside cuDSS.

@sshin23
Copy link
Member

sshin23 commented Apr 6, 2024

Right. That can be implemented by turning off the ordering from the CUDSS side (if possible) and manually reordering the matrix before sending it to CUDSS, based on whatever ordering method we want to apply

@amontoison
Copy link
Contributor Author

Right. That can be implemented by turning off the ordering from the CUDSS side (if possible) and manually reordering the matrix before sending it to CUDSS, based on whatever ordering method we want to apply

We can't turn off the ordering with the version 0.1.0 or 0.2.0. I will send an email to ask this feature for the next release.

@amontoison amontoison force-pushed the cudss_ordering branch 2 times, most recently from aec3bc3 to 1ed792a Compare April 15, 2024 14:10
@amontoison
Copy link
Contributor Author

@sshin23 @frapac
The issue was that SparseMatrixCSC was not exported, so AMD/METIS were not called, and the permutation was Cint[]. CUDSS didn't like this permutation, and due to the segmentation fault, the error related to SparseMatrixCSC was not displayed...

Copy link
Member

@sshin23 sshin23 left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks @amontoison for the contribution. I'll merge it once the naming is fixed

lib/MadNLPGPU/src/cudss.jl Outdated Show resolved Hide resolved
lib/MadNLPGPU/test/madnlpgpu_test.jl Outdated Show resolved Hide resolved
@sshin23 sshin23 merged commit bfcebae into MadNLP:master Apr 15, 2024
6 checks passed
@amontoison amontoison deleted the cudss_ordering branch April 15, 2024 21:28
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