-
Notifications
You must be signed in to change notification settings - Fork 24.3k
torch.linalg.eigh fails on CPU #145801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It might be an error checking issue, as input tensor dimentions are way too high... |
The dimension of 8k by 8k should fine. Could that be an issue related to the fact that |
Simplified the example (and also realized one doesn't really need any specific weights) % python3 -c "import torch;x=torch.rand(7840);y=torch.linalg.eigh(torch.outer(x, x))" |
Smallest size it starts to fail is 2895 (on my Mac):
|
Error is coming from https://github.com/Reference-LAPACK/lapack/blob/a00531096fff76e49bfd86260885c32070b1afcd/SRC/ssyevd.f#L258 IF( LWORK.LT.LWMIN .AND. .NOT.LQUERY ) THEN
INFO = -8 |
Hmm, looks like when one uses query to get info about lwork, one need to upcast it by ULP as it is returned as floating point value. pytorch/aten/src/ATen/native/BatchLinearAlgebraKernel.cpp Lines 256 to 259 in cde5ddf
I.e. when query value is computed as integer value, but than returned back as float, it need to be rounded up by ULP. Adding debug prints shows
|
From SSYEVD documentation:
I.e. in query mode LWORK size is returned as floating point value, which sometimes if cast back to float results in a value smaller than the one needed, which resulted in error code -8 To file a bug against OpenBLAS, but in the meantime will workaround the issue by allocating larger array |
work-query APIs return floating point values, that could loose precision when converted back to int. Solve this by using `nextafter` and `ceil` Add regression test Fixes #145801 Pull Request resolved: #146456 Approved by: https://github.com/malfet
work-query APIs return floating point values, that could loose precision when converted back to int. Solve this by using `nextafter` and `ceil` Add regression test Fixes pytorch#145801 Pull Request resolved: pytorch#146456 Approved by: https://github.com/malfet
Uh oh!
There was an error while loading. Please reload this page.
🐛 Describe the bug
Based on this issue #94772 we see failure on CPU since PyTorch 2.4.0 Release.
Minumum test, requires fc_layer_tensor.pt.zip :
Output:
Full test
Versions
2.7.0
cc @ezyang @gchanan @zou3519 @kadeng @msaroufim @malfet @jianyuh @nikitaved @pearu @mruberry @walterddr @xwang233 @lezcano
The text was updated successfully, but these errors were encountered: