sparsax.set_lu_cache_size

sparsax.set_lu_cache_size(n)[source]

Set how many KLU numeric factors are retained per sparsity pattern.

The LU factor cache is content-addressed on the COO values. For a vmapped factor-once-solve-many sweep to reuse each chain’s factorization across the several solves (rather than refactor on every call), the cache must hold at least as many factors as the vmap batch size (number of chains). Default 32.