Warp pathwise gradients are different in reproduction of code #898
Unanswered
DINHQuangDung1999
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@eric-heiden @mmacklin can probably provide additional information, but contact handling in Warp is not deterministic unless you take additional care in ensuring that the contacts are stored and processed in a stable order that's not changing from run to run due to how threads on a GPU complete at different speeds. Also, whenever you see an atomic reduction involving floating point numbers, this will also generally be non-deterministic. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working on an algorithm, and I am trying it out with the Bounce task. I notice that every time I run the optimization code, I receive the gradient values that is slightly different, leading to a potentially completely different loss trajectory and convergence. I wonder if this is a sort of numerical error due to using float32, or is there anything more structured and related to the gradient computing mechanism of Warp. I attach my code below. To run the code, move inside the extracted folder and run
You can switch between the values for
grad_type
in theconf_multicontact.yaml
config file.Update 1: As soon as i comment out the collision handling
wp.collide
inside the simulation loop, the gradient is consistent.Can you help me explain this behavior?
Update 2: In the previous experiment, I intentionally put the wall above the particle at a low altitude and give the particle a large enough upward initial velocity so that it makes a number of contacts before reaching the target. However, when I return to the original bounce experiment (which have only 1-2 contacts), the pathwise gradient is stable. Does the number of contact have a relationship to the non-deterministic property of the contact handling function?
Update 3: Additional experiments were carried out. Notably, reducing the task horizon make the gradient stable.
bounce_exp.zip
Beta Was this translation helpful? Give feedback.
All reactions