Closed merdan-9 closed 1 year ago
Hi,
Could you elaborate on why cxxabi is preferable for you? This would help me decide if I should support this by default.
My guess is that the following line is leading to the problem:
Could you try setting -D_GLIBCXX_USE_CXX11_ABI=1
?
Best Tim
Hi Tim,
Firstly, I'd like to integrate this as a control algorithm into my larger project, which consists of various other control algorithms. My main project is linked to cxx11 abi, so it won't run as expected with the standard installation method.
I tried the -D_GLIBCXX_USE_CXX11_ABI=1 as you suggested. It works fine on the x86 architecture. However, in the later stages, I need to perform embedded control on the ARM architecture. The challenge is that there isn't a torch version for the ARM architecture with cxx11 abi, so it doesn't seem like a complete solution.
Given that the generated C code doesn't have torch doing much, would it be possible to directly export the network weights into a C file and decouple the torch-related portions?
Best regards, Merdan
Hi Merdan,
Firstly, I'd like to integrate this as a control algorithm into my larger project, which consists of various other control algorithms. My main project is linked to cxx11 abi, so it won't run as expected with the standard installation method.
I see the problem!
I tried the -D_GLIBCXX_USE_CXX11_ABI=1 as you suggested. It works fine on the x86 architecture. However, in the later stages, I need to perform embedded control on the ARM architecture. The challenge is that there isn't a torch version for the ARM architecture with cxx11 abi, so it doesn't seem like a complete solution.
I imagine you could build torchlib from source with cxx11 abi.
Given that the generated C code doesn't have torch doing much, would it be possible to directly export the network weights into a C file and decouple the torch-related portions?
This is certainly possible. But this would not scale to anything more complicated than simple MultiLayerPerceptrons. For simple MLPs you could also check out the old naive implementation within ml-casadi [1]. Please keep in mind that this can become slow for larger MLPs.
Hope this helps Tim
Quick update on this: With the latest commit L4CasADi will automatically detect if torch was compiled with CXX11 ABI or not.
Hi Tim,
Your suggestions were incredibly helpful, and I appreciate the depth of detail you provided!
Have a good day. Merdan
Hi Tim,
I encountered a symbol lookup error when attempting to run an example after successfully building with torch with cxxabi.
Details:
Error Message: symbol lookup error: _l4c_generated/libl4casadi_f.so: undefined symbol: _ZN8L4CasADiC1ESsSsbSsbb
Torch Version: torch-2.1.0+cpu.cxx11.abi-cp39-cp39-linux_x86_64.whl
I'd appreciate any guidance or assistance in resolving this. Thank you!