Skip to content

Expose sequence Cholesky solver in PyMomentum (#1397)#1397

Closed
cdtwigg wants to merge 2 commits into
mainfrom
export-D105079594
Closed

Expose sequence Cholesky solver in PyMomentum (#1397)#1397
cdtwigg wants to merge 2 commits into
mainfrom
export-D105079594

Conversation

@cdtwigg
Copy link
Copy Markdown
Contributor

@cdtwigg cdtwigg commented May 14, 2026

Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 14, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 14, 2026

@cdtwigg has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105079594.

@meta-codesync meta-codesync Bot changed the title Expose sequence Cholesky solver in PyMomentum Expose sequence Cholesky solver in PyMomentum (#1397) May 14, 2026
meta-codesync Bot pushed a commit that referenced this pull request May 14, 2026
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
@meta-codesync meta-codesync Bot force-pushed the export-D105079594 branch from 8b4ef79 to 1779963 Compare May 14, 2026 21:29
meta-codesync Bot pushed a commit that referenced this pull request May 14, 2026
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
@meta-codesync meta-codesync Bot force-pushed the export-D105079594 branch from 1779963 to 25a96ad Compare May 14, 2026 21:34
meta-codesync Bot pushed a commit that referenced this pull request May 15, 2026
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
@meta-codesync meta-codesync Bot force-pushed the export-D105079594 branch from 25a96ad to b4acdb1 Compare May 15, 2026 05:19
meta-codesync Bot pushed a commit that referenced this pull request May 15, 2026
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
@meta-codesync meta-codesync Bot force-pushed the export-D105079594 branch from b4acdb1 to 332535b Compare May 15, 2026 06:34
meta-codesync Bot pushed a commit that referenced this pull request May 15, 2026
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
@meta-codesync meta-codesync Bot force-pushed the export-D105079594 branch from 332535b to 5e07c17 Compare May 15, 2026 06:35
meta-codesync Bot pushed a commit that referenced this pull request May 15, 2026
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
@meta-codesync meta-codesync Bot force-pushed the export-D105079594 branch from 5e07c17 to ed1182c Compare May 15, 2026 18:41
meta-codesync Bot pushed a commit that referenced this pull request May 15, 2026
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
@meta-codesync meta-codesync Bot force-pushed the export-D105079594 branch 2 times, most recently from 9c002bb to 8fdfdea Compare May 15, 2026 20:54
meta-codesync Bot pushed a commit that referenced this pull request May 15, 2026
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
cdtwigg added 2 commits May 15, 2026 14:05
Summary:

Add a separate `SequenceCholeskySolver` for sequence problems where the existing online-QR solver is too expensive.

The new solver accumulates compact banded normal equations online, packs frame-local and universal columns contiguously before `J^T J`, supports chunked multithreaded accumulation with deterministic boundary and sequence-error handling, and solves the banded system with block LDLT by default. A scalar banded LDLT path remains user-switchable for debugging and benchmarking. Compact normal-equation accumulation defaults to double precision so float error functions can still evaluate residuals and Jacobians in float without losing precision before the double LDLT solve.

This diff also extracts shared sequence-solver helpers into `SequenceSolverBase`, exposes read-only `SequenceSolverFunction` accessors needed by the solver, wires the new solver into Momentum build/fwd generation, adds solver timing counters for normal-equation accumulation and linear solve, and adds a benchmark target that compares QR, block LDLT, scalar LDLT behavior, chunk size, `J^T J` packing, double normal-equation accumulation, and 93-joint larger-character cases.

Reviewed By: cstollmeta

Differential Revision: D105035576
Summary:

Expose the sequence Cholesky solver through pymomentum.solver2 on top of the Momentum solver diff.

The binding adds SequenceSolverType so Python callers can choose QR or Cholesky through solve_sequence(). It exposes SequenceCholeskySolverOptions including chunk_size, target_rows_per_jtj_chunk, and use_block_ldlt, and exposes SequenceCholeskySolver with read-only last_normal_equation_time_ms and last_linear_solve_time_ms timing properties.

This also updates repr/type stubs and keeps common inherited solver options on the base binding rather than duplicating Python properties.

Reviewed By: cstollmeta

Differential Revision: D105079594
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 15, 2026

This pull request has been merged in 3e3241e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant