-
Notifications
You must be signed in to change notification settings - Fork 49
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
Potential issue in sparseL
: number of nonzero elements seems incorrect
#807
Comments
sparseL
sparseL
: number of nonzero elements seems incorrect
@dmbates am I missing something here? |
If you look at A[3,3] and L[3,3] (these are the logical positions, the actual positions are A[6] and L[6]), the diagonal blocks corresponding to the I sent you a link to a Google Collab notebook that shows these non-zeros about the diagonal. I'm a little surprised to see that the difference in the number of non-zeros is 17; I can only account for 14. |
The other three vestigial non-zeros above the diagonal are in |
so this is a bug right? If so, I do have an implementation of |
But the count from the current If it was important we could add code to zero out the elements above the diagonal in the diagonal blocks that are stored as dense matrices but I don't see that as a priority. |
oh sorry. I read it the other way round. |
So just to recap: the count in |
If the blocks on the diagonal of L were of type I feel that as long as we provide |
sounds good. In that case i will just close this issue. |
One final note here: some of the alternative storage formats we've considered would make this discrepancy go away (by only storing the lower triangle) or make this problem worse (by densely storing everything, as the internal 3-block L functionality does). While making it worse seems bad, it may actually be useful when it comes to move parts of the evaluation to the GPU. See also #789 I've been thinking about how to apply some of the lessons I learned from refactoring to support multiple optimizers to a potential refactoring supporting different storage backends, but I haven't yet a chance to spend the time on the code yet. |
Perhaps this should be a comment for #789 but I don't think that the 3-block L approach will be viable for models fit to large data sets with multiple, partially crossed grouping factors, say like the ml-32m example. The current fully-blocked version uses 6 blocks in L of the form Diagonal with the last row of blocks having only 2 rows. However the L[2,1] block is of size 80,000 by 200,000 and it is not practical to store and manipulate it as a dense matrix. It is possible to append the third row of blocks to the second row of blocks, resulting in a 3-block representation, but I think that is all that can be expected in the way of simplifications. Usually the most time-consuming step is "downdating" L[2,2] after L[2,1] is evaluated and that is simply because you need to form products of q_1 sparse vectors of length q_2 with themselves. |
What are the 3 blocks in the 3block L? |
For something like the ml-32m model the sizes of the 6 blocks are
The 3-block representation would append the rows of L[3,1] to L[2,1] and the L[3,2] and L[3,3] blocks to L[2,2] resulting in
My point in the earlier comment is that you still need to use a sparse representation for L[2,1] because it is only about 0.2% non-zeros. As a dense matrix it would be nearly 120 GiB in size and evaluating L[2,1] * L[2,1]' would be a formidable task, even on a GPU. |
Do you want to use that in place of the right hand panel in the current Figure 2? I think it might help to relate to Table 2. |
Wrong thread but let me check how I can do that without making it look asymmetric
|
I noticed that the number of non zero elements in
sparseL
does not match the sum of number of non-zero elements in the individual components ofL
.Here's an example:
Am I missing something?
The text was updated successfully, but these errors were encountered: