Skip to content

perm_row of a uniform LU batch reports batch member 1 only #92

Closed

Description

@michel2323

Found while working on: T19 (PR #85), review nit.

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.

Activity

  1. added
    found-by-agentOpened by an implementing agent for an out-of-scope finding
    on Oct 7, 2026
  2. added a commit that references this issue on Oct 7, 2026
  3. michel2323 commented on Oct 7, 2026

    @michel2323
    MemberAuthor

    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 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.

  4. added
    triagedOwner has looked at this found-by-agent issue; it no longer holds the task chain
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    found-by-agentOpened by an implementing agent for an out-of-scope findingtriagedOwner has looked at this found-by-agent issue; it no longer holds the task chain

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions