You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perm_row of a uniform LU batch reports batch member 1 only #92
What: getparam(solver, "perm_row") in src/solver.jl (the "perm_row" branch of getparam, structure "G", stage ≥ factorized) returns sp.perm[piv[1:n]], i.e. the reordering composed with the local row interchanges of batch member 1 only. In a uniform batch every member pivots independently and has its own row order, so members 2..nbatch get no perm_row. Every other per-member output ("info", "npivots", "inertia", "pivot_stats", "diag") is returned per member. The docstring table already says "batch member 1", so the behaviour is documented, but it differs from the other per-member outputs.
Why it is out of scope: T19 delivered LU with uniform batches; the per-member output shape is an API decision. It is not in TASKS.md and blocks no later task. Check what cuDSS returns for CUDSS_DATA_PERM_ROW on a uniform batch before deciding.
Suggested fix or plan change: either return an n × nbatch matrix for a batch (as "diag" concatenates members) and make getparam! accept it, or keep member 1 and state in the docstring that this is by design.
cuDSS 0.8.0 (CUDSS.jl 0.8, RTX 4080): a uniform LU batch of 3 members, dense 4×4 pattern, with members that need different row interchanges. Every vector parameter was queried with host and device buffers of n and of n·nbatch entries.
Query
Single matrix
Uniform batch, n buffer
Uniform batch, n·nbatch buffer
perm_row, perm_col
CUDSS_STATUS_NOT_SUPPORTED
NOT_SUPPORTED
INVALID_VALUE
perm_reorder_row
works
works (one shared vector)
INVALID_VALUE
diag
works
works: batch member 1 only (bit-identical to factoring member 1 alone)
INVALID_VALUE
cuDSS does not implement perm_row/perm_col at all, not even for a single matrix. CUDSS.jl's own tests skip cudss_get for both (test/test_cudss.jl). No MadNLP code that works with cuDSS today can depend on it.
On a uniform batch, cuDSS returns vector outputs for member 1 only and rejects a buffer of n·nbatch entries. Setting ubatch_index after the factorization does not change what diag returns.
Our "diag" differs from cuDSS: it returns all members one after the other (n·nbatch entries), where cuDSS returns member 1.
Decision
Keep member 1 for perm_row. It follows cuDSS's convention for batched vector outputs and needs no new output shape. An n × nbatch matrix would make perm_row the only output whose type depends on the batch size, and getparam! would then need matrix buffers. The docstring now says this is by design and names "diag" as the deliberate exception. If someone needs every member's row order later, a member keyword on getparam can add it without changing the default. Docstring PR follows.
Activity
Tests: split test_numeric_lu per element type; cite #92 in the T19 re…
michel2323 commentedon Oct 7, 2026
What cuDSS returns (measured)
cuDSS 0.8.0 (CUDSS.jl 0.8, RTX 4080): a uniform LU batch of 3 members, dense 4×4 pattern, with members that need different row interchanges. Every vector parameter was queried with host and device buffers of
nand ofn·nbatchentries.nbuffern·nbatchbufferperm_row,perm_colCUDSS_STATUS_NOT_SUPPORTEDNOT_SUPPORTEDINVALID_VALUEperm_reorder_rowINVALID_VALUEdiagINVALID_VALUEperm_row/perm_colat all, not even for a single matrix. CUDSS.jl's own tests skipcudss_getfor both (test/test_cudss.jl). No MadNLP code that works with cuDSS today can depend on it.n·nbatchentries. Settingubatch_indexafter the factorization does not change whatdiagreturns."diag"differs from cuDSS: it returns all members one after the other (n·nbatchentries), where cuDSS returns member 1.Decision
Keep member 1 for
perm_row. It follows cuDSS's convention for batched vector outputs and needs no new output shape. Ann × nbatchmatrix would makeperm_rowthe only output whose type depends on the batch size, andgetparam!would then need matrix buffers. The docstring now says this is by design and names"diag"as the deliberate exception. If someone needs every member's row order later, amemberkeyword ongetparamcan add it without changing the default. Docstring PR follows.Docs: perm_row of a uniform LU batch is member 1 by design (#92) (#94)
PLAN.md: refresh to the implemented design after T21 [skip ci]
PLAN.md: refresh to the implemented design after T21 [skip ci] (#99)