llvm / llvm/torch-mlir

[ONNX] Dynamic size support for the onnx.GreaterOrEqual operator.

Open
#3,129 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.9k
Forks
736
Avg merge
5d 22h
Merged PRs (30d)
15

Description

Hello, community. I have an ONNX model used the onnx.GreaterOrEqual operator. It encountered an error while converting to Torch.

onnx.mlir:1045:13: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
    %1041 = torch.operator "onnx.GreaterOrEqual"(%1040, %292) : (!torch.vtensor<[?],si64>, !torch.vtensor<[],si64>) -> !torch.vtensor<[?],i1> 
            ^
cvr.onnx.mlir:1045:13: note: see current operation: %7976 = "torch.operator"(%7975, %585) <{name = "onnx.GreaterOrEqual"}> : (!torch.vtensor<[?],si64>, !torch.vtensor<[],si64>) -> !torch.vtensor<[?],i1>

I noticed it failed here. https://github.com/llvm/torch-mlir/blob/main/lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp#L550

image

Is there a plan in the community to support this conversion, or can I participate in the community to implement it? Thank you!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp near line 550, where the onnx.GreaterOrEqual conversion was reported to fail. Reproduce the model conversion and inspect the dynamic and scalar operand types shown in the error. Done means this dynamic-size GreaterOrEqual operation converts without the illegal torch.operator error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.