Supported ONNX Operators
This chapter describes the ONNX operations currently supported by DX-COM. When you build or export models to ONNX format, you must use only the supported operations to ensure successful compilation and optimal performance on our NPU.
Operator Support Details
The following ONNX operators are supported by the compiler.
Common Conditions (Applicable to All Operation Types)
Tensor Shape Limitations
- Width, height: < 8,192
- Channels: < 32,768
- Dynamic shapes are not supported.
Broadcasting Restrictions
- In element-wise operations like Add, Div, Mul, and Sub, channel-wise broadcasting is not supported when the channel dimension size is greater than 1.
- Example: A tensor with shape 1x24x24x1 (NHWC) cannot be broadcast to shape 1x24x24x32.
Normal Operations
| Operator | Supported Conditions |
|---|---|
| Add | Supported as: - Bias addition (e.g., as part of Gemm or Conv) - Element-wise addition - Used for input normalization - Constant scalar addition |
| ArgMax | Only supported if all of the following hold: - It is the final operation in the network - The preceding output is 2D or 4D - It operates along the channel dimension |
| AveragePool | - kernel_shape < 32 - strides < 32 |
| BatchNormalization | No restrictions |
| Clip | Only supported as an activation function (e.g., ReLU6) |
| Concat | No restrictions |
| Constant | Only numeric constants are supported |
| ConstantOfShape | No restrictions |
| Conv | Common constraints: - dilations < 64 - pads < 64 - strides < 16 Standard Conv: - kernel_shape < 16 Depth-wise Conv: - kernel_shape < 16 - dilations = [1, 1], except a 3×3 kernel with dilations = [2, 2] - Only constant weights are supported 5D input (3 spatial dims): additionally requires - group = 1 - dilations = [1, 1, 1] - auto_pad = NOTSET - Weight must be a compile-time constant Otherwise runs on CPU. |
| ConvTranspose | - dilations = [1, 1] - output_padding = [0, 0] - pads ≤ 14 - strides ∈ [2, 8] and symmetric (strides[0] = strides[1]) - kernel_shape < 16 - group = 1 5D input (3 spatial dims): additionally requires - group = 1 - dilations = [1, 1, 1] - output_padding = [0, 0, 0] - auto_pad = NOTSET - No output_shape attribute Otherwise runs on CPU. |
| Div | Supported as: - Constant scalar division - Input normalization - Part of Softmax - Part of LayerNorm |
| Dropout | Removed during inference |
| Einsum | Only supported for two-input equations that reduce to a (batched) matrix multiplication: - Exactly one contracted (summed) index shared between the two inputs - Each input has exactly one non-batch, non-contracted free index, and it must appear in the output - Any leading indices identical across both inputs and the output are treated as batch dimensions Examples: ij,jk->ik, bij,bjk->bik, bik,bjk->bij Single-input equations (e.g. diagonal, transpose, reduction) and equations with three or more inputs are not supported. |
| Erf | Only supported as part of GELU |
| Flatten | No restrictions |
| Gather | Supported when indices is a 0-D, 1-D, or 2-D tensor. Examples: - Scalar index: indices = [0] to select first element - 1-D index: indices = [0, 2, 5] to select multiple elements - 2-D index (New in v2.5.0): indices = [[0, 2], [1, 3]] to select a 2-D block of elements |
| Gemm | No restrictions |
| GlobalAveragePool | No restrictions |
| Identity | No restrictions |
| LayerNormalization | Only supported when normalizing over the last dimension: - axis = -1 (or the index of the last dimension) - Scale and B have shape [D], where D is the size of the last dimension (B is optional) - D < 4080; otherwise runs on CPU Not supported: - Normalizing over multiple dimensions (e.g., PyTorch nn.LayerNorm([C, H, W])) LayerNorm built from ReduceMean, Sub, Pow, Sqrt, Div, Mul, and Add is also supported when the mean and variance are computed over a single dimension (the last dimension, or the channel dimension of an NCHW tensor such as ConvNeXt LayerNorm2d). If they are computed over multiple dimensions, it runs on CPU. |
| MatMul | No restrictions |
| MaxPool | - kernel_shape < 16 - strides < 16 |
| Mul | Supported as: - Element-wise multiplication - Constant scalar multiplication - Input normalization |
| Pad | - Only mode=constant is supported - Must precede a Pool or Conv operation |
| ReduceMean | Only supported when reducing along: - Channel dimension - (Width, Height) dimensions |
| ReduceSum | Only supported when reducing along the channel dimension |
| Reshape | No restrictions |
| Resize | Only supported with the following attributes: - coordinate_transformation_mode = pytorch_half_pixel - mode ∈ {nearest, linear} Upsampling - scale > 1 - linear - s ∈ ℤ, s ≥ 2, s ∉ {p : p is prime, p > 8} - i.e. integer factors ≥ 2; primes > 8 (11, 13, 17, …) are not supported, while non-prime factors such as 9, 10 are supported - nearest - s ∈ {2^k : k ≥ 1} - powers of two only ( 2, 4, 8, 16, …) Downsampling - scale < 1 - linear - s = 0.5 - only a scale factor of 0.5 is supported - nearest - not supported |
| Shape | Cannot be used as a model output |
| Slice | No restrictions |
| Softmax | Only supported if the size of the input along the specified axis is < 4080 |
| Split | No restrictions |
| Squeeze | No restrictions |
| Sub | Supported as: - Element-wise subtraction - Constant scalar subtraction - Input normalization |
| Transpose | No restrictions |
Activation Functions
| Operator | Supported Conditions |
|---|---|
| Elu | No restrictions |
| Gelu | No restrictions |
| HardSwish | No restrictions |
| HardSigmoid | No restrictions |
| LeakyRelu | No restrictions |
| Mish | No restrictions |
| PRelu | No restrictions on functionality. Known issue (v2.4.0): models using PRelu as an activation function exhibit significant FPS degradation on the NPU runtime. Use LeakyRelu or Relu where possible until this is resolved in a future release. See the Known Issues section in Change Log for details. |
| Relu | No restrictions |
| Selu | No restrictions |
| Sigmoid | No restrictions |
| Silu (Swish) | No restrictions |
| Softplus | No restrictions |
| Tanh | No restrictions |
Deprecated Operations
The following operations are deprecated in ONNX and maintained here only for backward compatibility. Their usage is discouraged in new models and may be removed in future versions.
Please use alternative operators where possible.
| Operator | Supported Conditions |
|---|---|
| Upsample | Only supported when scale values in the N and C dimensions are 1 |
The operator support may vary depending on how operations are combined within a model. This document is intended as a general guideline. For validation of specific use cases, please contact our technical support team.