From 75d1ef4162619c82ee0dfea2202f4e966c1d590d Mon Sep 17 00:00:00 2001 From: Jin Qiao <89779290+JinBridger@users.noreply.github.com> Date: Sun, 4 Feb 2024 13:37:34 +0800 Subject: [PATCH] LLM: conditionally choose python version for unit test (#10062) * conditional python version * retry * temporary skip llm-cpp-build * apply on llm-unit-test-on-arc * fix * add llm-cpp-build dependency * use GITHUB_OUTPUT instead of set-output * check nightly build * fix quote * fix quote * add llm-cpp-build dependency * test nightly build * test pull request --- .github/workflows/llm_unit_tests.yml | 50 ++++++++++++---------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/.github/workflows/llm_unit_tests.yml b/.github/workflows/llm_unit_tests.yml index 9c1bf86d86b..e9a531002fc 100644 --- a/.github/workflows/llm_unit_tests.yml +++ b/.github/workflows/llm_unit_tests.yml @@ -37,30 +37,33 @@ on: jobs: llm-cpp-build: uses: ./.github/workflows/llm-binary-build.yml + setup-python-version: + runs-on: [self-hosted, llm, ubuntu-20.04-lts] + outputs: + python-version: ${{ steps.setup-python-version.outputs.python-version }} + steps: + - name: setup-python-version + id: setup-python-version + run: | + if ${{ github.event_name == 'pull_request' }}; then + python_version='["3.9"]' + else + python_version='["3.9", "3.10", "3.11"]' + fi + list=$(echo ${python_version} | jq -c) + echo "python-version=${list}" >> "$GITHUB_OUTPUT" llm-unit-test: - needs: llm-cpp-build + needs: [setup-python-version, llm-cpp-build] strategy: fail-fast: false matrix: + os: [windows, ubuntu-20.04-lts] + python-version: ${{ fromJson(needs.setup-python-version.outputs.python-version) }} include: - os: windows instruction: AVX-VNNI-UT - python-version: "3.9" - - os: ubuntu-20.04-lts - instruction: avx512 - python-version: "3.9" - - os: windows - instruction: AVX-VNNI-UT - python-version: "3.10" - - os: ubuntu-20.04-lts - instruction: avx512 - python-version: "3.10" - - os: windows - instruction: AVX-VNNI-UT - python-version: "3.11" - os: ubuntu-20.04-lts instruction: avx512 - python-version: "3.11" runs-on: [self-hosted, llm, "${{matrix.instruction}}", "${{matrix.os}}"] env: THREAD_NUM: 24 @@ -204,23 +207,12 @@ jobs: pip install -U pandas==2.0.3 bash python/llm/test/run-llm-langchain-tests.sh llm-unit-test-on-arc: - needs: llm-cpp-build + needs: [setup-python-version, llm-cpp-build] strategy: fail-fast: false matrix: - include: - - pytorch-version: "2.1" - python-version: "3.9" - - pytorch-version: "2.1" - python-version: "3.10" - - pytorch-version: "2.1" - python-version: "3.11" - - pytorch-version: "2.0" - python-version: "3.9" - - pytorch-version: "2.0" - python-version: "3.10" - - pytorch-version: "2.0" - python-version: "3.11" + pytorch-version: ['2.1', '2.0'] + python-version: ${{ fromJson(needs.setup-python-version.outputs.python-version) }} runs-on: [self-hosted, llm, arc] env: OMP_NUM_THREADS: 16