Over multiple iterations of improving FormaK (reference IMU model rocket model, the original Python code generation), I've wanted to leverage the power of Sympy to provide efficient implementations of symbolic concepts before converting to Python or C++. The tool for this job is simplify
. With one call, it can simplify polynomials, simplify trigonometry and other approaches. Combine this with Common Subexpression Elimination and we have a powerful pair of tools to write efficient code regardless of the model. There's just one problem: Sympy can be incredibly sluggish for some functions. Each call can take 10s of seconds. These 10s of seconds can stack up to minutes of time spent waiting and hoping for a result. For this experiment, I take some time to dive into what's going on and try to understand why it can be so darn slow sometimes.
Articles tagged with Sympy
Behind the Scenes of the Strapdown IMU Reference Model Building
A new feature for FormaK has landed: the Strapdown IMU Reference model. The model is now available for inclusion into new models and use as a reference for implementing future models. This post covers some of the aspects of the design and development that didn't make it into the final design and feature.
Strapdown IMU Reference Model - New FormaK Feature Building
A new feature for FormaK has landed: the Strapdown IMU Reference model. The model is now available for inclusion into new models and use as a reference for implementing future models.
FormaK Week in Review 2023-01-13 Building
It's been a little while since I last wrote about Formak ( FormaK Under The Hood: Optimization for scikit-learn integration , Sat 08 October 2022). Since then, I've been busy adding functionality to FormaK and I've also been improving the tooling for the project, inspired by Boring Python: code quality. The latest piece of functionality is the C++ code generation. The PR is in progress, but the initial experiments have proved out that the generation pipeline is feasible and able to be integrated into bazel.
SIMD and Graphs: Partitioning Graphs into data-dependency levels Building
This post is a new episode in a miniseries focused on SIMD instructions. This second post focuses on fusing common single operations across multiple data
SIMD and Graphs: Graph Matching Building
This post is a new episode in a miniseries focused on SIMD instructions. This first post focuses on matching points in the compute graph where we can combine individual instructions to form SIMD instructions.
FormaK: Python Code Generation Building
The second feature for FormaK landed: generating Python models
FormaK: User Interface Building
The first feature for FormaK landed: the user interface!