llvm / llvm/torch-mlir

import-onnx support on onnx.Clip but --convert-torch-onnx-to-torch failed

Open
#2,822 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

c1.mlir:112:12: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
%109 = torch.operator "onnx.Clip"(%106, %107, %108) : (!torch.vtensor<[1,32,112,112],f32>, !torch.vtensor<[],f32>, !torch.vtensor<[],f32>) -> !torch.vtensor<[1,32,112,112],f32>
^
c1.mlir:112:12: note: see current operation: %123 = "torch.operator"(%120, %121, %122) <{name = "onnx.Clip"}> : (!torch.vtensor<[1,32,112,112],f32>, !torch.vtensor<[],f32>, !torch.vtensor<[],f32>) -> !torch.vtensor<[1,32,112,112],f32>

import-onnx support on onnx.Clip but --convert-torch-onnx-to-torch failed

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 by reproducing the reported failure with --convert-torch-onnx-to-torch and inspect the generated c1.mlir operation at line 112, where onnx.Clip remains as torch.operator. Trace how import-onnx handles onnx.Clip and determine what is needed for the conversion to legalize it; done means the reported model conversion completes without this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, pytorch
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.