[Relax][ONNX] Fix get_converter selecting wrong impl when opset < minimum supported version by Aharrypotter · Pull Request #18911 · apache/tvm

@Aharrypotter

@Aharrypotter

…imum supported version

When no _impl_vN version exists for the given opset, the bisect-based index
becomes 0; subtracting 1 gives -1, and Python negative indexing silently
selects the latest (incompatible) implementation. For example, ReduceMean
with opset=9 was mapped to _impl_v18 instead of raising an error, producing
wrong output shapes.

Fix by filtering to compatible versions first and raising NotImplementedError
when none exist.

Fixes apache#18698

gemini-code-assist[bot]

Comment on lines +306 to +310

Comment on lines +3983 to +4012