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

linsys solver using hipsparse #293

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

kalmarek
Copy link
Contributor

This is just a proof of concept of how far can I push the idea of "instruct chatGPT to write software for me", hip-edition ;) Made only possible by the amazing design and the documentation of scs. Thanks @bodono!

At the moment this

  • compiles with make DLONG=0 USE_OPENMP=1 hip, after the adjustments of necessary paths in scs.mk,
  • unfortunately it still doesn't run as expected:
./out/demo_socp_hip 100      
seed : 1728819068

A is 400 by 100, with 10 nonzeros per column.
A has 1000 nonzeros (2.500000% dense).
Nonzeros of A take 0.000007 GB of storage.
Row idxs of A take 0.000004 GB of storage.
Col ptrs of A take 0.000000 GB of storage.

ScsCone information:
Zero cone rows: 40
LP cone rows: 120
Number of second-order cones: 8, covering 240 rows, with sizes
[20, 34, 14, 51, 22, 31, 1, 67, ]
Number of rows covered is 400 out of 400.

true pri opt = 0.816196
true dua opt = 0.816196
------------------------------------------------------------------
               SCS v3.2.7 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 100, constraints m: 400
cones:    z: primal zero / dual free vars: 40
          l: linear vars: 120
          q: soc vars: 240, qsize: 8
settings: eps_abs: 1.0e-04, eps_rel: 1.0e-04, eps_infeas: 1.0e-07
          alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
          max_iters: 100000, normalize: 1, rho_x: 1.00e-06
          acceleration_lookback: 10, acceleration_interval: 10
          compiled with openmp parallelization enabled
lin-sys:  hipsparse-direct
          nnz(A): 1000, nnz(P): 0
Error in init -- bufferSize: 10.
Error in init -- analysis: 10.
Error in init -- numeric fact: 10.
Error in factorisation: 10.
ERROR: init_lin_sys_work failure
Failure:could not initialize work
true pri opt = 0.816196
true dua opt = 0.816196
scs pri obj=  nan
scs dua obj = -nan

since hipsparseDcsrsv2_bufferSize refuses to compute the buffer size with HIPSPARSE_STATUS_NOT_SUPPORTED(10), which most probably is related to kkt matrix being symmetric. I've asked about this here:
ROCm/hipSPARSE#541

@bodono
Copy link
Member

bodono commented Oct 16, 2024

Oh cool! Thanks for looking into this, it would be great to get this in. Happy to take a look once you have it ready.

@kalmarek
Copy link
Contributor Author

it seems that rocsparse doesn't support symmetric matrices at the moment.

@bodono
Copy link
Member

bodono commented Oct 17, 2024

That's a shame, I presume it's because we only store the lower triangular part? If so we could always fill in the upper triangular part, but we would lose some efficiency.

@kalmarek
Copy link
Contributor Author

but also they lack the integration of pivoting etc. I think this is a bit premature, but I'll try something else, given my motivation recently ;)

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.

2 participants