Context
BallisticLA/RandBLAS#163 adds SYMM-shaped kernels to RandBLAS so that symmetric matrices can be sketched from one stored triangle. After that PR, sketch_symmetric dispatches to blas::symm for a DenseSkOp and to a one-triangle COO scatter kernel for a SparseSkOp (Case B in the PR's table), and the new spsymm covers sparse symmetric matrices. The PR also changes the sketch_symmetric signature: the sym_check_tol trailing argument is replaced by blas::Uplo uplo, which names the stored triangle.
RandLAPACK currently works around the missing functionality. ExplicitSymLinOp's sparse-SkOp apply path (linops/rl_sym_linops.hh, on the funNystrom++ branches) calls RandBLAS::sparse_data::right_spmm, which reads A as a general dense matrix. That forces BOTH triangles of A to be populated and adds a symmetrize-before-construct precondition for matrices that generators fill upper-only.
What needs to change once the RandBLAS side merges
- Bump the RandBLAS submodule pin past the merge commit.
- In
ExplicitSymLinOp:
- thread
blas::Uplo uplo through the class and its sketch_symmetric-adjacent call sites (required by the signature change);
- switch the sparse-SkOp apply path from
right_spmm to RandBLAS::sketch_symmetric, which reads only the named triangle.
- Remove the both-triangles precondition and the callers' symmetrization steps that exist only to satisfy it.
- Audit any other
sketch_symmetric consumers for the signature change.
Why
- One-triangle storage end to end halves the memory footprint of a large explicit symmetric matrix. This is the funNystrom++ / Nystrom EVD use case; some target datasets (for example, large Gram or NTK matrices) are already distributed as a single triangle, so the fill step disappears entirely.
- The symmetrize precondition and its bug surface go away.
- Each sketch apply reads half of A.
Before switching the default
The Case B kernel is a hand-rolled per-nonzero scatter, while right_spmm on a fully stored A can route through MKL. Worth a quick benchmark on a funNystrom++-shaped problem (the spsymm_performance.cc example added in the RandBLAS PR covers the related comparisons) to confirm wall-clock parity. The memory argument stands regardless of the outcome.
Context
BallisticLA/RandBLAS#163 adds SYMM-shaped kernels to RandBLAS so that symmetric matrices can be sketched from one stored triangle. After that PR,
sketch_symmetricdispatches toblas::symmfor a DenseSkOp and to a one-triangle COO scatter kernel for a SparseSkOp (Case B in the PR's table), and the newspsymmcovers sparse symmetric matrices. The PR also changes thesketch_symmetricsignature: thesym_check_toltrailing argument is replaced byblas::Uplo uplo, which names the stored triangle.RandLAPACK currently works around the missing functionality.
ExplicitSymLinOp's sparse-SkOp apply path (linops/rl_sym_linops.hh, on the funNystrom++ branches) callsRandBLAS::sparse_data::right_spmm, which reads A as a general dense matrix. That forces BOTH triangles of A to be populated and adds a symmetrize-before-construct precondition for matrices that generators fill upper-only.What needs to change once the RandBLAS side merges
ExplicitSymLinOp:blas::Uplo uplothrough the class and itssketch_symmetric-adjacent call sites (required by the signature change);right_spmmtoRandBLAS::sketch_symmetric, which reads only the named triangle.sketch_symmetricconsumers for the signature change.Why
Before switching the default
The Case B kernel is a hand-rolled per-nonzero scatter, while
right_spmmon a fully stored A can route through MKL. Worth a quick benchmark on a funNystrom++-shaped problem (thespsymm_performance.ccexample added in the RandBLAS PR covers the related comparisons) to confirm wall-clock parity. The memory argument stands regardless of the outcome.