Affine Propagation #
This module contains the one-sided affine pass for the flat graph engine. It builds an upper affine form for each node with respect to a chosen input node. Linear and structural operations preserve affine dependence. A nonlinear operation uses the upper endpoint of its checked IBP box as a constant affine bound unless a directed affine rule is available.
Flatten a typed convolution into the affine map it denotes.
The CROWN pass uses this when a convolution is linear in the selected input. Keeping the conversion here lets convolution share the same affine machinery as linear and matmul nodes.
Precondition: cfg.stride ≠ 0. Engine call sites check this before calling the converter.
Instances For
Propagate a single node’s affine form (CROWN/DeepPoly style) given parent affine forms.
This updates the affs array at index id when the node kind admits an affine transfer rule.
For non-affine nodes (or missing parents/params), the array is left unchanged so downstream code
can fall back to IBP boxes.
Instances For
Run the one-sided affine pass.
Linear nodes keep their affine dependence on the selected input. Nonlinear nodes use their checked IBP upper endpoint as a constant affine bound unless this pass has a separately justified rule.