Commit dee8deee authored by jerrrrry's avatar jerrrrry
Browse files

Update .gitlab-ci.yml

parent 5891a84c
# 定义流水线要使用的 Docker 镜像 # 定义流水线要使用的 Docker 镜像
image: image.sourcefind.cn:5000/dcu/admin/base/vllm:0.8.5-ubuntu22.04-dtk25.04.1-rc5-das1.6-py3.10-20250724 image: image.sourcefind.cn:5000/dcu/admin/base/vllm:0.8.5-ubuntu22.04-dtk25.04.1-rc5-das1.6-py3.10-20250724
# 只定义一个阶段 # 只定义一个阶段
stages: stages:
- test - test
...@@ -12,34 +13,35 @@ benchmark_sdxl: ...@@ -12,34 +13,35 @@ benchmark_sdxl:
- demos - demos
script: script:
- echo "=========================================" - echo "========================================="
- echo "Step 1:Checking and downloading assets" - echo "Step 1: Checking and downloading assets"
- echo "All download logs will be saved to setup.log"
- echo "=========================================" - echo "========================================="
# 条件性下载模型 # 条件性下载模型,并将输出重定向到 setup.log
- | - |
if [ ! -d "stable-diffusion-xl-base-1.0" ]; then if [ ! -d "stable-diffusion-xl-base-1.0" ]; then
echo "Models not found in cache, downloading..." echo "Models not found in cache, downloading..." | tee -a setup.log
pip install modelscope -q pip install modelscope -q >> setup.log 2>&1
modelscope download --model "AI-ModelScope/sdxl-vae-fp16-fix" --local_dir "./sdxl-vae-fp16-fix" > /dev/null modelscope download --model "AI-ModelScope/sdxl-vae-fp16-fix" --local_dir "./sdxl-vae-fp16-fix" >> setup.log 2>&1
modelscope download --model "stabilityai/stable-diffusion-xl-base-1.0" --local_dir "./stable-diffusion-xl-base-1.0" > /dev/null modelscope download --model "stabilityai/stable-diffusion-xl-base-1.0" --local_dir "./stable-diffusion-xl-base-1.0" >> setup.log 2>&1
else else
echo "Models found in cache, skipping download." echo "Models found in cache, skipping download." | tee -a setup.log
fi fi
# 条件性下载库和包 # 条件性下载库和包,并将输出重定向到 setup.log
- | - |
if [ ! -f "diffusers-0.33.1-py3-none-any.whl" ]; then if [ ! -f "diffusers-0.33.1-py3-none-any.whl" ]; then
echo "Libraries/packages not found in cache, downloading..." echo "Libraries/packages not found in cache, downloading..." | tee -a setup.log
curl -s -f -C - -o "rocblas-install-0626-bug.tar.gz" "https://wuzh01.hpccube.com:65015/efile/s/d/amVycnJycnk=/a6a7342d017b1748" curl -s -f -C - -o "rocblas-install-0626-bug.tar.gz" "https://wuzh01.hpccube.com:65015/efile/s/d/amVycnJycnk=/a6a7342d017b1748" >> setup.log 2>&1
curl -s -f -C - -o "package-miopen-dev-0801-ubuntu20.tar.gz" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/9c2334cb9cdb8b39" curl -s -f -C - -o "package-miopen-dev-0801-ubuntu20.tar.gz" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/9c2334cb9cdb8b39" >> setup.log 2>&1
curl -s -f -C - -o "diffusers-0.33.1-py3-none-any.whl" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/63ec0d10ce960f90" curl -s -f -C - -o "diffusers-0.33.1-py3-none-any.whl" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/63ec0d10ce960f90" >> setup.log 2>&1
curl -s -f -C - -o "lightop-0.5.0+das.dtk25041-cp310-cp310-linux_x86_64.whl" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/da522f7e175bb092" curl -s -f -C - -o "lightop-0.5.0+das.dtk25041-cp310-cp310-linux_x86_64.whl" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/da522f7e175bb092" >> setup.log 2>&1
curl -s -f -C - -o "litserve-0.2.15-py3-none-any.whl" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/36943fb1ca62ac3b" curl -s -f -C - -o "litserve-0.2.15-py3-none-any.whl" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/36943fb1ca62ac3b" >> setup.log 2>&1
curl -s -f -C - -o "transformers.tar.gz" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/f587d939a37d1727" curl -s -f -C - -o "transformers.tar.gz" "https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/f587d939a37d1727" >> setup.log 2>&1
else else
echo "Libraries/packages found in cache, skipping download." echo "Libraries/packages found in cache, skipping download." | tee -a setup.log
fi fi
- echo "=========================================" - echo "========================================="
- echo "Step 2:Setting up the environment" - echo "Step 2: Setting up the environment"
- echo "=========================================" - echo "========================================="
# 解压库文件 # 解压库文件
- tar -xzf "rocblas-install-0626-bug.tar.gz" - tar -xzf "rocblas-install-0626-bug.tar.gz"
...@@ -55,13 +57,13 @@ benchmark_sdxl: ...@@ -55,13 +57,13 @@ benchmark_sdxl:
- cd .. - cd ..
- echo "=========================================" - echo "========================================="
- echo "Step 3:Installing Python packages" - echo "Step 3: Installing Python packages"
- echo "=========================================" - echo "========================================="
# 安装 Python 包 (有缓存时会非常快) # 安装 Python 包 (有缓存时会非常快),输出也重定向
- pip install "diffusers-0.33.1-py3-none-any.whl" "lightop-0.5.0+das.dtk25041-cp310-cp310-linux_x86_64.whl" "litserve-0.2.15-py3-none-any.whl" -q - pip install "diffusers-0.33.1-py3-none-any.whl" "lightop-0.5.0+das.dtk25041-cp310-cp310-linux_x86_64.whl" "litserve-0.2.15-py3-none-any.whl" -q >> setup.log 2>&1
- echo "=========================================" - echo "========================================="
- echo "Step 4:Running the benchmark" - echo "Step 4: Running the benchmark"
- echo "=========================================" - echo "========================================="
# 设置环境变量并运行测试 # 设置环境变量并运行测试
- export LD_LIBRARY_PATH="$CI_PROJECT_DIR/rocblas-install/lib/:$LD_LIBRARY_PATH" - export LD_LIBRARY_PATH="$CI_PROJECT_DIR/rocblas-install/lib/:$LD_LIBRARY_PATH"
...@@ -70,8 +72,14 @@ benchmark_sdxl: ...@@ -70,8 +72,14 @@ benchmark_sdxl:
- export PYTHONPATH="$CI_PROJECT_DIR/transformers:$PYTHONPATH" - export PYTHONPATH="$CI_PROJECT_DIR/transformers:$PYTHONPATH"
- export MODEL_PATH="$CI_PROJECT_DIR/stable-diffusion-xl-base-1.0" - export MODEL_PATH="$CI_PROJECT_DIR/stable-diffusion-xl-base-1.0"
- python test.py > benchmark.log 2>&1 - python test.py > benchmark.log 2>&1
- echo "--- Benchmark finished, showing last 20 lines of log ---"
- tail -n 20 benchmark.log - echo "========================================="
- echo "Job Finished. Displaying log summaries:"
- echo "========================================="
- echo "--- Last 20 lines of setup.log ---"
- tail -n 20 setup.log || true # `|| true` 防止文件不存在时出错
- echo "--- Last 20 lines of benchmark.log ---"
- tail -n 20 benchmark.log || true
# 定义缓存,拉取并更新 # 定义缓存,拉取并更新
cache: cache:
...@@ -87,11 +95,12 @@ benchmark_sdxl: ...@@ -87,11 +95,12 @@ benchmark_sdxl:
- "litserve-0.2.15-py3-none-any.whl" - "litserve-0.2.15-py3-none-any.whl"
- "transformers.tar.gz" - "transformers.tar.gz"
- "/root/.cache/pip" - "/root/.cache/pip"
# 定义产物 # 定义产物,现在包含了两个日志文件
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths: paths:
- "*.png" - "*.png"
- "results.json" - "results.json"
- "benchmark.log" - "benchmark.log"
- "setup.log" # <-- 关键:将设置日志也作为产物保存
expire_in: 1 week expire_in: 1 week
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment