From f34209766d958a16fa337c29c68f75b4942c8b4a Mon Sep 17 00:00:00 2001 From: zhulinJulia24 <145004780+zhulinJulia24@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:48:17 +0800 Subject: [PATCH] [ci] fix test env (#1470) * Update daily-run-test.yml * Update daily-run-test.yml * Update pr-run-test.yml * Update daily-run-test.yml * update * update --------- Co-authored-by: zhulin1 --- .github/scripts/eval_regression_chat.py | 2 +- .github/workflows/daily-run-test.yml | 20 +++++++++++--------- .github/workflows/pr-run-test.yml | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/scripts/eval_regression_chat.py b/.github/scripts/eval_regression_chat.py index 8559f8ab..1ee28e63 100644 --- a/.github/scripts/eval_regression_chat.py +++ b/.github/scripts/eval_regression_chat.py @@ -88,7 +88,7 @@ models.append( abbr='lmdeploy-api-test', type=OpenAISDK, key='EMPTY', - openai_api_base='http://10.1.9.14:10001/v1', + openai_api_base='http://judgemodel:10001/v1', path='compass_judger_internlm2_102b_0508', tokenizer_path='internlm/internlm2_5-20b-chat', rpm_verbose=True, diff --git a/.github/workflows/daily-run-test.yml b/.github/workflows/daily-run-test.yml index c0884d33..ebe66523 100644 --- a/.github/workflows/daily-run-test.yml +++ b/.github/workflows/daily-run-test.yml @@ -29,18 +29,19 @@ jobs: uses: actions/checkout@v2 - name: Prepare - create conda env and install torch run: | - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda create -y --name ${{env.CONDA_ENV}} python=3.10 conda activate ${{env.CONDA_ENV}} - pip install /cpfs01/user/qa-llm-cicd/packages/lmdeploy-0.5.0+cu118-cp310-cp310-manylinux2014_x86_64.whl --cache-dir ${{env.PIP_CACHE_PATH}} --index-url https://download.pytorch.org/whl/cu118 + pip install /cpfs01/user/qa-llm-cicd/packages/lmdeploy-0.5.0+cu118-cp310-cp310-manylinux2014_x86_64.whl --cache-dir ${{env.PIP_CACHE_PATH}} pip install /cpfs01/user/qa-llm-cicd/packages/vllm-0.5.2+cu118-cp310-cp310-manylinux1_x86_64.whl --cache-dir ${{env.PIP_CACHE_PATH}} - FLASH_ATTENTION_FORCE_BUILD=TRUE pip install /cpfs01/user/qa-llm-cicd/packages/flash_attn-2.5.8+cu118torch2.2cxx11abiFALSE-cp310-cp310-linux_x86_64.whl --index-url https://download.pytorch.org/whl/cu118 + FLASH_ATTENTION_FORCE_BUILD=TRUE pip install /cpfs01/user/qa-llm-cicd/packages/flash_attn-2.5.8+cu118torch2.2cxx11abiFALSE-cp310-cp310-linux_x86_64.whl + pip install bitsandbytes pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --cache-dir ${{env.PIP_CACHE_PATH}} --index-url https://download.pytorch.org/whl/cu118 - pip install xformers==0.0.25.post1 --cache-dir ${{env.PIP_CACHE_PATH}} --extra-index-url https://download.pytorch.org/whl/cu118 + pip install xformers==0.0.25.post1 --cache-dir ${{env.PIP_CACHE_PATH}} conda info --envs - name: Prepare - Pip install code run: | - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda activate ${{env.CONDA_ENV}} pip install -e . --cache-dir ${{env.PIP_CACHE_PATH}} pip install human_eval transformers protobuf pytest --cache-dir ${{env.PIP_CACHE_PATH}} @@ -52,15 +53,16 @@ jobs: ln -s ${{env.HF_CACHE_PATH}} ~/.cache/huggingface/hub - name: Run chat model test run: | - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda activate ${{env.CONDA_ENV}} conda info --envs + sed -i 's/judgemodel/'$(tail -n 1 /cpfs01/shared/public/llmeval/share_info/compassjuder_ip.txt)'/g' .github/scripts/eval_regression_chat.py python3 run.py .github/scripts/eval_regression_chat.py --work-dir /cpfs01/user/qa-llm-cicd/report/${{ github.run_id }}/chat --reuse rm regression_result_daily -f && ln -s /cpfs01/user/qa-llm-cicd/report/${{ github.run_id }}/chat/*/summary regression_result_daily python -m pytest -m chat -s -v --color=yes .github/scripts/oc_score_assert.py - name: Run base model test run: | - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda activate ${{env.CONDA_ENV}} conda info --envs python3 run.py .github/scripts/eval_regression_base.py --work-dir /cpfs01/user/qa-llm-cicd/report/${{ github.run_id }}/base --reuse @@ -68,7 +70,7 @@ jobs: python -m pytest -m base -s -v --color=yes .github/scripts/oc_score_assert.py - name: Run command testcase run: | - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda activate ${{env.CONDA_ENV}} conda info --envs export from_tf=TRUE @@ -89,7 +91,7 @@ jobs: if: always() run: | rm -rf regression_result_daily - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda env remove -y --name ${{env.CONDA_ENV}} conda info --envs diff --git a/.github/workflows/pr-run-test.yml b/.github/workflows/pr-run-test.yml index 2fcdf59f..6cab1378 100644 --- a/.github/workflows/pr-run-test.yml +++ b/.github/workflows/pr-run-test.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v2 - name: Prepare - Install opencompass run: | - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda activate ${{env.CONDA_ENV}} python3 -m pip uninstall opencompass -y python3 -m pip install -e . --cache-dir ${{env.USERSPACE_PREFIX}}/.cache/pip @@ -47,7 +47,7 @@ jobs: ln -s ${{env.HF_CACHE_PATH}} ~/.cache/huggingface/hub - name: Run test run: | - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda activate ${{env.CONDA_ENV}} conda info --envs rm -rf regression_result @@ -65,7 +65,7 @@ jobs: - name: Uninstall opencompass if: always() run: | - eval "$(conda shell.bash hook)" + . /cpfs01/shared/public/qa-llm-cicd/miniconda3/bin/activate conda activate ${{env.CONDA_ENV}} python3 -m pip uninstall opencompass -y conda info --envs