v0.8.0
Full Changelog: v0.7.0...v0.8.0
This is probably our biggest release yet, with multiple major additions - we have built-in IMU Preintegration, new backends for CUDA and PyTorch, and a new symbolic type for unit vectors on S(2). Plus, we've made major improvements to memory usage in the C++ optimizer, made lots of additions to the symbolic API, and made plenty of improvements under the hood.
🚨 Breaking Changes
- ae43476 Slices of 1D matrices are matrices, not lists - taking a 1D slice of a
geo.Matrix
now returns ageo.Matrix
, previously it would return a list. - f60180e Add include_jacobians flag - by default, the
Optimizer
will now not allocate or populate the problem jacobian, since it is not needed for optimization. If you'd like it to be filled out, setinclude_jacobians
totrue
. - There are some simplifications to the
sym::Factor
API, described inCode Cleanup / Refactoring
below. Most users should be unaffected. - Generated Python functions return vectors as 1D ndarrays - see the description below
📈 IMU Factor
SymForce has IMU Preintegration! We have a C++ ImuFactor
with preintegration and linearization functions generated from a symbolic implementation. See the PRs #279 and #280 for more information, and see imu_factor.h
for an example.
- ab1c621 Add an on manifold Imu Factor @bradley-solliday-skydio
🦾 CUDA Backend
The CUDA backend generates __host__ __device__
functions, i.e. functions that you can call from within a CUDA kernel. It's currently in an experimental state, and supports scalars, vectors/matrices, and sf.DataBuffer
in the APIs of generated functions; other types like geo
and cam
objects can be passed via their storage vectors. See the commit for more examples.
- 45b2ce2 CUDA Backend @aaron-skydio
🔥 PyTorch Backend
The PyTorch backend generates python functions that operate on PyTorch tensors, with each symbolic op becoming one PyTorch op. It supports broadcasting these operations across multiple optional batch dimensions. Like the CUDA backend, this is currently experimental - it supports scalars and vectors/matrices in generated functions APIs, and is not particularly optimized for performance.
- a5341d8 PyTorch backend @aaron-skydio
- 5835edf Better PyTorch test coverage @aaron-skydio
⚪ geo.Unit3
The Unit3
symbolic type lets you represent unit vectors in 3D, including optimizing unit vector variables and performing manifold operations on them.
- 6dadff9 Add geo.Unit3 to model directions in R^3 @chao-qu-skydio
➡️ Generated Python functions return vectors as 1D ndarrays
By default, generated python functions will now return 1d ndarrays for outputs that are row or column vectors (including 1x1 matrices). This includes member functions of generated python types, such as sym.Pose3.position()
. See the commit for more information.
- 718d061 return 1d vectors if !return_2d_vectors @bradley-solliday-skydio
💨 Optimizer Performance/API Improvements
Major improvements to memory usage in the C++ optimizer, especially for large problems like bundle adjustment that have lots of small factors. Also, converting a sym::Values
to LCM is significantly faster.
- f60180e Add include_jacobians flag @ryan-brott-skydio
- 5b756a6 Linearizer: stop storing dense linearized factors @ryan-brott-skydio
- 1c1268a Turn off sort_by_offset for keys when get LCM message @xipeng-wang-skydio
- c7b2715 Factor Jacobian factory functions are constructors @aaron-skydio
- 8111eb2 Factor supports more functor types @samuel-wang-skydio
🔣 Symbolic API additions
- 892885b Default to automatically picking output_names @aaron-skydio
- ae43476 Slices of 1D matrices are matrices, not lists @nathan-skydio
- 652bc74 Add
CSCFormat.to_matrix
@nathan-skydio - bd42ee9 Add metadata field to ResidualBlock @nathan-skydio
- a959826 Simplify geo_factors_codegen w/ skip_dir_nesting @bradley-solliday-skydio
- fc4b4d5 More logic methods @aaron-skydio
- 6ed28d9 Add V2.x,y and V3.x,y,z @aaron-skydio
- 42b9694 Add sf.clamp @aaron-skydio
- 9769ee3 Add unit_* shorthands to Matrix @aaron-skydio
- 1c44a94 Pipe sparse_matrices through Codegen.function @aaron-skydio
- 24eaf20 Add CodegenConfig.custom_preamble @aaron-skydio
- a4d4bbc Check that namespaces are valid identifiers @aaron-skydio
- 04acf8a Allow setting default epsilon to same value @aaron-skydio
- f8f7eb4 Assert Matrix shape is correct when copying matrix @bradley-solliday-skydio
- 23b1f84 Change default epsilon value to symbol @bradley-solliday-skydio
🧹 Code Cleanup / Refactoring
- 6c3cc2d Cache factor indexes in the Linearizer @aaron-skydio
- 9774673 Raise exception during codegen if name is not valid @nathan-skydio
- 3e11ebd Check sparse matrix condition for Jacobian and Hessian constructors @changh95
- 783ede7 Reduce the overload set of Factor constructors @chao-qu-skydio
- af42fd8 DataBuffers not marked as unused @aaron-skydio
- 305387d Reduce surface area of keys_to_func and keys_to_optimize @chao-qu-skydio
- 1244d2c Move Factor::IsSparse to the Helpers section @chao-qu-skydio
- af2dff0 Optimizer asserts keys and factors are nonempty @aaron-skydio
- 4a3fd72 Clear before reserve in OptimizationStats.Reset() @chao-qu-skydio
- b2cceee Use the correct default epsilon in optimizer @chao-qu-skydio
- 49018a4 Use operator bool of std::function to determine is_sparse @chao-qu-skydio
- 9171906 Pass sink parameters by value and move @chao-qu-skydio
- d3bb744 Change some usages of ScalarType to Scalar @chao-qu-skydio
- 474f1bd Fix a linter error when a geo type does not define @chao-qu-skydio
- 26dfa72 Matrix types cleanup @aaron-skydio
- c835dbd Reduce number of functor copies in factor creation @chao-qu-skydio
- ecdeeef Make Key constexpr @chao-qu-skydio
- da7b88d Include cstdint instead of stdint.h @chao-qu-skydio
⚙️ Infra / Buildsystem changes
- 9741edf Set min version of lazy-object-proxy to 1.9.0 @bradley-solliday-skydio
- 0f4ca33 Fix symengine python_requires for setuptools 67 @aaron-skydio
- 4c36881 Run tests once @aaron-skydio
- 4a0e69b Update requirements @aaron-skydio
- 2207030 requirements_test supports running from different locations @aaron-skydio
- 1f53590 Add clang to CI, simplify matrix @aaron-skydio
- a04ae35 symforce/test/*.py covered by pylint @aaron-skydio
- 02e86d9 Use gcc 5.5 instead of 5.3 in CI @aaron-skydio
- 791347a GitHub Actions Workflow Updates @aaron-skydio
👮 SkyMarshal
- 732ce35 Typescript updates @vincent-lecrubier-skydio
- faeb8d1 All name functions are constexpr @aaron-skydio
- 6184693 Remove unused variable @aaron-skydio
- aaa593e Typescript changes @rachel-skydio
- 6dc889a Add support for optional
UNKNOWN=0
alias for enums in LCM protobuf generation. @karl-rosaen-skydio - 78ad229 Require python LCM arguments to construct using
from_all_fields
@peter-skydio