Skip to content

Add Block-Jacobi preconditioning and optimize matrix-free Schur - #51

Open
zitongzhan wants to merge 2 commits into
releasefrom
solver-block-jacobi
Open

zitongzhan wants to merge 2 commits into
releasefrom
solver-block-jacobi

Conversation

@zitongzhan

Copy link
Copy Markdown
Collaborator

No description provided.

zitongzhan and others added 2 commits October 24, 2026 21:37
…olves

- Add BlockJacobiPCG, a PCG subclass whose preconditioner for warp BSR
  systems inverts the diagonal blocks instead of warp's scalar Jacobi.
  Schur uses the solver's preconditioner when it provides one.
- Matrix-free Schur now preconditions with the block diagonal of the
  Schur complement S = U - W V^-1 W^T, computed per observation by a warp
  kernel, instead of with U.
- Convert the assembled Jacobian CSR in LM.step to int32 indices when they
  fit (COO -> CSR widens them to int64).
- NormalMatVec: precompute damping * diag in set_damping so matvec has no
  host sync, fuse the damping term with addcmul_, and return a copy from
  diagonal() since PCG modifies it in place.

On BAL Ladybug-1723 (20 LM steps, RTX 3080), matrix-free Schur with
BlockJacobiPCG runs in 2.75 s vs 2.83 s, and explicit Schur in 8.1 s vs
12.4 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The matrix-free branch of Schur.step now keeps the transposed Jacobians
built for U and V and uses plain bsr_mv on them for the J^T products.
Warp's bsr_mv(..., transpose=True) scatters with atomics and is several
times slower (J0^T product 530 us -> 212 us on Ladybug-1723).

One Schur matvec: 0.93 ms -> 0.60 ms; 20 LM steps with BlockJacobiPCG:
2.75 s -> 2.16 s at the same loss. Warp pool peak +~40 MiB (the
transposes now live through the solve); torch peak unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant