[FEATURE] Improve robustness of differentiable rigid body simulation. - #2842
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2dcd8e8adf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
2dcd8e8 to
e1f7058
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1f7058f7b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
4ef2127 to
094464b
Compare
|
any updates on this PR? I'm currently looking into diff RL with the Franka Emika Panda, but with the current main branch, the slide joint / prismatic joint is producing NaN gradients. This branch works for me, so I'm looking forward to it being finalized and merged. |
|
@pschoc There is no plan to merge this PR at the moment. The maintenance burden is too high for the benefits. We need to improve autodiff support on Quadrants side. |
e94e3ed to
94f2572
Compare
09f7e84 to
a4bdc70
Compare
|
@duburcqa alright, thanks for the clarification |
|
@pschoc Actually I changed my mind. It is not as bad as I thought after cleanup, and coverage is solid, so I will merge after finishing cleaning up. |
|
@duburcqa awesome! Really looking forward 🚀 |
9e7e35c to
d394b54
Compare
…branches & add standalone replay kernels for backward pass
…nd drop the unused acc_bw buffer.
…the backward-pass style.
…ly test helpers under tests/grad, and skip the unsupported Metal gradient path.
d394b54 to
e65a442
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e65a442804
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ard and the norm-squared denominator term in the quaternion transform adjoint.
…le on Apple Metal, which has no fp64 tensor support.
Description
This PR improves the robustness of the differentiable rigid body simulation, and add in-depth unit tests to guarantee the differentiability in various scenarios. This PR is necessary to solve optimization problems that leverage the differentiability of the rigid body simulation.
Motivation and Context
Previously, the backward pass of rigid body simulation was brittle, and there was not enough unit tests that verify the backward pass in diverse scenarios. Because of that, several edge cases in the backward pass were not caught and they silently failed downstream applications that leverage the differentiability.
How Has This Been / Can This Be Tested?
To test the differentiability of the rigid body simulation, expanded the unit tests in the existing
test_grad.pyand split them into the 4 different files as shown below.Each of these tests cover:
test_grad_fd.py: Contains unit tests for verifying the correctness of the (analytical) gradients from the backward pass by comparing them with the gradients that we estimate from finite difference method. We test under various topology (e.g. cartpole, hopper, etc.) to catch as much edge cases as possible. It tests not only for the single step, but also gradients over multiple steps. Also, it tests under various constraint scenarios, such as joint limit or collision.test_grad_optim.py: Contains unit tests that optimize a certain loss value by optimizing input values (e.g. velocity, force). These tests serve as the proxy for the downstream optimization tasks based on differentiability.test_grad_utils.py: Check utility functions that are used for the backward pass. For now, there is a single test that verifies if thebackwardfunction of theSceneworks as expected.test_grad_mpm.py: Unlike other tests that check rigid body simulation, this file contains tests for MPM solver.Checklist:
Submitting Code Changessection of CONTRIBUTING document.