Skip to content

Conversation

@Tanisha-Sharma005
Copy link

Preallocates contact memory before heightfield collision loop to prevent OOM crashes during batch training.

Changes:

  • Added preallocation: data.contacts.allocate(max_contacts * 1.5)
  • Conservative estimate: ncollision_in[0] * MJ_MAXCONPAIR * 2
  • 50% headroom buffer

Tested: No more OOM with batch_size=64

Before: OOM crash in collision_convex.py
After: Stable batch training

Closes #926

Closes google-deepmind#926

- Preallocate data.contacts before heightfield collision loop
- 50% buffer for dynamic collision counts (ncollision_in[0] * MJ_MAXCONPAIR * 2)
- Prevents OOM during batch training with large batch_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OOM in convex_narrowphase and memory pre-allocation in Data

1 participant