Closed tinafhx0 closed 1 year ago
I install tvm according https://mlc.ai/mlc-llm/docs/install/tvm.html#id7 and modify the config.cmake like: set(USE_LLVM ON) set(USE_VULKAN ON) set(USE_OPENCL ON) set(CMAKE_BUILD_TYPE RelWithDebInfo) set(HIDE_PRIVATE_SYMBOLS ON)
cmake version 3.26.2 llvm-config version is 16.0.0
python3 -c "import tvm; print('\n'.join(f'{k}: {v}' for k, v in tvm.support.libinfo().items()))" USE_GTEST: AUTO SUMMARIZE: OFF USE_IOS_RPC: OFF USE_ETHOSU: OFF CUDA_VERSION: NOT-FOUND USE_LIBBACKTRACE: AUTO DLPACK_PATH: 3rdparty/dlpack/include USE_TENSORRT_CODEGEN: OFF USE_THRUST: OFF USE_TARGET_ONNX: OFF USE_AOT_EXECUTOR: ON BUILD_DUMMY_LIBTVM: OFF USE_CUDNN: OFF USE_TENSORRT_RUNTIME: OFF USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR: OFF USE_CCACHE: AUTO USE_ARM_COMPUTE_LIB: OFF USE_CPP_RTVM: OFF USE_OPENCL_GTEST: /path/to/opencl/gtest USE_MKL: OFF USE_PT_TVMDSOOP: OFF USE_CLML: OFF USE_STACKVM_RUNTIME: OFF USE_GRAPH_EXECUTOR_CUDA_GRAPH: OFF ROCM_PATH: /opt/rocm USE_DNNL: OFF USE_VITIS_AI: OFF USE_LLVM: ON USE_VERILATOR: OFF USE_TF_TVMDSOOP: OFF USE_THREADS: ON USE_MSVC_MT: OFF BACKTRACE_ON_SEGFAULT: OFF USE_GRAPH_EXECUTOR: ON USE_ROCBLAS: OFF GIT_COMMIT_HASH: c5c14dcff648d8be1729dfff99068b8a0b6224a3 USE_VULKAN: ON USE_RUST_EXT: OFF USE_CUTLASS: OFF USE_CPP_RPC: OFF USE_HEXAGON: OFF USE_CUSTOM_LOGGING: OFF USE_UMA: OFF USE_FALLBACK_STL_MAP: OFF USE_SORT: ON USE_RTTI: ON GIT_COMMIT_TIME: 2023-07-06 14:35:49 -0400 USE_HEXAGON_SDK: /path/to/sdk USE_BLAS: none USE_ETHOSN: OFF USE_LIBTORCH: OFF USE_RANDOM: ON USE_CUDA: OFF USE_COREML: OFF USE_AMX: OFF BUILD_STATIC_RUNTIME: OFF USE_CMSISNN: OFF USE_KHRONOS_SPIRV: OFF USE_CLML_GRAPH_EXECUTOR: OFF USE_TFLITE: OFF USE_HEXAGON_GTEST: /path/to/hexagon/gtest PICOJSON_PATH: 3rdparty/picojson USE_OPENCL_ENABLE_HOST_PTR: OFF INSTALL_DEV: OFF USE_PROFILER: ON USE_NNPACK: OFF LLVM_VERSION: 16.0.0 USE_OPENCL: ON COMPILER_RT_PATH: 3rdparty/compiler-rt RANG_PATH: 3rdparty/rang/include USE_SPIRV_KHR_INTEGER_DOT_PRODUCT: OFF USE_OPENMP: none USE_BNNS: OFF USE_CUBLAS: OFF USE_METAL: OFF USE_MICRO_STANDALONE_RUNTIME: OFF USE_HEXAGON_EXTERNAL_LIBS: OFF USE_ALTERNATIVE_LINKER: AUTO USE_BYODT_POSIT: OFF USE_HEXAGON_RPC: OFF USE_MICRO: OFF DMLC_PATH: 3rdparty/dmlc-core/include INDEX_DEFAULT_I64: ON USE_RELAY_DEBUG: OFF USE_RPC: ON USE_TENSORFLOW_PATH: none TVM_CLML_VERSION: USE_MIOPEN: OFF USE_ROCM: OFF USE_PAPI: OFF USE_CURAND: OFF TVM_CXX_COMPILER_PATH: /usr/bin/c++ HIDE_PRIVATE_SYMBOLS: ON
python3 -c "import tvm; print(tvm.file)" /media/data/networkcode/tvm-unity/python/tvm/init.py python3 -c "import tvm; print(tvm._ffi.base._LIB)" <CDLL '/media/data/networkcode/tvm-unity/build/libtvm.so', handle 104f3b0 at 0x7fe6fda65910> python3 -c "import tvm; print(tvm.metal().exist)" False python3 -c "import tvm; print(tvm.vulkan().exist)" True python3 -c "import tvm; print(tvm.cuda().exist)" False python3 -c "import tvm; print(tvm.opencl().exist)" True
It can build after I change the llvm to 14
❓ General Questions
I got segment fault during I run python3 build.py --model vicuna-v1-7b --quantization q4f16_0 --target android --max-seq-len 768, so I add -X faulthandler to got the detail info : python3 -X faulthandler build.py --model vicuna-v1-7b --quantization q4f16_0 --target android --max-seq-len 768 Using path "dist/models/vicuna-v1-7b" for model "vicuna-v1-7b" Database paths: ['log_db/redpajama-3b-q4f16', 'log_db/rwkv-raven-7b', 'log_db/redpajama-3b-q4f32', 'log_db/vicuna-v1-7b', 'log_db/dolly-v2-3b', 'log_db/rwkv-raven-1b5', 'log_db/rwkv-raven-3b'] Target configured: opencl -keys=opencl,gpu -max_num_threads=256 -max_shared_memory_per_block=16384 -max_threads_per_block=256 -texture_spatial_limit=16384 -thread_warp_size=1 [15:42:13] /media/data/networkcode/tvm-unity/include/tvm/topi/transform.h:1075: Warning: Fast mode segfaults when there are out-of-bounds indices. Make sure input indices are in bound [15:42:15] /media/data/networkcode/tvm-unity/include/tvm/topi/transform.h:1075: Warning: Fast mode segfaults when there are out-of-bounds indices. Make sure input indices are in bound Fatal Python error: Segmentation fault
Current thread 0x00007f7d57c19740 (most recent call first): File "/media/data/networkcode/tvm-unity/python/tvm/_ffi/_ctypes/packed_func.py", line 228 in call File "/media/data/networkcode/tvm-unity/python/tvm/ir/transform.py", line 238 in call File "/media/data/networkcode/tvm-unity/python/tvm/relax/pipeline.py", line 68 in f_zero_pipeline File "/media/data/networkcode/tvm-unity/python/tvm/_ffi/_ctypes/packed_func.py", line 82 in cfun File "/media/data/networkcode/tvm-unity/python/tvm/_ffi/_ctypes/packed_func.py", line 228 in call File "/media/data/networkcode/tvm-unity/python/tvm/ir/transform.py", line 238 in call File "build.py", line 320 in mod_transform_before_build File "build.py", line 447 in main File "build.py", line 470 in
Segmentation fault (core dumped)
the line 320 of build.py is mod = relax.pipeline.get_pipeline()(mod) # pylint: disable=no-value-for-parameter