mlc-ai / mlc-llm

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

[Bug] ValueError: The block no longer exists in the IRModule Stack trace not available when DMLC_LOG_STACK_TRACE is disabled at compile time. #1318

Closed tao-began closed 11 months ago

tao-began commented 11 months ago

🐛 Bug

ValueError: The block no longer exists in the IRModule Stack trace not available when DMLC_LOG_STACK_TRACE is disabled at compile time.

To Reproduce

Steps to reproduce the behavior: python -m mlc_llm.build --model Llama-2-7b-chat-hf --target vulkan --quantization q4f16_1

D:\a\package\package\tvm\src\tir\schedule./concrete_schedule.h:285: ValueError: The block no longer exists in the IRModule Stack trace not available when DMLC_LOG_STACK_TRACE is disabled at compile time. Traceback (most recent call last): File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\contrib\cc.py", line 323, in _windows_compile proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) File "D:\Program\Anaconda3\envs\mcl-win\lib\subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "D:\Program\Anaconda3\envs\mcl-win\lib\subprocess.py", line 1456, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Program\Anaconda3\envs\mcl-win\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Program\Anaconda3\envs\mcl-win\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "E:\code\mlc-llm-win\mlc-llm\mlc_llm\build.py", line 47, in main() File "E:\code\mlc-llm-win\mlc-llm\mlc_llm\build.py", line 43, in main core.build_model_from_args(parsed_args) File "E:\code\mlc-llm-win\mlc-llm\mlc_llm\core.py", line 923, in build_model_from_args build(mod, args) File "E:\code\mlc-llm-win\mlc-llm\mlc_llm\core.py", line 762, in build ex.export_library(args.lib_path, args.export_kwargs) File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\relax\vm_build.py", line 146, in export_library return self.mod.export_library( File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\runtime\module.py", line 624, in export_library return fcompile(file_name, files, kwargs) File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\contrib\cc.py", line 89, in create_shared _windows_compile(output, objects, options) File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\contrib\cc.py", line 326, in _windows_compile raise RuntimeError( RuntimeError: Can not find the LLVM clang for Windows clang.exe).Make sure it's installed and the installation directory is in the %PATH% environment variable. Prebuilt binaries can be found at: https://llvm.org/

Expected behavior

Environment

Additional context

tao-began commented 11 months ago

D:\a\package\package\tvm\src\tir\schedule./concrete_schedule.h:285: ValueError: The block no longer exists in the IRModule Stack trace not available when DMLC_LOG_STACK_TRACE is disabled at compile time. Traceback (most recent call last): File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\contrib\cc.py", line 323, in _windows_compile proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) File "D:\Program\Anaconda3\envs\mcl-win\lib\subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "D:\Program\Anaconda3\envs\mcl-win\lib\subprocess.py", line 1456, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Program\Anaconda3\envs\mcl-win\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\Program\Anaconda3\envs\mcl-win\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "E:\code\mlc-llm-win\mlc-llm\mlc_llm\build.py", line 47, in main() File "E:\code\mlc-llm-win\mlc-llm\mlc_llm\build.py", line 43, in main core.build_model_from_args(parsed_args) File "E:\code\mlc-llm-win\mlc-llm\mlc_llm\core.py", line 923, in build_model_from_args build(mod, args) File "E:\code\mlc-llm-win\mlc-llm\mlc_llm\core.py", line 762, in build ex.export_library(args.lib_path, args.export_kwargs) File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\relax\vm_build.py", line 146, in export_library return self.mod.export_library( File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\runtime\module.py", line 624, in export_library return fcompile(file_name, files, kwargs) File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\contrib\cc.py", line 89, in create_shared _windows_compile(output, objects, options) File "D:\Program\Anaconda3\envs\mcl-win\lib\site-packages\tvm\contrib\cc.py", line 326, in _windows_compile raise RuntimeError( RuntimeError: Can not find the LLVM clang for Windows clang.exe).Make sure it's installed and the installation directory is in the %PATH% environment variable. Prebuilt binaries can be found at: https://llvm.org/

上面的报错,通过指定llvm和打开windows的WSL已解决 运行指令如下 python -m mlc_llm.build --model Llama-2-7b-chat-hf --target vulkan --quantization q4f16_1 --llvm-mingw llvm-mingw-20231114-ucrt-x86_64/x86_64-w64-mingw32

junrushao commented 11 months ago

The actual error message is:

RuntimeError: Can not find the LLVM clang for Windows clang.exe)

Alternatively if you don’t like WSL, in CMD with conda, you may install clang via:

conda install -c conda-forge clangdev

Hzfengsy commented 11 months ago

@Tao-begd Feel free to close it if the problem is solved