-
Notifications
You must be signed in to change notification settings - Fork 99
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
Suprisingly high memory requirements in LU factorization #50
Comments
This doesn't make sense. Can you send more diagnostic info? Number of nonzeros in the matrix? What does the output look like in the successful execution of 2x27x66 ? Can you recompile the code with PRNTlevel=1, that prints more info. |
Number of nonzeros: 73586988
Enabling symmetric mode gives the exact same error. For a smaller matrix e.g. 28666 I get
and then proceeds to run without issue. Actually, on closer reading of the armadillo docs I can actually directly diagonalise around smallest magnitude with arpack ("sm" mode), rather than doing a shift with superlu. Unfortunately, "sm" is significantly slower than arpack+superlu, and doesn't reliably converge (i.e. I have to play with number of eigenvalues to return and max number of iterations, which is annoying because ahead of time there's no way to know what values will work). So there's still value in figuring out what's going on here. thanks! |
I believe I've figured this out. If I look closely at one of my problematic matrices I find that The numbers given here are obviously unique to my matrices, but problematic values arise for various combinations of matrix size and densities, which is why I can reproduce this issue for random matrices. Actually, this is probably the same issue as in #24 . The easy solution is to upgrade nzlumax to a There may be a more robust approach. For example, we could add a -DLONG_INT compile flag which controls a typedef like I'm happy to do a pull request with a more complete fix, based on above or similar. cheers |
That is a good diagnosis. Thanks for sharing this. This int_t approach is not implemented in serial superlu. It may take some effort to do this, because this needs to be done for all the compressed sparse storages, for both matrix A and and {L,U} (particularly needed). In their meta data structures, whenever 'number of nonzeros' is involved, the variables need to be 'int_t'. Perhaps you can take a look at superlu_mt code. |
Thanks for the suggestions. I've started working on this, but it will take some time to get working properly. Also, armadillo doesn't define int_t quite correctly so I'll have to coordinate with them; it may be that SciPy and other projects have a similar issue but I haven't checked. |
Thanks for the update. I think SuperLU_MT code is a good reference to look
at. (Or SuperLU_DIST code)
Sherry
…On Mon, Sep 20, 2021 at 11:51 PM MonkeysAreEvil ***@***.***> wrote:
Thanks for the suggestions. I've started working on this, but it will take
some time to get working properly. int_t is already used most everywhere
sensible, and it's straightforward to add -Denable_longint to the
CMakeLists. Updating *memory and *gstrtf functions has also been
straightforward. Unfortunately, a lot of utility/plumbing code implicitly
uses int32 so I'm stuck in a lot of fiddly work. In particular I'm seeing
some strange memory and performance issues so it will take a little while
to all sort out.
Also, armadillo doesn't define int_t quite correctly so I'll have to
coordinate with them; it may be that SciPy and other projects have a
similar issue but I haven't checked.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZSV53VZV4EVAGFHLNZOMLUDATO3ANCNFSM473Q2PGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Yes, see scipy/scipy#15688 |
Hi,
I'm using armadillo to do eigendecomposition on some sparse matrices. armadillo uses SuperLU and ARPACK for this.
In particular, for the matrices I'm interested in, armadillo uses zgstrf, zgstrs, and ZNAUPD (ARPACK). I'm hitting 'Not enough memory' errors for what I would consider not especially large matrices. In particular, a small increase in matrix size requires a huge increase in memory usage.
Tracing the execution, the error happens in zgstrf.c:255. I can generate random matrices of the same size and around the same density and reliably hit the same problem. I'm guessing the fill-in is somehow related, but I don't really understand the algorithms involved.
For example, for a (2x27x666)x(2x27x666) matrix I can diagonalise comfortably with <32G of memory. Jumping to (2x28x666)x(2x28x666) requires >256G of memory; with 256G of memory I hit a 'Not enough memory' error, from zgstrf. I have access to more memory but it seems pointless to push until I know why the memory usage suddenly explodes for this small size increase.
I'm not sure if this is actually a bug, or known behaviour. I'm open to suggestions on what's going on.
Notes:
The text was updated successfully, but these errors were encountered: