llvm / llvm/torch-mlir

Assertion `isa<U>()' failed error

Open
#746 9 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

We ran into some errors while running torch-mlir on our model. However, we are not sure why this error occurs and it is hard to track which function is causing it. We suspect that it has to do with the use of the `.view()` function. It will be great if someone could help identify and fix this issue, thanks!

Here are the mlir codes after the 'torchscript-module-to-torch-backend-pipeline' pass: https://github.com/ZhanqiuHu/torch-mlir-issue/blob/main/test.mlir

And the error message is:
python: /work/shared/users/ugrad/zh338/torch-mlir/external/llvm-project/mlir/include/mlir/IR/Types.h:251: U mlir::Type::cast() const [with U = mlir::RankedTensorType]: Assertion `isa()' 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 examining the linked test.mlir produced after the torchscript-module-to-torch-backend-pipeline pass, then trace the assertion at external/llvm-project/mlir/include/mlir/IR/Types.h:251. Reproduce the failure and determine which function or use of .view() causes a non-RankedTensorType to be cast. Done means the cause is identified and the assertion-triggering issue is fixed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, 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.