Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Leverage Casadi JIT compilation #480

Open
duburcqa opened this issue Jan 25, 2022 · 1 comment
Open

[python] Leverage Casadi JIT compilation #480

duburcqa opened this issue Jan 25, 2022 · 1 comment
Labels

Comments

@duburcqa
Copy link
Owner

duburcqa commented Jan 25, 2022

It is possible to speedup simulation by pre-compiling computationally intensive loops. For C++ core, the main bottlenecks are related to the contact solver, namely the decomposition of the mass matrix and the projected gauss seidel algorithm. Precompilation is not going to help much in this cases. However, it could be very helpful to speed-up reinforcement learning pipeline where many basic operators and pinocchio functions are chained together. It would not only totally remove the overhead of intermediary function calls, but also speed-up computation by taking advantage of the given model's kinematic tree. What is still unclear is in what extend it casadi symbolics can be mixed with the robot model exposed by the simulator. The trivial implementation would consists in compiling standalone algorithms that requires proving the current state of the simulator systematically. It is unlikely to increase much the computational cost as only forward kinematics in going to be involved, which is fairly cheap to evaluate, in particular if the computation graph is simplified at compile time to remove irrelevant branches. This feature is only available with pinocchio>=2.9.0, which may require some refactoring of Jiminy to support it.

Here is an example of what can be done using casadi in python.

@duburcqa duburcqa added enhancement New feature or request gym new feature P1 Mid priority issue python labels Jan 25, 2022
@duburcqa duburcqa removed the enhancement New feature or request label May 1, 2022
@duburcqa
Copy link
Owner Author

In principale, i should make jiminy/pinocchio code jit-able with JAX as a side effect, which is a tremendous advantage.

@duburcqa duburcqa added P2 Low priority issue and removed P1 Mid priority issue labels Aug 10, 2023
@duburcqa duburcqa moved this to To do in Jiminy 2.0 Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To do
Development

No branches or pull requests

1 participant