Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'torch_mlir._mlir_libs._jit_ir_importer' #3691

Open
MIONkb opened this issue Sep 9, 2024 · 2 comments
Open

No module named 'torch_mlir._mlir_libs._jit_ir_importer' #3691

MIONkb opened this issue Sep 9, 2024 · 2 comments

Comments

@MIONkb
Copy link

MIONkb commented Sep 9, 2024

I installed torch-mlir with following script in my own conda env, where 20240825.194 is the newest torch-mlir in the url https://github.com/llvm/torch-mlir-release/releases/expanded_assets/dev-wheels

pip3 install --pre torch-mlir==20240825.194 torchvision \ -f https://github.com/llvm/torch-mlir-release/releases/expanded_assets/dev-wheels \ --extra-index-url https://download.pytorch.org/whl/nightly/cpu

Then I run the torchscript_resnet18_all_output_types.py in /projects/pt1/examples, then error happens:

File "/home/jhlou/Torchmlir/test/simple/torchscript_resnet18_all_output_types.py", line 9, in <module> from torch_mlir import torchscript File "/home/jhlou/anaconda3/lib/python3.11/site-packages/torch_mlir/torchscript.py", line 25, in <module> from torch_mlir.jit_ir_importer import ClassAnnotator, ImportOptions, ModuleBuilder File "/home/jhlou/anaconda3/lib/python3.11/site-packages/torch_mlir/jit_ir_importer/__init__.py", line 14, in <module> from .._mlir_libs._jit_ir_importer import * ModuleNotFoundError: No module named 'torch_mlir._mlir_libs._jit_ir_importer'

Acctually, when I check the anaconda3/lib/python3.11/site-packages/torch_mlir dir, the jit_ir_importer is not in 'torch_mlir._mlir_libs..

How could I install torch-mlir python package correctly? Or did I run it in a wrong way?

This is the "torchscript_resnet18_all_output_types.py"

`

import torch
import torchvision

from torch_mlir import torchscript

resnet18 = torchvision.models.resnet18(pretrained=True)
resnet18.eval()

module = torchscript.compile(resnet18, torch.ones(1, 3, 224, 224), output_type="torch")
print("TORCH OutputType\n", module.operation.get_asm(large_elements_limit=10))
module = torchscript.compile(
resnet18, torch.ones(1, 3, 224, 224), output_type="linalg-on-tensors"
)
print(
"LINALG_ON_TENSORS OutputType\n", module.operation.get_asm(large_elements_limit=10)
)

module = torchscript.compile(resnet18, torch.ones(1, 3, 224, 224), output_type="tosa")
print("TOSA OutputType\n", module.operation.get_asm(large_elements_limit=10))

`

@AmosLewis
Copy link
Collaborator

will be fixed by #3693

@MIONkb
Copy link
Author

MIONkb commented Sep 10, 2024

will be fixed by #3693

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants