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
This commit is contained in:
Jin Qiao 2024-02-04 13:37:34 +08:00 committed by GitHub
parent 8e33cb0f38
commit f9a468a2c7

View file

@ -37,30 +37,33 @@ on:
jobs: jobs:
llm-cpp-build: llm-cpp-build:
uses: ./.github/workflows/llm-binary-build.yml 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: llm-unit-test:
needs: llm-cpp-build needs: [setup-python-version, llm-cpp-build]
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [windows, ubuntu-20.04-lts]
python-version: ${{ fromJson(needs.setup-python-version.outputs.python-version) }}
include: include:
- os: windows - os: windows
instruction: AVX-VNNI-UT instruction: AVX-VNNI-UT
python-version: "3.9"
- os: ubuntu-20.04-lts - os: ubuntu-20.04-lts
instruction: avx512 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}}"] runs-on: [self-hosted, llm, "${{matrix.instruction}}", "${{matrix.os}}"]
env: env:
THREAD_NUM: 24 THREAD_NUM: 24
@ -204,23 +207,12 @@ jobs:
pip install -U pandas==2.0.3 pip install -U pandas==2.0.3
bash python/llm/test/run-llm-langchain-tests.sh bash python/llm/test/run-llm-langchain-tests.sh
llm-unit-test-on-arc: llm-unit-test-on-arc:
needs: llm-cpp-build needs: [setup-python-version, llm-cpp-build]
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: pytorch-version: ['2.1', '2.0']
- pytorch-version: "2.1" python-version: ${{ fromJson(needs.setup-python-version.outputs.python-version) }}
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"
runs-on: [self-hosted, llm, arc] runs-on: [self-hosted, llm, arc]
env: env:
OMP_NUM_THREADS: 16 OMP_NUM_THREADS: 16