This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
148 lines (128 loc) · 5.43 KB
/
llm-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: LLM Model Test
on:
pull_request:
branches: [main]
paths:
- '.github/workflows/llm-test.yml'
- '.github/workflows/script/models/run_llm.sh'
- "intel_extension_for_transformers/llm/runtime/deprecated/**"
- "!intel_extension_for_transformers/llm/runtime/deprecated/kernels/**"
- "!intel_extension_for_transformers/llm/runtime/graph/**"
- "!intel_extension_for_transformers/llm/runtime/deprecated/test/**"
- "!intel_extension_for_transformers/llm/runtime/deprecated/third_party/**"
- "!intel_extension_for_transformers/llm/runtime/deprecated/docs/**"
workflow_dispatch:
# If there is a new commit, the previous jobs will be canceled
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
OUT_SCRIPT_PATH: ${{ github.workspace }}/.github/workflows/script/models
SCRIPT_PATH: ${{ github.workspace }}/.github/workflows/script
WORKING_DIR: ${{ github.workspace }}
EXTRA_CONTAINER_NAME: "codeScan"
jobs:
LLM-Workflow:
runs-on: spr
strategy:
matrix:
include:
- modelName: "gpt-j-6b"
framework: "engine"
mode: "latency"
precision: "bf16,int8,fp8"
steps:
- name: Checkout out Repo
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-tags: true
- name: Env build
run: |
bash ${{ github.workspace }}/.github/workflows/script/prepare_env_with_conda.sh "llm-test" "3.8"
- name: Binary build
run: |
cd ${{ github.workspace }}
conda activate llm-test || source activate llm-test
pip install build --upgrade
pip install -r requirements.txt
python setup.py sdist bdist_wheel
pip install dist/intel_extension_for_transformers*.whl
pip list
- name: BF16 Benchmark
run: |
cd ${{ github.workspace }}/.github/workflows/script/models
bash run_llm.sh --model=${{ matrix.modelName }} --framework=${{ matrix.framework }} --mode=${{ matrix.mode }} --conda_env_name=llm-test --precision=bf16
- name: INT8 Benchmark
run: |
cd ${{ github.workspace }}/.github/workflows/script/models
bash run_llm.sh --model=${{ matrix.modelName }} --framework=${{ matrix.framework }} --mode=${{ matrix.mode }} --conda_env_name=llm-test --precision=int8
- name: FP8 Benchmark
run: |
cd ${{ github.workspace }}/.github/workflows/script/models
bash run_llm.sh --model=${{ matrix.modelName }} --framework=${{ matrix.framework }} --mode=${{ matrix.mode }} --conda_env_name=llm-test --precision=fp8
- name: Publish pipeline artifact
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: llm
path: ${{ github.workspace }}/*.log
if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn`
retention-days: 60 # 1 <= retention-days <= 90
Genreate-Report:
runs-on: itrex-node-spell
needs: [LLM-Workflow]
steps:
- name: Docker Clean Up
run: |
docker ps -a
if [[ $(docker ps -a | grep -i '${{ env.EXTRA_CONTAINER_NAME }}-${{ runner.name }}'$) ]]; then
docker start ${{ env.EXTRA_CONTAINER_NAME }}-${{ runner.name }}
echo "remove left files through container ..."
docker exec ${{ env.EXTRA_CONTAINER_NAME }}-${{ runner.name }} bash -c "ls -a /intel-extension-for-transformers && rm -fr /intel-extension-for-transformers/* && rm -fr /intel-extension-for-transformers/.* || true"
fi
- name: Checkout out Repo
uses: actions/checkout@v3
- name: Download Summary Log
uses: actions/download-artifact@v3
with:
path: ${{ env.OUT_SCRIPT_PATH }}/generated/log
- name: Download Reference Artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: llm-test.yml
name: FinalReport
run_id: ${{ vars.LLM_REF_ID }}
path: ${{ env.OUT_SCRIPT_PATH }}
name_is_regexp: true
repo: ${{ github.repository }}
check_artifacts: false
search_artifacts: false
skip_unpack: false
if_no_artifact_found: warn
- name: Display structure of downloaded files
run: cd ${{ env.OUT_SCRIPT_PATH }} && ls -R
- name: Generate report
run: |
echo "------ Generating final report.html ------"
cd ${{ env.OUT_SCRIPT_PATH }}
/usr/bin/bash generate_report.sh --workflow=deploy
env:
RUN_DISPLAY_URL: https://github.com/VincyZhang/intel-extension-for-transformers/actions/runs/${{ github.run_id }}
BUILD_NUMBER: ${{ github.run_id }}
JOB_STATUS: succeed
MR_source_branch: ${{ github.head_ref }}
ghprbActualCommit: ${{ github.event.pull_request.head.sha }}
- name: Publish Report
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: FinalReport
path: ${{ env.OUT_SCRIPT_PATH }}/generated
- name: Specify performance regression
run: |
if [ $(is_perf_reg) == 'true' ]; then
echo "[Performance Regression] Some model performance regression occurred, please check artifacts and reports."
exit 1
fi