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

[Question] Unable to install mlc-llm - error: module 'tvm.script.parser.tir' has no attribute 'bitwise_and' #832

Closed
qizzzh opened this issue Aug 29, 2023 · 12 comments
Labels
question Question about the usage

Comments

@qizzzh
Copy link

qizzzh commented Aug 29, 2023

Steps I followed:

---- > Traceback (most recent call last):
File "/usr/local/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 110, in _get_module_details
import(pkg_name)
File "/Users/qzhou/mlc-llm/mlc_llm/init.py", line 1, in
from . import dispatch
File "/Users/qzhou/mlc-llm/mlc_llm/dispatch/init.py", line 1, in
from .dispatch_tir_operator import DispatchTIROperator
File "/Users/qzhou/mlc-llm/mlc_llm/dispatch/dispatch_tir_operator.py", line 2, in
import tvm
ModuleNotFoundError: No module named 'tvm'

  • pip3 install --upgrade apache-tvm
  • python3 -m mlc_llm.build --help

---- > error: module 'tvm.script.parser.tir' has no attribute 'bitwise_and'
--> /home/qzhou/mlc-llm/mlc_llm/dispatch/dispatch_tir_operator_adreno.py:26:21
|
26 | T.bitwise_and(
| ^^^^^^^^^^^^^
note: run with TVM_BACKTRACE=1 environment variable to display a backtrace.

pip3 list | grep tvm
apache-tvm 0.11.1

pip3 list | grep mlc
mlc-llm 0.1.dev391+g2ae8907

@qizzzh qizzzh added the question Question about the usage label Aug 29, 2023
@qizzzh
Copy link
Author

qizzzh commented Aug 29, 2023

Installed a newer version tvm and now hit a different issue

pip3 install apache-tvm==0.14.dev148

python3 -m mlc_llm.build --help
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/home/qzhou/.local/lib/python3.8/site-packages/mlc_llm/init.py", line 2, in
from . import quantization
File "/home/qzhou/.local/lib/python3.8/site-packages/mlc_llm/quantization/init.py", line 1, in
from .quantization import FQuantize
File "/home/qzhou/.local/lib/python3.8/site-packages/mlc_llm/quantization/quantization.py", line 6, in
from tvm import relax, te
ImportError: cannot import name 'relax' from 'tvm' (/home/qzhou/.local/lib/python3.8/site-packages/tvm/init.py)

@qizzzh qizzzh changed the title [Question] Unable to install mlc-llm - error: module 'tvm.script.parser.tir' has no attribute 'bitwise_and' [BUG] Unable to install mlc-llm - error: module 'tvm.script.parser.tir' has no attribute 'bitwise_and' Aug 29, 2023
@qizzzh qizzzh changed the title [BUG] Unable to install mlc-llm - error: module 'tvm.script.parser.tir' has no attribute 'bitwise_and' [Question] Unable to install mlc-llm - error: module 'tvm.script.parser.tir' has no attribute 'bitwise_and' Aug 29, 2023
@qizzzh
Copy link
Author

qizzzh commented Aug 29, 2023

Tried a few other versions. No luck.

@aowen14
Copy link

aowen14 commented Aug 29, 2023

Like the OP, I got:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/home/lambda1/AlexCode/mlc-llm/mlc_llm/init.py", line 1, in
from . import dispatch
File "/home/lambda1/AlexCode/mlc-llm/mlc_llm/dispatch/init.py", line 1, in
from .dispatch_tir_operator import DispatchTIROperator
File "/home/lambda1/AlexCode/mlc-llm/mlc_llm/dispatch/dispatch_tir_operator.py", line 2, in
import tvm
after running the steps:
git clone --recursive https://github.com/mlc-ai/mlc-llm.git
cd mlc-llm
pip install .
python3 -m mlc_llm.build --help

Also got this when using the conda install steps available here: https://mlc.ai/package/
conda create -n mlc-chat-venv -c mlc-ai -c conda-forge mlc-chat-nightly
conda activate mlc-chat-venv

@MasterJH5574
Copy link
Collaborator

Hello folks, I don't think it's necessary to run pip install .. We will examine if the instruction is redundant. Just cloning the repo is fine.

Meanwhile, to install TVM, we recommend use the pip instructions as listed in https://mlc.ai/package/ to install the TVM nightly build.

@qizzzh
Copy link
Author

qizzzh commented Aug 29, 2023

The pip install . is in the instructions.

https://mlc.ai/package/ doesn't work for me, same issue as #803.

@qizzzh
Copy link
Author

qizzzh commented Aug 29, 2023

@MasterJH5574 any idea on how to fix it? I'm not able to run mlc-llm.

@Hzfengsy
Copy link
Member

Sorry, we are not experts in PyPI packaging. We provide x86_64 Linux wheels, and we do not know why it fails on some devices.

We are more than happy to help build new wheels if you can provide the instructions :)

@Hzfengsy Hzfengsy closed this as completed Sep 4, 2023
@qizzzh
Copy link
Author

qizzzh commented Sep 4, 2023

Is there any fix pushed? Apparently I'm not the only one hitting the issue.

@Hzfengsy
Copy link
Member

Hzfengsy commented Sep 4, 2023

The original issue is resolved I think, as you are using the wrong package (apache-tvm vs. mlc wheels).

As for the PyPi issue, another issue #803 is still open.

Meanwhile, I recommend you compile MLC wheels from the source if possible. Feel free to open another issue if you face problems during compiling

@ZhenyuYangGithub
Copy link

Is there any fix pushed? Apparently I'm not the only one hitting the issue.

Did you solve the problem?

@ZhenyuYangGithub
Copy link

The original issue is resolved I think, as you are using the wrong package (apache-tvm vs. mlc wheels).

As for the PyPi issue, another issue #803 is still open.

Meanwhile, I recommend you compile MLC wheels from the source if possible. Feel free to open another issue if you face problems during compiling

How do we solve the original issue?

@junrushao
Copy link
Member

This particular issue means you guys are not installing a correct pypi package…I don’t know who released this apache-tvm package but it’s apparently not right.

Please refer to our instructions for more details on how to install TVM Unity: https://llm.mlc.ai/docs/install/tvm.html#option-1-prebuilt-package

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

No branches or pull requests

6 participants