solve#
Explicit triangular inverse policies for differentiable prefill emulation.
Functions
Independently sum powers 0..degree, including the actual polynomial gradient. |
|
Materialize exact or polynomial inverse of I plus the strict lower triangle. |
- neumann_inverse_reference(lower, degree)#
Independently sum powers 0..degree, including the actual polynomial gradient.
The strictly lower triangle is used. There is no residual-based fallback. Use FP64 to distinguish polynomial error from working-arithmetic error.
- Parameters:
lower (Tensor)
degree (int)
- Return type:
Tensor
- triangular_inverse(lower, policy)#
Materialize exact or polynomial inverse of I plus the strict lower triangle.
Materializing the inverse retains the WY operand-QDQ sites. The Triton option requires CUDA FP32 chunk-64 matrices and supports first-order gradients only.
- Parameters:
lower (Tensor)
policy (LinearAttentionSolveConfig)
- Return type:
Tensor