Ops properties#
Native Aidge operators expose predefined static properties that describe their intrinsic mathematical behavior, characteristics, capabilities, or constraints. These properties enable generic heuristics that rely on operator attributes rather than operator types, such as PTQ or other graph optimization techniques.
Additional properties can also be defined by users.
Overview#
Each operator is described using the following properties:
scale_law: describes how outputs scale with inputs;Only for
Homogeneousscale_law:homogeneity_degree: exponent vector describing scaling behavior;scale_composition: how scaling propagates across multiple inputs;
parity: symmetry under input negation;commutative: whether input ordering affects result.
This taxonomy is designed for static analysis of deep learning graphs and quantization propagation.
Core Definitions#
scale_law Property#
HomogeneousOperator satisfies:
\[f(\lambda x) = \lambda^d f(x)\]or more generally the following scale-equivariance law:
\[f(\lambda_1 x_1, \lambda_2 x_2, ...) = \phi(\lambda_1^{d_1}, \lambda_2^{d_2}, ...) f(x_1, x_2, ...)\]In this case, the
homogeneity_degreeproperty must be specified:homogeneity_degreeVector \((d_1, d_2, \ldots)\) such that scaling input \(i\) by \(\lambda_i\) contributes a factor \(\lambda_i^{d_i}\) to the output scale.
Examples:
MatMul: (1, 1)Mul: (1, 1)Div: (1, -1)Reciprocal: (-1)Sqrt: (0.5)ArgMax: (0)
AffineLinear transformation with bias terms breaking strict scaling.
GeneralNonlinearNo consistent scaling law exists.
scale_composition Property#
Defines how scaling propagates across multiple inputs.
This property must only be specified for multi-inputs operators with the
Homogeneous scale_law property.
We assume a scalar scale per tensor. The goal is to characterize the function \(\phi\).
ProductScaling multiplies across inputs.
\[\phi(\lambda_1^{d_1}, \lambda_2^{d_2}, ...) = \lambda_1^{d_1} \lambda_2^{d_2} ...\]MatMulExample:\[Z = A B\]Scaling:
\[ \begin{align}\begin{aligned}Z' = f(\lambda_1 A, \lambda_2 B) = \lambda_1 \lambda_2 f(A, B)\\Z' = \lambda_1 A \lambda_2 B = \lambda_1 \lambda_2 A B\end{aligned}\end{align} \]- Interpretation:
The output scale is exactly the product of the inputs scale.
UnionOutput is formed by selecting, routing, or combining values without arithmetic accumulation.
\[\phi(\lambda_1^{d_1}, \lambda_2^{d_2}, ...) \leq max(\lambda_1^{d_1}, \lambda_2^{d_2}, ...)\]MaxExample:\[Z = max(A, B)\]The output magnitude is bounded by:
\[Z' = max(\lambda_1 A, \lambda_2 B) \leq max(\lambda_1, \lambda_2) max(A, B)\]- Interpretation:
The output scale estimate is \(max(\lambda_1, \lambda_2)\). If the inputs scale are homogeneous, the scale composition \(\phi\) is exactly the maximum of the inputs scale.
SumBoundOutput is formed by arithmetic accumulation of multiple inputs.
Add/SumExample:\[Z = sum(A, B)\]The output magnitude is bounded by:
\[\|Z'\| \leq \lambda_1 \|A\| + \lambda_2 \|B\| \leq max(\lambda_1, \lambda_2) (\|A\| + \|B\|)\]Therefore:
\[\phi(\lambda_1, \lambda_2) \le max(\lambda_1, \lambda_2)\]- Interpretation:
An output scale of \(max(\lambda_1, \lambda_2)\) is a conservative upper bound.
parity Property#
Even\(f(-x) = f(x)\)
Odd\(f(-x) = -f(x)\)
Note: many operators are neither and should be treated as undefined parity.
commutative Property#
Boolean flag indicating whether input ordering affects output.
Present and True: \(f(a, b) = f(b, a)\)
Absent or False: order matters
Commutativity applies only to input-value semantics (aidge_core.InputCategory.Data
/ aidge_core.InputCategory.OptionalData input category), not indexing or layout.
Operators taxonomy#
Operator |
Scale law |
Homogeneity degree |
Scale composition |
Parity |
Commutative |
|---|---|---|---|---|---|
Abs |
Homogeneous |
[1.0] |
— |
Even |
True |
Add |
Homogeneous |
[1.0, 1.0] |
SumBound |
— |
True |
And |
GeneralNonlinear |
— |
— |
— |
True |
ArgMax |
Homogeneous |
[0.0] |
— |
— |
— |
Asin |
GeneralNonlinear |
— |
— |
Odd |
— |
Atan |
GeneralNonlinear |
— |
— |
Odd |
— |
AvgPooling1D |
Homogeneous |
[1.0] |
— |
Odd |
— |
AvgPooling2D |
Homogeneous |
[1.0] |
— |
Odd |
— |
AvgPooling3D |
Homogeneous |
[1.0] |
— |
Odd |
— |
BatchNorm2D |
Affine |
— |
— |
— |
— |
BitErrorRate |
GeneralNonlinear |
— |
— |
— |
— |
BitShift |
Homogeneous |
[1.0] |
— |
Odd |
— |
CastLike |
Homogeneous |
[1.0] |
— |
Odd |
— |
Cast |
Homogeneous |
[1.0] |
— |
Odd |
— |
Ceil |
GeneralNonlinear |
— |
— |
— |
— |
Clip |
GeneralNonlinear |
— |
— |
— |
— |
ComplexToInnerPair |
Homogeneous |
[1.0] |
— |
Odd |
— |
Concat |
Homogeneous |
[1.0] |
Union |
Odd |
— |
ConnectedComponentLabeling |
GeneralNonlinear |
— |
— |
— |
— |
ConstantOfShape |
GeneralNonlinear |
— |
— |
— |
— |
Conv1D |
Affine |
— |
— |
— |
— |
Conv2D |
Affine |
— |
— |
— |
— |
Conv3D |
Affine |
— |
— |
— |
— |
ConvDepthWise1D |
Affine |
— |
— |
— |
— |
ConvDepthWise2D |
Affine |
— |
— |
— |
— |
ConvTranspose1D |
Affine |
— |
— |
— |
— |
ConvTranspose2D |
Affine |
— |
— |
— |
— |
ConvTranspose3D |
Affine |
— |
— |
— |
— |
Cosh |
GeneralNonlinear |
— |
— |
Even |
— |
Cos |
GeneralNonlinear |
— |
— |
Even |
— |
CryptoHash |
GeneralNonlinear |
— |
— |
— |
— |
DepthToSpace |
Homogeneous |
[1.0] |
— |
Odd |
— |
DFT |
Homogeneous |
[1.0] |
— |
Odd |
— |
Div |
Homogeneous |
[1.0, -1.0] |
Product |
— |
— |
DropBlock |
Homogeneous |
[1.0] |
— |
Odd |
— |
Dropout |
Homogeneous |
[1.0] |
— |
Odd |
— |
Equal |
GeneralNonlinear |
— |
— |
— |
True |
Erf |
GeneralNonlinear |
— |
— |
Odd |
— |
Expand |
Homogeneous |
[1.0] |
— |
Odd |
— |
Exp |
GeneralNonlinear |
— |
— |
— |
— |
FC |
Affine |
— |
— |
— |
— |
FixedNBitFlip |
GeneralNonlinear |
— |
— |
— |
— |
Flatten |
Homogeneous |
[1.0] |
— |
Odd |
— |
Floor |
GeneralNonlinear |
— |
— |
— |
— |
Fold2D |
Homogeneous |
[1.0] |
— |
Odd |
— |
GatherElements |
Homogeneous |
[1.0] |
— |
Odd |
— |
Gather |
Homogeneous |
[1.0] |
— |
Odd |
— |
GlobalAveragePooling |
Homogeneous |
[1.0] |
— |
Odd |
— |
Greater |
GeneralNonlinear |
— |
— |
— |
— |
GridSample |
Homogeneous |
[1.0] |
— |
Odd |
— |
Hardmax |
Homogeneous |
[0.0] |
— |
— |
— |
HardSigmoid |
GeneralNonlinear |
— |
— |
— |
— |
Heaviside |
GeneralNonlinear |
— |
— |
— |
— |
Identity |
Homogeneous |
[1.0] |
— |
Odd |
— |
InnerPairToComplex |
Homogeneous |
[1.0] |
— |
Odd |
— |
InstanceNorm |
Homogeneous |
[0.0] |
— |
— |
— |
LayerNorm |
Homogeneous |
[0.0] |
— |
— |
— |
LeakyReLU |
Homogeneous |
[1.0] |
— |
— |
— |
Less |
GeneralNonlinear |
— |
— |
— |
— |
Ln |
GeneralNonlinear |
— |
— |
— |
— |
LogSoftmax |
GeneralNonlinear |
— |
— |
— |
— |
LRN |
GeneralNonlinear |
— |
— |
— |
— |
MatMul |
Homogeneous |
[1.0, 1.0] |
Product |
— |
— |
Max |
Homogeneous |
[1.0, 1.0] |
Union |
— |
True |
MaxPooling1D |
Homogeneous |
[1.0] |
— |
Odd |
— |
MaxPooling2D |
Homogeneous |
[1.0] |
— |
Odd |
— |
MaxPooling3D |
Homogeneous |
[1.0] |
— |
Odd |
— |
Memorize |
Homogeneous |
[1.0] |
— |
Odd |
— |
Min |
Homogeneous |
[1.0, 1.0] |
Union |
— |
True |
Mod |
GeneralNonlinear |
— |
— |
— |
— |
Mul |
Homogeneous |
[1.0, 1.0] |
Product |
Odd |
True |
NBitFlip |
GeneralNonlinear |
— |
— |
— |
— |
Neg |
Homogeneous |
[1.0] |
— |
Odd |
— |
NonZero |
GeneralNonlinear |
— |
— |
— |
— |
Not |
GeneralNonlinear |
— |
— |
— |
— |
OneHot |
GeneralNonlinear |
— |
— |
— |
— |
Pad |
Homogeneous |
[1.0] |
— |
Odd |
— |
Pop |
Homogeneous |
[1.0] |
— |
Odd |
— |
Pow |
Homogeneous |
— |
— |
— |
— |
RandomNormalLike |
GeneralNonlinear |
— |
— |
— |
— |
Range |
GeneralNonlinear |
— |
— |
— |
— |
Reciprocal |
Homogeneous |
[-1.0] |
— |
Odd |
— |
ReduceMax |
Homogeneous |
[1.0] |
— |
Odd |
— |
ReduceMean |
Homogeneous |
[1.0] |
— |
Odd |
— |
ReduceMin |
Homogeneous |
[1.0] |
— |
Odd |
— |
ReduceSum |
Homogeneous |
[1.0] |
— |
Odd |
— |
ReLU |
Homogeneous |
[1.0] |
— |
— |
— |
Reshape |
Homogeneous |
[1.0] |
— |
Odd |
— |
Resize |
Homogeneous |
[1.0] |
— |
Odd |
— |
Round |
GeneralNonlinear |
— |
— |
— |
— |
Scatter |
Homogeneous |
[1.0] |
— |
Odd |
— |
Select |
GeneralNonlinear |
— |
— |
— |
— |
Shape |
GeneralNonlinear |
— |
— |
— |
— |
Sigmoid |
GeneralNonlinear |
— |
— |
Odd |
— |
Sinh |
GeneralNonlinear |
— |
— |
Odd |
— |
Sin |
GeneralNonlinear |
— |
— |
Odd |
— |
Slice |
Homogeneous |
[1.0] |
— |
Odd |
— |
Softmax |
GeneralNonlinear |
— |
— |
— |
— |
Split |
Homogeneous |
[1.0] |
— |
Odd |
— |
Sqrt |
Homogeneous |
[0.5] |
— |
— |
— |
Squeeze |
Homogeneous |
[1.0] |
— |
Odd |
— |
Stack |
Homogeneous |
[1.0] |
— |
Odd |
— |
STFT |
Homogeneous |
[1.0] |
— |
Odd |
— |
Sub |
Homogeneous |
[1.0, 1.0] |
SumBound |
— |
— |
Sum |
Homogeneous |
[1.0, 1.0] |
SumBound |
— |
True |
SVMRegressor |
GeneralNonlinear |
— |
— |
— |
— |
Tanh |
GeneralNonlinear |
— |
— |
Odd |
— |
Tan |
GeneralNonlinear |
— |
— |
Odd |
— |
Tile |
Homogeneous |
[1.0] |
— |
Odd |
— |
TopK |
Homogeneous |
[1.0] |
— |
Odd |
— |
Transpose |
Homogeneous |
[1.0] |
— |
Odd |
— |
Unfold2D |
Homogeneous |
[1.0] |
— |
Odd |
— |
Unsqueeze |
Homogeneous |
[1.0] |
— |
Odd |
— |
WeightInterleaving |
Homogeneous |
[1.0] |
— |
Odd |
— |
Where |
GeneralNonlinear |
— |
— |
— |
— |