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
There is an issue with beartyping that means that taking the determinant of a matrix with dimension larger than $1000\times 1000$ returns an error.
E.g. try the below code with dim=1000 and dim=1001. The bug exists regardless of whether the line Sigma = cola.PSD(Sigma) is included.
To reproduce
** Code snippet to reproduce **
importcolaimportcola.linalgimportjax.numpyasjnpimportjax.randomasjrfromjaximportconfigconfig.update("jax_enable_x64", True)
importjax.numpyasjnpimportjax.randomasjrdim=1001master_key=jr.key(0)
A=jr.normal(master_key, (dim, dim))
Sigma=A @ A.T# Ensure Sigma is PSDSigma+=0.1*jnp.eye(dim) # Ensure Sigma has strictly positive determinantSigma=cola.ops.Dense(Sigma) # Convert Sigma to a cola Dense objectSigma=cola.PSD(Sigma) # Tell cola that Sigma is PSDprint("Signed Log Determinant:")
print("-----------------------")
print("(jax.numpy)", jnp.linalg.slogdet(Sigma.to_dense()))
print("(cola)", cola.linalg.slogdet(Sigma))
** Stack trace/error message **
Signed Log Determinant:
-----------------------
(jax.numpy) SlogdetResult(sign=Array(1., dtype=float64), logabsdet=Array(5935.35245205, dtype=float64))
C:\Users\neelm\miniconda3\envs\gp\lib\site-packages\beartype\_util\hint\pep\utilpeptest.py:311: BeartypeDecorHintPep585DeprecationWarning: PEP 484 type hint typing.Callable deprecated by PEP 585. This hint is scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from "beartype.typing" rather than "typing". For further commentary and alternatives, see also:
https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations
warn(
🐛 Bug
There is an issue with beartyping that means that taking the determinant of a matrix with dimension larger than$1000\times 1000$ returns an error.
E.g. try the below code with
dim=1000
anddim=1001
. The bug exists regardless of whether the lineSigma = cola.PSD(Sigma)
is included.To reproduce
** Code snippet to reproduce **
** Stack trace/error message **
Expected Behavior
With
dim=1000
, I get expected behaviour:System information
CoLA Version: 0.0.5
JaX Version: 0.4.28
Computer OS: Windows 11 Home
Additional context
Could be related to #41 but it seems like a different error.
There also seem to be issues with accuracy of
cola.solve
for matrices larger than 1000 by 1000.The text was updated successfully, but these errors were encountered: