Skip to content

Commit f9a468a

Browse files
authored
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
1 parent 8e33cb0 commit f9a468a

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

.github/workflows/llm_unit_tests.yml

+21-29
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,33 @@ on:
3737
jobs:
3838
llm-cpp-build:
3939
uses: ./.github/workflows/llm-binary-build.yml
40+
setup-python-version:
41+
runs-on: [self-hosted, llm, ubuntu-20.04-lts]
42+
outputs:
43+
python-version: ${{ steps.setup-python-version.outputs.python-version }}
44+
steps:
45+
- name: setup-python-version
46+
id: setup-python-version
47+
run: |
48+
if ${{ github.event_name == 'pull_request' }}; then
49+
python_version='["3.9"]'
50+
else
51+
python_version='["3.9", "3.10", "3.11"]'
52+
fi
53+
list=$(echo ${python_version} | jq -c)
54+
echo "python-version=${list}" >> "$GITHUB_OUTPUT"
4055
llm-unit-test:
41-
needs: llm-cpp-build
56+
needs: [setup-python-version, llm-cpp-build]
4257
strategy:
4358
fail-fast: false
4459
matrix:
60+
os: [windows, ubuntu-20.04-lts]
61+
python-version: ${{ fromJson(needs.setup-python-version.outputs.python-version) }}
4562
include:
4663
- os: windows
4764
instruction: AVX-VNNI-UT
48-
python-version: "3.9"
49-
- os: ubuntu-20.04-lts
50-
instruction: avx512
51-
python-version: "3.9"
52-
- os: windows
53-
instruction: AVX-VNNI-UT
54-
python-version: "3.10"
55-
- os: ubuntu-20.04-lts
56-
instruction: avx512
57-
python-version: "3.10"
58-
- os: windows
59-
instruction: AVX-VNNI-UT
60-
python-version: "3.11"
6165
- os: ubuntu-20.04-lts
6266
instruction: avx512
63-
python-version: "3.11"
6467
runs-on: [self-hosted, llm, "${{matrix.instruction}}", "${{matrix.os}}"]
6568
env:
6669
THREAD_NUM: 24
@@ -204,23 +207,12 @@ jobs:
204207
pip install -U pandas==2.0.3
205208
bash python/llm/test/run-llm-langchain-tests.sh
206209
llm-unit-test-on-arc:
207-
needs: llm-cpp-build
210+
needs: [setup-python-version, llm-cpp-build]
208211
strategy:
209212
fail-fast: false
210213
matrix:
211-
include:
212-
- pytorch-version: "2.1"
213-
python-version: "3.9"
214-
- pytorch-version: "2.1"
215-
python-version: "3.10"
216-
- pytorch-version: "2.1"
217-
python-version: "3.11"
218-
- pytorch-version: "2.0"
219-
python-version: "3.9"
220-
- pytorch-version: "2.0"
221-
python-version: "3.10"
222-
- pytorch-version: "2.0"
223-
python-version: "3.11"
214+
pytorch-version: ['2.1', '2.0']
215+
python-version: ${{ fromJson(needs.setup-python-version.outputs.python-version) }}
224216
runs-on: [self-hosted, llm, arc]
225217
env:
226218
OMP_NUM_THREADS: 16

0 commit comments

Comments
 (0)