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
mat: calling qr.Factorize leads to OOM for matrixes with many rows #1968
Comments
Can you provide a minimal reproducer for testing and fix the link in the report please? Note also from the documentation that Q is m×m. |
I believe the issue arises when one tries to solve very large systems. The issue is introduced by this commit which explicitly computes and stores the The |
Minimal reproduction test: func TestReproduction(t *testing.T) {
const (
M = 100_000
N = 3
)
systemMat := mat.NewDense(M, N, make([]float64, M*N))
measurementsVec := mat.NewVecDense(M, make([]float64, M))
var results mat.VecDense
err := results.SolveVec(systemMat, measurementsVec)
fmt.Println(err)
} On version PS I've updated the link in original issue, thanks for pointing that out. |
Thanks. Yeah, for situations where the Q is not needed, this is a problem. I think we can get the performance benefit of the single pre-calculation by lazily calculating, but storing the value so the work is only done once. I'll take a look in the weekend. |
That would be great, thanks for the quick response! |
What are you trying to do?
After upgrading gonum to 0.15.0 calls to
(VecDense).SolveVec(a,b)
wherea.Dims() == (10k+, 3)
leads to OOM.The stack where OOM happens:
I've traced this down to changes in
mat.QR.updateQ
here.What
updateQ
does is allocate a newDense
with dimensionsMxM
, which for our value on M would mean allocating 100M cell matrix. Based on my understanding of the code, the resulting matrix should have dimensions (MxN
).What version of Go and Gonum are you using?
Does this issue reproduce with the current master?
Yes
The text was updated successfully, but these errors were encountered: