Skip to content

Commit 7394a86

Browse files
yuvaltassacopybara-github
authored andcommitted
Speed up mju_boxQP ~2x and improve single-precision accuracy.
`mju_boxQPoption` previously refactored the free-subspace Hessian from scratch whenever the active set changed and performed multiple $O(n^2)$ matrix-vector products per iteration and per line-search step. Updating the Cholesky factor incrementally for small active-set changes and evaluating the search direction and Armijo line search in the `nfree` subspace speeds up `mju_boxQP` by 1.4–1.6x on cold starts and 1.9–2.9x on warm starts, while improving single-precision accuracy. - Add `cholDelete` and `cholInsert` in `engine_util_solve.c` to update `R` via `mju_cholUpdate` when the active-set change is small relative to `nfree`, and fuse the inner column loops in `mju_cholUpdate`. - Solve `H_free,free * temp = grad_free` directly after checking `norm2 < mingrad` and evaluate the projected Armijo line search in the `nfree` subspace using `R`, removing `mulVecMatVecSym`. - Enable `BoxQPTest.BoundedQPvariations` under single precision in `engine_util_solve_test.cc` and evaluate coordinate nudges in `isQPminimum` directly from the gradient and diagonal curvature. - Rename `lu_benchmark_test` to `engine_util_solve_benchmark_test` and add `BM_BoxQP` benchmarks for $n \in \{10, 30, 100, 300\}$. PiperOrigin-RevId: 1004087455 Change-Id: Ib416aa55945f543652e2a73f1d217e6761036613
1 parent 550a454 commit 7394a86

6 files changed

Lines changed: 797 additions & 328 deletions

File tree

‎doc/changelog.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Engine
6363
matrix in ``qpos0``, and the kinematics in ``qpos_spring``. Each entry is ``mjSC_IN`` if the group reads the array,
6464
``mjSC_OUT`` if it writes it, ``mjSC_INOUT`` if both, or 0. ``MJSETCONST_SCALARS`` lists the scalars it
6565
writes.
66+
- :ref:`mju_boxQP` now updates its Cholesky factor incrementally with :ref:`mju_cholUpdate`, making cold-started solves
67+
1.4-1.6x faster and warm-started solves 1.9-2.9x faster.
6668

6769
Compiler
6870
^^^^^^^^

0 commit comments

Comments
 (0)
⌂ 换网址