Published April 16, 2026 | Version v0.10.0

PyTorch Kinematics

Description

Analytical FK Backward

forward_kinematics_tensor now uses an analytical geometric Jacobian for the backward pass by default, computing d(transform)/d(joint_angles) directly from joint axes and the kinematic tree structure instead of replaying forward ops through autograd.

  • ~9x faster backward pass on GPU for large batch sizes
  • Compatible with torch.compile(fullgraph=True) — both forward and backward are fully traced
  • Compatible with torch.vmap
  • Escape hatch: analytical_grad=False for higher-order gradients (create_graph=True) or gradients w.r.t. chain parameters (e.g. link offsets for calibration)
chain = pk.build_serial_chain_from_urdf(open("robot.urdf").read(), "end_link")
th = torch.randn(1000, 7, requires_grad=True)
T_all = chain.forward_kinematics_tensor(th)  # analytical backward by default
loss = T_all.sum()
loss.backward()  # ~9x faster than autograd on GPU

Other changes

  • Add --visualize CLI flag and fix window_recorder fallback on macOS

Notes

If you use this software, please cite it as below.

Files

UM-ARM-Lab/pytorch_kinematics-v0.10.0.zip

Files (1.1 MB)

Name Size Download all
md5:707922e1171b10a57c06953c5aab2d31
1.1 MB Preview Download

Additional details

Related works