Fast Sparse Matrix expansion and population without converting to CoordinateFormat #1099
Unanswered
MissedSte4k
asked this question in
Q&A
Replies: 1 comment
-
Ok - took some more time and a lot of thinking, but I think I managed to solve my problem by basically recreating a something close to an expanded OfCompressedSparseColumnFormat() method.
Would love for someone to look at it and possibly add to the project |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have this problem I've been trying to solve for a while, maybe someone will have any ideas. I have massive SparseMatrix'es that I want to expand and populate the expanded parts. At first I tried doing expansion and population using
SetSubMatrix()
and SparseCompressedRowMatrixStorage.At(). The implementation worked until the size reached something around 50k x 50k. At that point the expansion by 1k took about 5min. I won't expand into all the tings and combinations I've tried to make this approach work, but the final approach after a lot of research I have managed to do is this:TLDR: convert entire matrix to Coordinate Format -> add all the new points -> create new SparseCompressedRowMatrixStorage from Coordinate format.
Using this approach I can currently expand 50k x 50k matrix by 1k in around 300ms. The problem I'm facing now, is due to all the walkarounds I'm basically 3x the memory usage, because I have oldMatrix, row/col/val[] and new Matrix. This doesn't impact the system too much at first, but when the matrix expands to 400k x 400k and the Data alone above - 4 GB of RAM by using this method I create a spike of about 12GB.
My question is - Is there any approach I could use to batch update/expand the SparseCompressedRowMatrixStorage using At() or any other function without forcing
NormalizeOrdering()
,NormalizeDuplicates()
or any other unnecessary functions, until all the items are added to the storage without using my RAM heavy workaround?Beta Was this translation helpful? Give feedback.
All reactions