sparsax.set_options

sparsax.set_options(*, supernodal=None, on_failure=None, ordering=None)[source]

Configure sparsax for this process. An option left out keeps its value.

Parameters:
supernodal=None

"auto" (CHOLMOD decides, the initial value), "simplicial" (faster triangular solves on very sparse matrices), or "supernodal" (BLAS-based, faster factorization on denser problems). Clears the factorization cache so the setting applies to all patterns.

on_failure=None

what a factorization that fails on the numbers does, in every backend and in the PyTensor frontend: the matrix is not positive definite, or it is singular, or a value is not finite. "raise" (the initial value) raises an error, which aborts the whole computation, vmap batch included. "nan" returns NaN for the failed element and leaves the others alone, so a sampler can reject the proposal and its other chains carry on: gradients and tokens from a failed factorization are NaN too. Other errors, such as bad arguments or a stale token, always raise. It takes effect at once, in functions already compiled, and leaves the caches alone.

ordering=None

the fill-reducing ordering behind CHOLMOD’s analysis. "auto" (the initial value) lets CHOLMOD try AMD and turn to METIS when AMD’s fill looks poor. "amd", "metis" and "nesdis" use that ordering, and "best" tries all three and keeps the cheapest. Only the speed changes, never the answers. Clears the factorization cache, like supernodal. KLU and UMFPACK keep their own orderings.