Running out of memory, how to split up computation #125
-
I am running code similar to this IK example: When I query a small number of points <2000 curobo can solve the ik in a single call. I am looking to increase the number of ik samples I investigate but run out of memory. What would your suggestion be to work around memory limitations? I have looked into the batch parameter but it doesn't seem to be the solution. I have also written some manual batching code that looks at the factors of the ik query list size on the cpu and creates a set of smaller tensors that fit in gpu memory, and recombines the results again on the cpu. This feels overly complicated and dirty. Is there a way to do this batching natively? My searching on pytorch docs have not come up with anything. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I usually create a result buffer for the full batch size and then run a for loop over sub-batch-size, calling IK and filling the result in the result buffer. An example for a collision function: curobo/src/curobo/graph/graph_base.py Line 276 in c09d949 Not sure if this what you are asking. |
Beta Was this translation helpful? Give feedback.
-
I think that answers my question. This is the solution I have, although I still don't really like it:
I ran into a bug when trying this code but have done a pr for a fix: |
Beta Was this translation helpful? Give feedback.
I think that answers my question.
This is the solution I have, although I still don't really like it: