llvm / llvm/torch-mlir

meet error: 'torch.type_bound' must be attached to an argument of !torch.tensor/!torch.vtensor type

Open
#1,968 3 comments 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

hi
use torch-mlir, the test program as below:

@torch.jit.script
def prim_Loop_whilelike(n: int):
f = 3.2
while f < n:
f = f * f
return f
lg = torch.jit.script(prim_Loop_whilelike)
torch.jit.save(lg, "45.pt")
model = torch.jit.load("45.pt", map_location=torch.device('cpu'))
module = torch_mlir.compile(model, [torch.tensor(20)], output_type="torch", verbose=True)

pls help me to fix it ASAP, thanks

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 provided torch.jit and torch_mlir.compile program with verbose output to confirm the type_bound error. Trace where the reported error is emitted and determine the expected handling for this loop; done means the example compiles without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
compilers, machine-learning
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.