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 Homogeneous scale_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#

Homogeneous

Operator 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_degree property must be specified:

homogeneity_degree

Vector \((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)

Affine

Linear transformation with bias terms breaking strict scaling.

GeneralNonlinear

No 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.

\[f(\lambda_1 x_1, \lambda_2 x_2, ...) = \phi(\lambda_1^{d_1}, \lambda_2^{d_2}, ...) f(x_1, x_2, ...)\]

We assume a scalar scale per tensor. The goal is to characterize the function \(\phi\).

Product

Scaling multiplies across inputs.

\[\phi(\lambda_1^{d_1}, \lambda_2^{d_2}, ...) = \lambda_1^{d_1} \lambda_2^{d_2} ...\]

MatMul Example:

\[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.

Union

Output 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}, ...)\]

Max Example:

\[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.

SumBound

Output is formed by arithmetic accumulation of multiple inputs.

Add / Sum Example:

\[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#

Pre-defined operators properties#

Operator

Scale law

Homogeneity degree

Scale composition

Parity

Commutative

Homogeneous

[1.0]

—

Even

True

Homogeneous

[1.0, 1.0]

SumBound

—

True

GeneralNonlinear

—

—

—

True

Homogeneous

[0.0]

—

—

—

Homogeneous

[0.0]

—

—

—

GeneralNonlinear

—

—

Odd

—

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

—

Homogeneous

[1.0]

—

Odd

—

GeneralNonlinear

—

—

—

—

GeneralNonlinear

—

—

—

—

ComplexToInnerPair

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

Union

Odd

—

ConnectedComponentLabeling

GeneralNonlinear

—

—

—

—

ConstantOfShape

GeneralNonlinear

—

—

—

—

Affine

—

—

—

—

Affine

—

—

—

—

Affine

—

—

—

—

ConvDepthWise1D

Affine

—

—

—

—

ConvDepthWise2D

Affine

—

—

—

—

ConvTranspose1D

Affine

—

—

—

—

ConvTranspose2D

Affine

—

—

—

—

ConvTranspose3D

Affine

—

—

—

—

GeneralNonlinear

—

—

Even

—

GeneralNonlinear

—

—

Even

—

CryptoHash

GeneralNonlinear

—

—

—

—

DepthToSpace

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0, -1.0]

Product

—

—

DropBlock

Homogeneous

[1.0]

—

Odd

—

Dropout

Homogeneous

[1.0]

—

Odd

—

GeneralNonlinear

—

—

—

True

GeneralNonlinear

—

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

GeneralNonlinear

—

—

—

—

Affine

—

—

—

—

FixedNBitFlip

GeneralNonlinear

—

—

—

—

Flatten

Homogeneous

[1.0]

—

Odd

—

GeneralNonlinear

—

—

—

—

Homogeneous

[1.0]

—

Odd

—

GatherElements

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

GlobalAveragePooling

Homogeneous

[1.0]

—

Odd

—

Greater

GeneralNonlinear

—

—

—

—

GreaterOrEqual

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]

—

—

—

LeakyReLU

Homogeneous

[1.0]

—

—

—

GeneralNonlinear

—

—

—

—

LessOrEqual

GeneralNonlinear

—

—

—

—

GeneralNonlinear

—

—

—

—

LogSoftmax

GeneralNonlinear

—

—

—

—

GeneralNonlinear

—

—

—

—

Homogeneous

[1.0, 1.0]

Product

—

—

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

—

Homogeneous

[1.0, 1.0]

Union

—

True

GeneralNonlinear

—

—

—

—

Homogeneous

[1.0, 1.0]

Product

Odd

True

NBitFlip

GeneralNonlinear

—

—

—

—

Homogeneous

[1.0]

—

Odd

—

NonZero

GeneralNonlinear

—

—

—

—

GeneralNonlinear

—

—

—

—

GeneralNonlinear

—

—

—

—

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Homogeneous

—

—

—

—

RandomNormalLike

GeneralNonlinear

—

—

—

—

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

—

Homogeneous

[1.0]

—

—

—

Reshape

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

GeneralNonlinear

—

—

—

—

Scatter

Homogeneous

[1.0]

—

Odd

—

SDLayerNorm

GeneralNonlinear

—

—

—

—

SDShiftGELU

GeneralNonlinear

—

—

—

—

SDShiftmax

GeneralNonlinear

—

—

—

—

SDShiftSiLU

GeneralNonlinear

—

—

—

—

GeneralNonlinear

—

—

—

—

GeneralNonlinear

—

—

—

—

Sigmoid

GeneralNonlinear

—

—

Odd

—

Homogeneous

—

—

Odd

—

GeneralNonlinear

—

—

Odd

—

GeneralNonlinear

—

—

Odd

—

GeneralNonlinear

—

—

—

—

Homogeneous

[1.0]

—

Odd

—

Softmax

GeneralNonlinear

—

—

—

—

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[0.5]

—

—

—

Squeeze

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0, 1.0]

SumBound

—

—

Homogeneous

[1.0, 1.0]

SumBound

—

True

SVMRegressor

GeneralNonlinear

—

—

—

—

GeneralNonlinear

—

—

Odd

—

GeneralNonlinear

—

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Transpose

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Unfold2D

Homogeneous

[1.0]

—

Odd

—

Homogeneous

[1.0]

—

Odd

—

Unsqueeze

Homogeneous

[1.0]

—

Odd

—

GeneralNonlinear

—

—

—

—