From a50d6f3abfc2f64ca0cdae8f78fba07d4dfcad1e Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Sat, 25 Jan 2025 14:32:05 -0500 Subject: [PATCH] [CI] Update Python version in CI due to Python 3.8 EOL This PR updates the CI for Python version bump, as Python 3.8 reaches its end of life. --- ci/jenkinsfile.groovy | 48 +++++++++++++++++------------------ ci/task/pylint.sh | 2 +- ci/task/test_model_compile.sh | 10 ++++---- ci/task/test_unittest.sh | 4 +-- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/ci/jenkinsfile.groovy b/ci/jenkinsfile.groovy index 9acb676a5f..26b9cad318 100644 --- a/ci/jenkinsfile.groovy +++ b/ci/jenkinsfile.groovy @@ -123,10 +123,10 @@ stage('Build') { ws(per_exec_ws('mlc-llm-build-cuda')) { init_git(true) sh(script: "ls -alh", label: 'Show work directory') - sh(script: "${pkg_cuda} conda env export --name py38", label: 'Checkout version') - sh(script: "${pkg_cuda} -j 8 -v \$HOME/.ccache /ccache conda run -n py38 ./ci/task/build_lib.sh", label: 'Build MLC LLM runtime') - sh(script: "${pkg_cuda} -j 8 conda run -n py38 ./ci/task/build_wheel.sh", label: 'Build MLC LLM wheel') - sh(script: "${pkg_cuda} -j 1 conda run -n py38 ./ci/task/build_clean.sh", label: 'Clean up after build') + sh(script: "${pkg_cuda} conda env export --name py310", label: 'Checkout version') + sh(script: "${pkg_cuda} -j 8 -v \$HOME/.ccache /ccache conda run -n py310 ./ci/task/build_lib.sh", label: 'Build MLC LLM runtime') + sh(script: "${pkg_cuda} -j 8 conda run -n py310 ./ci/task/build_wheel.sh", label: 'Build MLC LLM wheel') + sh(script: "${pkg_cuda} -j 1 conda run -n py310 ./ci/task/build_clean.sh", label: 'Clean up after build') sh(script: "ls -alh ./wheels/", label: 'Build artifact') pack_lib('mlc_wheel_cuda', 'wheels/*.whl') } @@ -137,10 +137,10 @@ stage('Build') { // ws(per_exec_ws('mlc-llm-build-rocm')) { // init_git(true) // sh(script: "ls -alh", label: 'Show work directory') - // sh(script: "${pkg_rocm} conda env export --name py38", label: 'Checkout version') - // sh(script: "${pkg_rocm} -j 8 conda run -n py38 ./ci/task/build_lib.sh", label: 'Build MLC LLM runtime') - // sh(script: "${pkg_rocm} -j 8 conda run -n py38 ./ci/task/build_wheel.sh", label: 'Build MLC LLM wheel') - // sh(script: "${pkg_rocm} -j 1 conda run -n py38 ./ci/task/build_clean.sh", label: 'Clean up after build') + // sh(script: "${pkg_rocm} conda env export --name py310", label: 'Checkout version') + // sh(script: "${pkg_rocm} -j 8 conda run -n py310 ./ci/task/build_lib.sh", label: 'Build MLC LLM runtime') + // sh(script: "${pkg_rocm} -j 8 conda run -n py310 ./ci/task/build_wheel.sh", label: 'Build MLC LLM wheel') + // sh(script: "${pkg_rocm} -j 1 conda run -n py310 ./ci/task/build_clean.sh", label: 'Clean up after build') // sh(script: "ls -alh ./wheels/", label: 'Build artifact') // pack_lib('mlc_wheel_rocm', 'wheels/*.whl') // } @@ -165,10 +165,10 @@ stage('Build') { ws(per_exec_ws('mlc-llm-build-vulkan')) { init_git(true) sh(script: "ls -alh", label: 'Show work directory') - sh(script: "${pkg_cpu} conda env export --name py38", label: 'Checkout version') - sh(script: "${pkg_cpu} -j 8 conda run -n py38 ./ci/task/build_lib.sh", label: 'Build MLC LLM runtime') - sh(script: "${pkg_cpu} -j 8 conda run -n py38 ./ci/task/build_wheel.sh", label: 'Build MLC LLM wheel') - sh(script: "${pkg_cpu} -j 1 conda run -n py38 ./ci/task/build_clean.sh", label: 'Clean up after build') + sh(script: "${pkg_cpu} conda env export --name py310", label: 'Checkout version') + sh(script: "${pkg_cpu} -j 8 conda run -n py310 ./ci/task/build_lib.sh", label: 'Build MLC LLM runtime') + sh(script: "${pkg_cpu} -j 8 conda run -n py310 ./ci/task/build_wheel.sh", label: 'Build MLC LLM wheel') + sh(script: "${pkg_cpu} -j 1 conda run -n py310 ./ci/task/build_clean.sh", label: 'Clean up after build') sh(script: "ls -alh ./wheels/", label: 'Build artifact') pack_lib('mlc_wheel_vulkan', 'wheels/*.whl') } @@ -185,8 +185,8 @@ stage('Unittest') { init_git(false) sh(script: "ls -alh", label: 'Show work directory') unpack_lib('mlc_wheel_cuda', 'wheels/*.whl') - sh(script: "${run_cuda} conda env export --name ci-unittest", label: 'Checkout version') - sh(script: "${run_cuda} conda run -n ci-unittest ./ci/task/test_unittest.sh", label: 'Testing') + sh(script: "${pkg_cuda} conda env export --name py310", label: 'Checkout version') + sh(script: "${pkg_cuda} conda run -n py310 ./ci/task/test_unittest.sh", label: 'Testing') } } } @@ -201,8 +201,8 @@ stage('Model Compilation') { init_git(false) sh(script: "ls -alh", label: 'Show work directory') unpack_lib('mlc_wheel_cuda', 'wheels/*.whl') - sh(script: "${run_cuda} conda env export --name ci-unittest", label: 'Checkout version') - sh(script: "${run_cuda} -j 4 conda run -n ci-unittest ./ci/task/test_model_compile.sh", label: 'Testing') + sh(script: "${pkg_cuda} conda env export --name py310", label: 'Checkout version') + sh(script: "${pkg_cuda} -j 4 conda run -n py310 ./ci/task/test_model_compile.sh", label: 'Testing') } } }, @@ -212,8 +212,8 @@ stage('Model Compilation') { // init_git(false) // sh(script: "ls -alh", label: 'Show work directory') // unpack_lib('mlc_wheel_rocm', 'wheels/*.whl') - // sh(script: "${run_rocm} conda env export --name ci-unittest", label: 'Checkout version') - // sh(script: "${run_rocm} -j 4 conda run -n ci-unittest ./ci/task/test_model_compile.sh", label: 'Testing') + // sh(script: "${run_rocm} conda env export --name py310", label: 'Checkout version') + // sh(script: "${run_rocm} -j 4 conda run -n py310 ./ci/task/test_model_compile.sh", label: 'Testing') // } // } // }, @@ -234,8 +234,8 @@ stage('Model Compilation') { init_git(false) sh(script: "ls -alh", label: 'Show work directory') unpack_lib('mlc_wheel_vulkan', 'wheels/*.whl') - sh(script: "${run_cpu} conda env export --name ci-unittest", label: 'Checkout version') - // sh(script: "${run_cpu} -j 4 conda run -n ci-unittest ./ci/task/test_model_compile.sh", label: 'Testing') + sh(script: "${pkg_cuda} conda env export --name py310", label: 'Checkout version') + // sh(script: "${pkg_cuda} -j 4 conda run -n py310 ./ci/task/test_model_compile.sh", label: 'Testing') } } }, @@ -245,8 +245,8 @@ stage('Model Compilation') { init_git(true) sh(script: "ls -alh", label: 'Show work directory') unpack_lib('mlc_wheel_vulkan', 'wheels/*.whl') - sh(script: "${run_cpu} conda env export --name ci-unittest", label: 'Checkout version') - sh(script: "${run_cpu} -j 8 -e GPU wasm conda run -n ci-unittest ./ci/task/test_model_compile.sh", label: 'Testing') + sh(script: "${pkg_cuda} conda env export --name py310", label: 'Checkout version') + sh(script: "${pkg_cuda} -j 8 -e GPU wasm conda run -n py310 ./ci/task/test_model_compile.sh", label: 'Testing') } } }, @@ -267,8 +267,8 @@ stage('Model Compilation') { init_git(false) sh(script: "ls -alh", label: 'Show work directory') unpack_lib('mlc_wheel_vulkan', 'wheels/*.whl') - sh(script: "${run_cpu} conda env export --name ci-unittest", label: 'Checkout version') - sh(script: "${run_cpu} -j 4 -e GPU android conda run -n ci-unittest ./ci/task/test_model_compile.sh", label: 'Testing') + sh(script: "${pkg_cuda} conda env export --name py310", label: 'Checkout version') + sh(script: "${pkg_cuda} -j 4 -e GPU android conda run -n py310 ./ci/task/test_model_compile.sh", label: 'Testing') } } } diff --git a/ci/task/pylint.sh b/ci/task/pylint.sh index f1b61ed8bb..2f2e3af02b 100755 --- a/ci/task/pylint.sh +++ b/ci/task/pylint.sh @@ -9,7 +9,7 @@ export PYTHONPATH="./python":${PYTHONPATH:-""} if [[ -n ${MLC_CI_SETUP_DEPS:-} ]]; then echo "MLC_CI_SETUP_DEPS=1 start setup deps" # TVM Unity is a dependency to this testing - pip install --quiet --pre -U --no-index -f https://mlc.ai/wheels mlc-ai-nightly-cpu + pip install --quiet --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-cpu pip install --quiet --pre -U cuda-python fi diff --git a/ci/task/test_model_compile.sh b/ci/task/test_model_compile.sh index 0114f14281..d4fea97e75 100755 --- a/ci/task/test_model_compile.sh +++ b/ci/task/test_model_compile.sh @@ -9,17 +9,17 @@ pip install --force-reinstall wheels/*.whl if [[ ${GPU} == cuda* ]]; then TARGET=cuda - pip install --pre -U --no-index -f https://mlc.ai/wheels mlc-ai-nightly-cu123 + pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-cu123 export LD_LIBRARY_PATH=/usr/local/cuda/compat/:$LD_LIBRARY_PATH elif [[ ${GPU} == rocm* ]]; then TARGET=rocm - pip install --pre -U --no-index -f https://mlc.ai/wheels mlc-ai-nightly-rocm57 + pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-rocm57 elif [[ ${GPU} == metal ]]; then TARGET=metal pip install --pre -U --force-reinstall -f https://mlc.ai/wheels mlc-ai-nightly-cpu elif [[ ${GPU} == wasm* ]]; then TARGET=wasm - pip install --pre -U --no-index -f https://mlc.ai/wheels mlc-ai-nightly-cpu + pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-cpu export TVM_SOURCE_DIR=$(dirname $(python -c 'import tvm; print(tvm.__file__)')) export TVM_HOME=${TVM_SOURCE_DIR} export MLC_LLM_SOURCE_DIR=$(pwd) @@ -30,11 +30,11 @@ elif [[ ${GPU} == ios ]]; then pip install --pre -U --force-reinstall -f https://mlc.ai/wheels mlc-ai-nightly-cpu elif [[ ${GPU} == android* ]]; then TARGET=android - pip install --pre -U --no-index -f https://mlc.ai/wheels mlc-ai-nightly-cpu + pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-cpu source /android_env_vars.sh else TARGET=vulkan - pip install --pre -U --no-index -f https://mlc.ai/wheels mlc-ai-nightly-cpu + pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-cpu fi python tests/python/integration/test_model_compile.py $TARGET $NUM_THREADS diff --git a/ci/task/test_unittest.sh b/ci/task/test_unittest.sh index 272bd46908..df0cee7ff3 100755 --- a/ci/task/test_unittest.sh +++ b/ci/task/test_unittest.sh @@ -8,8 +8,8 @@ if [[ -n ${MLC_CI_SETUP_DEPS:-} ]]; then # Install dependency pip install --force-reinstall wheels/*.whl pip install --quiet pytest - pip install --pre -U --no-index -f https://mlc.ai/wheels mlc-ai-nightly-cu123 - export LD_LIBRARY_PATH=/usr/local/cuda/compat/:$LD_LIBRARY_PATH + pip install --pre -U -f https://mlc.ai/wheels mlc-ai-nightly-cu123 + export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:$LD_LIBRARY_PATH fi # run all tests that are categorized as "unittest"