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

Add Limitations section to README #174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,24 @@ make -j $(nproc)

You'll then need to add SymForce (along with `gen/python` and `third_party/skymarshal` within symforce) to your PYTHONPATH in order to use them.

# Limitations

The separation between symbolic and runtime contexts
requires thinking at a higher level of abstraction than directly writing runtime code. There are many benefits to this
approach, but it takes practice.

- Conditional statements in Python will not result in branches
in runtime code. Users must conceptualize instruction-level
branching and employ our concept of epsilon to avoid singularities.

- Our method of flattening expressions becomes impractical with highly nested expressions, such as long chains of integrations or loops. Since the generated code unrolls these chains, it can lead to long compile times, poor cache performance, or other bottlenecks. Further work is required to handle loops or sub-functions as a construct of symbolic expressions. Similar bottlenecks can happen when attempting to generate a linearization function with a very large number of variables. In some cases, it is a better tradeoff to generate multiple functions and call them dynamically at runtime, with some sacrifices made in shared subexpressions.

- Some symbolic routines, like simplification and factorization, become slow with large expressions. We recommend understanding the computational cost of these routines and using them in careful and targeted ways, but this requires some domain knowledge and experience.

- SymForce is most suitable for generating functions with up to hundreds of input variables, and hundreds of thousands of instructions. However, functions can be invoked dynamically in much larger optimization problems. SymForce does not directly support dense data parallelism like operating over pixels of an image, and does not attempt to compete with libraries that do so. However, it can efficiently generate the inner kernel e.g. for a single pixel in such a use case.

- Our optimizer does not yet support hard constraints, but this is not a fundamental limitation and is something we plan to add. We do have utilities for soft constraints via [barrier functions](https://github.com/symforce-org/symforce/blob/main/symforce/opt/barrier_functions.py), which we have found to work well in many cases.

# License

SymForce is released under the [Apache 2.0](https://spdx.org/licenses/Apache-2.0.html) license.
Expand Down