Repository navigation
Description
Context
The Relax ONNX frontend currently implements ~160 operators from the ONNX spec. Comparing against the current operator list (https://onnx.ai/onnx/operators/index.html), a number of ops are not yet supported.
Before opening PRs, I'd like to check on priorities/approach with maintainers. I went through python/tvm/relax/op/ and python/tvm/topi/ to check what's actually available to build on, rather than guessing from op names alone, so the grouping below reflects what I found there.
Missing operators
| Category | Operators |
|---|---|
| Activations / math | Celu, Swish, LpNormalization, LinearAttention, Det, Col2Im, TensorScatter |
| Casting / bit-level | CastLike, BitCast |
| Cropping / sequence | CenterCropPad, ReverseSequence, SequenceMap |
| Normalization | GroupNormalization |
| Recurrent networks | RNN, GRU, LSTM |
| Convolution | ConvInteger, DeformConv, CausalConvWithState |
| Quantization | QLinearConv, QLinearMatMul |
| Random / sampling | RandomNormal, RandomNormalLike, RandomUniform, RandomUniformLike, Multinomial, Bernoulli |
| Signal processing | DFT, STFT, BlackmanWindow, HammingWindow, HannWindow, MelWeightMatrix |
| Control flow | Loop, Scan |
| Loss functions | NegativeLogLikelihoodLoss, SoftmaxCrossEntropyLoss |
| String / text | StringConcat, StringSplit, StringNormalizer, RegexFullMatch, TfIdfVectorizer |
| Attention / misc | RotaryEmbedding, ImageDecoder |
Implementation notes
These vary a lot in difficulty. Some already have a clear path based on what's in the codebase:
- RNN, GRU, LSTM - no fused recurrent op in Relax, but the torch and tflite Relax frontends already implement LSTM by unrolling the recurrence with existing ops; the ONNX converter could follow the same pattern.
- CastLike, Swish - Relax has direct equivalents (
astype,nn.silu) that cover the common case (defaultalpha=1.0for Swish; standard dtype casts for CastLike). Non-default variants (float8round_mode/saturatefor CastLike, non-unit alpha for Swish) would need a small amount of extra composition. - CumProd, ReverseSequence - Relax has ops covering the same purpose (
cumprod,reverse_sequence), but attribute defaults/semantics differ from the ONNX spec (Relax'scumprodhas no reverse mode;reverse_sequence's axis defaults are swapped relative to ONNX'stime_axis/batch_axis), so the converter needs explicit attribute mapping rather than a pass-through.
Others (quantized conv/matmul, signal processing, Loop/Scan) likely need new compute/schedule work or, in the case of Loop/Scan, graph-level control-flow support. I'm not certain of the right approach here and would appreciate maintainer input.
Questions for maintainers
- Is there an existing priority order for ONNX op coverage, or known user demand for any of the above from specific model families?
- Are any of these considered out of scope or low priority for the Relax frontend (e.g. control flow, quantized ops, signal processing)?
Proposal
I'd like to pick up work on some of these, starting with the ones that have a clear implementation path (CastLike, Swish, ReverseSequence, CumProd attribute mapping, then RNN/GRU/LSTM via unrolling).
Questions for the maintainers
- Is there an existing priority order for ONNX op coverage, or known user demand for any of the above from specific model families?
- Are any of these (e.g. control flow, quantized ops, signal processing) considered out of scope or low priority for the Relax frontend?
Happy to pick up items above, split into smaller PRs by category, and help review PRs from others in this area as it progresses.
Triage
- needs-triage
- frontend:onnx
- status: RFC
Activity
keepgoong commentedon Sep 10, 2026
@OmarAzizi I have been paying attention to this area recently and am very willing to participate in the support of onnx operators. Is there any progress?
[Relax][ONNX] Add ReverseSequence, CumProd, SoftmaxCrossEntropyLoss c…
[Relax][Frontend] Add missing frontend operators: ONNX Swish/ReverseS…
[Relax][ONNX] Add Swish and Celu operator converters
[Relax][ONNX] Add ReverseSequence, CumProd, SoftmaxCrossEntropyLoss c…
[Relax][ONNX] Add Swish and Celu operator converters
[Relax][ONNX] Add ReverseSequence, CumProd, SoftmaxCrossEntropyLoss c…
[Relax][Frontend] Add missing frontend operators: ONNX Swish/ReverseS…
hiyufan commentedon Oct 25, 2026
I am picking up the LpNormalization converter from this list. Current main (
e345029c) rejects checker-valid models. I plan to compose existing Relax operators for L1/L2 normalization, including negative values, zero-norm slices, default/explicit axes, dtype preservation and symbolic shapes. I checked open PRs and did not find an LpNormalization implementation; this work is separate from the existing normalization and Swish/ReverseSequence PRs.hiyufan commentedon Oct 25, 2026
I also checked HannWindow, HammingWindow and BlackmanWindow from this list: checker-valid models are rejected on current main, and I found no existing implementation PR. I am preparing a separate, shared cosine-sum converter for these three related operators, covering initializer/runtime lengths, int32/int64 size inputs, periodic/symmetric modes, numeric output casts and zero/one-length cases. I will keep this separate from LpNormalization so each change can be reviewed independently.