Add differentiable Sobolev mesh deformation - #1875
Conversation
CODEOWNERS review mapCurrent for commit ⏳ @loliverhennigh — 7 file(s)
⏳ @megnvidia — 2 file(s)
⏳ @peterdsharpe — 9 file(s)
No CODEOWNER
Comment |
|
@loliverhennigh Can you please review this? Thanks! |
Greptile SummaryAdds differentiable Sobolev mesh deformation across the functional and Mesh APIs.
Important Files Changed
Reviews (2): Last reviewed commit: "Handle dynamic zero Sobolev scales" | Re-trigger Greptile |
loliverhennigh
left a comment
There was a problem hiding this comment.
LGTM, no big comment but just wanted to confirm there is now warp implementation for this? I only see PyTorch.
|
@loliverhennigh Yeah I didn't attempted the Warp backend due to the matrix-free Jacobi-PCG solves to keep it differentiable. Let me give a try I have an idea. |
|
@loliverhennigh I implemented the Warp backend. I'll try to upstream some of these to Warp later. Please take a look. |
Summary
sobolev_deform_points,SobolevDeformPoints, andMesh.sobolev_deformas public APIs.Motivation
Direct optimization of dense mesh vertices can produce vertex-scale oscillations in shape updates and adjoints. This adds a mesh-aware deformation parameterization that filters those high-frequency modes while preserving broad shape changes and fixed-point constraints.
The Warp backend moves P1 assembly, matrix-free operator application, CG, and the analytic geometry pullback onto CUDA. Warp's
optim.linearmodule disables generated backward kernels, so the implementation differentiates the converged linear system with an explicit adjoint solve instead of differentiating the CG iteration history.User impact
Users can optimize candidate vertex coordinates through
mesh.sobolev_deform(...)and receive smoother reverse-mode sensitivities. The smoothing length uses the same physical units as the mesh coordinates.Torch is the default on CPU. Warp is the default on CUDA for segment, triangle, and tetrahedron meshes when it is available. Both backends support first-order gradients and
torch.compile. CUDA Graph capture and higher-order derivatives at positive smoothing lengths are not supported.Validation
CUDA_VISIBLE_DEVICES=0 uv run --no-sync pytest -q test/nn/functional/geometry/test_point_sobolev.py test/mesh/transformations/test_sobolev.py