-
Hi again! Thanks for your quick reply for the other issue. I believe using I think it is a related, but separate, issue, and hence I'm opening another issue instead of re-opening that. The issue is: The
If I call I have also tried to change the solver to Are there other options to get the corresponding In the paper, it appears that a few ideas related to this above issue have been brought up:
Is the implementation of this "single rigid body model (SRBM) nonlinear MPC controller" available in the repository? I think that might be useful in solving the above issue. Thanks again! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
TLDR:
Happy to help! So in your example, if you want to parallelize the cost function, you might want to try this:
And then the saved output could be codegened with CusADi, and the cost function could be parallelized across any number of environments. Note that your expression for the cost depends only on Sorry if it wasn't clear in the paper, we only use the As an example, we can use We end up with six symbolic matrices/vectors - This KKT system is a linear system ( We don't have a clean version of the SRBM implementation yet - I'm working on making some CasADi tutorials that detail the individual sections (the QP matrices, the linear solver, SRBM dynamics, etc.). Hope that clarified some of your questions - I'll leave this issue up so other people can see it. |
Beta Was this translation helpful? Give feedback.
-
Thanks again for the quick reply! What I wanted to do is to see if I can solve multiple instances of an optimal control problem on GPU (I guess I was drawn to the Optimal Control part, rather than the Symbolic Expressions part in the title of the paper, "A GPU Parallelization Framework for Symbolic Expressions and Optimal Control".) Just to be clear(er):
A follow-up question: Looking forward to those tutorials/code! I'm curious to see how the OCP can be constructed (without the In particular, I think it will be super useful if there is an example that illustrates how the OCP in (1) and (2) in the paper can be cast into CasADi symbolics, put together with the (QP) solver, and do multiple parallel evaluations of that OCP on GPU. |
Beta Was this translation helpful? Give feedback.
-
For your followup, I'm unsure if you mean codegen for GPU parallelization or CasADi's native codegen for C compilation. Yes, CusADi can only parallelize
Summary: Hope that clarifies your questions, let me know if anything's still unclear. |
Beta Was this translation helpful? Give feedback.
-
Moving this to discussions since we're talking about implementation details rather than CusADi specific bugs. |
Beta Was this translation helpful? Give feedback.
expand()
ed, then saved for parallelization.For your followup, I'm unsure if you mean codegen for GPU parallelization or CasADi's native codegen for C compilation. Yes, CusADi can only parallelize
SXFunction
s. This isn't a fundamental limitation - we haven't addedMX
capabilities because almost allMX
expressions can be expanded, andSX
expressions are typically faster to evaluate.Opti
instance and compile it. Under the hood, if you setopti.solver('ipopt')
, the.c
codegen externally callsipopt
(or whatever solver you chose…