forked from krocki/mlc-llm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_model_compile.sh
executable file
·37 lines (34 loc) · 1.2 KB
/
test_model_compile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -eo pipefail
set -x
: ${NUM_THREADS:=$(nproc)}
: ${WORKSPACE_CWD:=$(pwd)}
: ${GPU:="cpu"}
pip install --force-reinstall wheels/*.whl
if [[ ${GPU} == cuda* ]]; then
TARGET=cuda
pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-cu121
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:$LD_LIBRARY_PATH
elif [[ ${GPU} == rocm* ]]; then
TARGET=rocm
pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-rocm57
elif [[ ${GPU} == metal ]]; then
TARGET=metal
pip install --pre -U --force-reinstal -f https://mlc.ai/wheels mlc-ai-nightly
elif [[ ${GPU} == wasm* ]]; then
TARGET=wasm
pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly
export TVM_HOME=$(dirname $(python -c 'import tvm; print(tvm.__file__)'))
cd $TVM_HOME/web/ && make -j${NUM_THREADS} && cd -
elif [[ ${GPU} == ios ]]; then
TARGET=ios
pip install --pre -U --force-reinstal -f https://mlc.ai/wheels mlc-ai-nightly
elif [[ ${GPU} == android* ]]; then
TARGET=android
pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly
source /android_env_vars.sh
else
TARGET=vulkan
pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly
fi
python tests/python/integration/test_model_compile.py $TARGET $NUM_THREADS