Skip to content

[Tracking Issue][ONNX] Complete missing and limited operators in ONNX frontend #18945

@tlopex

Description

@tlopex

The Relax ONNX frontend (python/tvm/relax/frontend/onnx/onnx_frontend.py) currently supports 157 operators. However, 7 operators are commented out in the converter map, and 11 have known limitations. This issue tracks completing support for these operators.

Scope

Each missing operator needs:

  1. Converter implementation in onnx_frontend.py
  2. Tests in tests/python/relax/test_frontend_from_onnx.py

Each limited operator needs the specific restriction lifted and corresponding test coverage added.

Missing operators (commented out in converter map)

Tier 1 — High value

  • If — ONNX control flow (conditional branching). Needed for models with runtime-dependent execution paths.
  • MatMulInteger — INT8 matrix multiplication. Required for quantized model inference (e.g. ONNX QDQ models).

Tier 2 — Lower priority

  • MaxRoiPool — Max ROI pooling.
  • MatMulInteger16 — INT16 matrix multiplication. Rarely used.
  • Optional / OptionalHasElement / OptionalGetElement — ONNX Optional type handling. Used in some models with optional outputs.

Operators with known limitations

Shape/dynamic restrictions

  • Unsqueeze — Does not support symbolic axes or dynamic axes. Only constant axes work.
  • Squeeze — Does not support symbolic axes.
  • Slice — Only supports constant parameters. Dynamic/symbolic start, end, step not supported.
  • Reshape — Special case for shape [-1] not fully handled.

Op-specific restrictions

  • ConvTranspose — Does not support 3D (ConvTranspose3d, ndim=5).
  • Resize — Does not support dynamic ROI.
  • ArgMax / ArgMin — Does not support select_last_index attribute.
  • SequenceInsert — Does not support inserting with new axis.
  • SplitToSequence — Only supports keepdims=1.

Implementation reference

  • Converter base class: OnnxOpConverter in onnx_frontend.py
  • Converter map: _get_convert_map() (line 3937)
  • Existing tests: tests/python/relax/test_frontend_from_onnx.py

The shape/dynamic restriction fixes (Unsqueeze, Squeeze, Slice) are good first issues — the converter class already exists, just needs to handle additional cases.

If you're interested in contributing, please comment below to claim a task before starting work.

cc @KJlaccHoeUM9l

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions