Replies: 1 comment
-
It sounds like implementing the incremental |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I am not sure how to best phrase this, but I am having an issue balancing memory usage of a large, but basic, matrix calculations. For an example, suppose I have the following basic function:
This will have a very large memory footprint, due to the intermediary vector of size 10^6. This isn't a concern when running with a single b, but I need to run a computation like this many thousands of times. I have a suspicion this method is not making the best use of the hardware, being memory bottle necked. We could make the memory footprint smaller by implementing this as a scan, and then finding a good balance between how much of the matrix to compute in each batch. I would imagine this is a common pattern, that is taking some associative, commutative, operator of a large vector, so perhaps others have found a good way to tackle such a situation.
My particular instance isn't exactly this, instead being a large array look-up, similar to as follows:
I think the same principles apply, but this example is harder to follow. One call is extremely fast (~10^-3 s), even when vmapping to fill the 40Gb of memory. If anyone has any thoughts, it would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions