[Bug] cholesky singular U
See original GitHub issueπ Bug
To reproduce
I followed the directions here for a variational GP (https://gpytorch.readthedocs.io/en/latest/examples/05_Scalable_GP_Regression_Multidimensional/SVGP_Regression_CUDA.html#Overview) with the HEAD build of gpytorch and it trains for a while and then crashes withβ¦
** Stack trace/error message **
File "main.py", line 93, in <module>
pred = model(x)ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | 999/1088 [00:42<00:02, 31.22it/s]
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/models/approximate_gp.py", line 56, in __call__
return self.variational_strategy(inputs, prior=prior)
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/variational/whitened_variational_strategy.py", line 240, in __call__
return Module.__call__(self, x)
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/module.py", line 24, in __call__
outputs = self.forward(*inputs, **kwargs)
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/variational/whitened_variational_strategy.py", line 141, in forward
induc_induc_covar = CholLazyTensor(induc_induc_covar.cholesky())
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/lazy/lazy_tensor.py", line 738, in cholesky
res = self._cholesky()
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/utils/memoize.py", line 34, in g
add_to_cache(self, cache_name, method(self, *args, **kwargs))
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/lazy/lazy_tensor.py", line 413, in _cholesky
cholesky = psd_safe_cholesky(evaluated_mat).contiguous()
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/utils/cholesky.py", line 39, in psd_safe_cholesky
raise e
File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch-0.3.6-py3.7.egg/gpytorch/utils/cholesky.py", line 22, in psd_safe_cholesky
L = torch.cholesky(A, upper=upper, out=out)
RuntimeError: cholesky_cpu: U(1,1) is zero, singular U.
Expected Behavior
Iβm not sure why it is running into a singular matrix there, as I would expect that case to be covered.
System information
Please complete the following information: 0.3.6 - cd1c8f8 1.2.0 Ubuntu
Additional context
Additionally, I get a cuda OOM error every time I try to call .to(device)
using gpytorch, even with minimal data, which is strange.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Error Cholesky CPU - PyTorch Forums
RuntimeError: cholesky_cpu: U(135,135) is zero, singular U. It looks like this is a know bug β see the following two github issues:.
Read more >RuntimeError during Cholesky Decomposition - Misc.
RuntimeError: cholesky_cpu: U(65,65) is zero, singular U. I have looked around a bit to see how to deal with this problem and have...
Read more >Detecting singular system during Cholesky resolution
I am solving small linear systems with a symmetric positive matrix by the method of Cholesky, without pivoting. "Bad" matrices are detected whenΒ ......
Read more >Cholesky decomposition - Wikipedia
is a decomposition of a Hermitian, positive-definite matrix into the product of a lower triangular matrix and its conjugate transpose, which is useful...
Read more >Cholesky Decomposition - an overview ... - ScienceDirect.com
Form the Cholesky decomposition Uβ²U=R, where U is the matrix of factor loadings ... digits when computing A T A. It may even...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@deltaskelta - this may or may not correct the issue, but can you replace
WhitenedVariationalStrategy
withVariationalStrategy
? The examples for variational inference need some updating (to come soon).Also @Balandat Iβm putting up a quick PR to give better NaN warnings in
psd_safe_cholesky
.Thanks for the info!