mlc-llm icon indicating copy to clipboard operation
mlc-llm copied to clipboard

[Bug] Compiling the MLC from source is failed

Open fengerhu1 opened this issue 9 months ago • 2 comments

🐛 Bug

I execute the following scripts (from https://llm.mlc.ai/docs/install/mlc_llm.html#install-mlc-packages) to build the MLC-llm from the source code, but it fails.

Script:

# clone from GitHub
git clone --recursive https://github.com/mlc-ai/mlc-llm.git && cd mlc-llm/
# create build directory
mkdir -p build && cd build
# generate build configuration
python3 ../cmake/gen_cmake_config.py
# build mlc_llm libraries
cmake .. && cmake --build . --parallel $(nproc) && cd ..

Error:

./mlc-llm/3rdparty/tvm/src/runtime/contrib/thrust/thrust.cu(92): error: namespace "thrust::cuda" has no member "par_nosync"
./mlc/mlc-llm/3rdparty/tvm/src/runtime/contrib/thrust/thrust.cu(110): error: no instance of overloaded function "thrust::copy" matches the argument list argument types are: (<error-type>, thrust::device_ptr<half>, thrust::device_ptr<half>, thrust::device_ptr<half>)
...

I suspect it may be related to the version of CUDA. Could you tell me which CUDA version has been successfully used for stable compilation?

My cuda version is: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:33:58_PDT_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0

fengerhu1 avatar May 09 '24 11:05 fengerhu1

Hi @fengerhu1, our thrust integration doesn't support CUDA < 12. You can either upgrade CUDA to at least 12, or open build/config.cmake and change set(USE_THRUST ON) to set(USE_THRUST OFF) (which may hurt performance, though).

MasterJH5574 avatar May 10 '24 14:05 MasterJH5574

Yes, it works now, thanks!

fengerhu1 avatar May 11 '24 01:05 fengerhu1