mlc-ai / mlc-llm

Universal LLM Deployment Engine with ML Compilation
https://llm.mlc.ai/
Apache License 2.0
19.2k stars 1.58k forks source link

[Question] No module named 'tvm' #330

Closed realcarlos closed 1 year ago

realcarlos commented 1 year ago

❓ General Questions

python3 build.py --hf-path=ethzanalytics/RedPajama-INCITE-Chat-3B-v1-GPTQ-4bit-128g Traceback (most recent call last): File "/Users/xxx/mlc-llm/build.py", line 8, in import tvm ModuleNotFoundError: No module named 'tvm'

and I have already installed tvm by:

python3 -m pip install tvm

sudeepag commented 1 year ago

Could you remove tvm and try to install it using pip install -I mlc_ai_nightly -f https://mlc.ai/wheels?

junrushao commented 1 year ago

Please refer to this doc for TVM installation: https://mlc.ai/mlc-llm/docs/install/tvm.html

IgnacioTechie commented 1 year ago

Same error here.

Per the instructions I run to confirm tvm install:

python -c "import tvm; print(tvm.file)" /home/nacho/.local/lib/python3.11/site-packages/tvm/init.py

python -c "import tvm; print(tvm._ffi.base._LIB)" <CDLL '/home/nacho/.local/lib/python3.11/site-packages/tvm/libtvm.so', handle 5574d7b12920 at 0x7f5101cd6150>

Then:

mlc_llm_build --help

Traceback (most recent call last): File "/home/nacho/.local/bin/mlc_llm_build", line 5, in from mlc_llm.build import main File "/home/nacho/.local/pipx/venvs/mlc-llm/lib/python3.11/site-packages/mlc_llm/init.py", line 1, in from . import dispatch File "/home/nacho/.local/pipx/venvs/mlc-llm/lib/python3.11/site-packages/mlc_llm/dispatch/init.py", line 1, in from .dispatch_tir_operator import DispatchTIROperator File "/home/nacho/.local/pipx/venvs/mlc-llm/lib/python3.11/site-packages/mlc_llm/dispatch/dispatch_tir_operator.py", line 2, in import tvm ModuleNotFoundError: No module named 'tvm'

Matthieu-Tinycoaching commented 1 year ago

Hello,

Same error here: https://github.com/mlc-ai/notebooks/issues/24

IgnacioTechie commented 1 year ago

This worked for me: pip install --pre mlc-ai-nightly -f https://mlc.ai/wheels

EntropyGenerator commented 10 months ago

Same issue when building mlc-ai from source. Solved by building tvm. (I have vulkan problem when using prebuild package.)

ykz9527 commented 7 months ago

you can exec: export PYTHONPATH=$PYTHONPATH:/your-path/mlc-llm/3rdparty/tvm/python/

shanofrahman commented 2 months ago

For me this works on Google Colab

!python3 -m pip install --pre -U mlc-ai-nightly -f https://mlc.ai/wheels