-
Notifications
You must be signed in to change notification settings - Fork 44
137 lines (118 loc) · 4.75 KB
/
conda_build_and_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
name: Conda build and test
on:
workflow_dispatch:
schedule:
- cron: "5 2 * * *"
push:
permissions: read-all
env:
BACKEND: XPU
TRITON_DISABLE_LINE_INFO: 1
jobs:
integration-tests:
name: Integration tests
runs-on:
- glados
- spr
- conda-0.0.1
strategy:
matrix:
python:
- "3.9"
- "3.10"
defaults:
run:
shell: bash -noprofile --norc -eo pipefail -c "source /home/runner/intel/oneapi/setvars.sh > /dev/null && source /home/runner/miniconda3/etc/profile.d/conda.sh && source {0}"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Load pip cache
id: pip-cache
uses: ./.github/actions/load
env:
# Increase this value to reset cache
CACHE_NUMBER: 2
with:
path: $HOME/.cache/pip
key: pip-${{ matrix.python }}-${{ hashFiles('python/pyproject.toml', 'python/setup.py') }}-${{ env.CACHE_NUMBER }}
- name: Get LLVM commit id
uses: ./.github/actions/get-commit-id
with:
repository: intel/llvm.git
branch: genx
variable: LLVM_COMMIT_ID
- name: Calculate env
run: |
PACKAGES_CACHE_KEY=$(echo $LLVM_COMMIT_ID ${{ hashFiles('scripts/compile-triton.sh') }} | sha256sum - | cut -d\ -f1)
echo "PACKAGES_CACHE_KEY=$PACKAGES_CACHE_KEY" >>$GITHUB_ENV
echo $HOME/miniconda3/bin >>$GITHUB_PATH
- name: Load packages cache
id: packages-cache
uses: ./.github/actions/load
env:
# Increase this value to reset cache
CACHE_NUMBER: 3
with:
path: $HOME/packages
key: conda-packages-${{ env.PACKAGES_CACHE_KEY }}-${{ env.CACHE_NUMBER }}
- name: Load conda cache
id: conda-cache
uses: ./.github/actions/load
env:
CACHE_NUMBER: 5
with:
path: $HOME/miniconda3/envs/triton
key: conda-py${{ matrix.python }}-${{ hashFiles('scripts/triton.yml') }}-${{ env.CACHE_NUMBER }}
- name: Update conda env
if: ${{ steps.conda-cache.outputs.status == 'miss' }}
run: |
conda create -n triton --override-channels -c conda-forge python=${{ matrix.python }}.*
conda env update -f scripts/triton.yml
find /home/runner/intel/oneapi/ \( -name '*.so' -or -name '*.so.*' \) -exec cp -n {} $HOME/miniconda3/envs/triton/lib \;
ln -snf /usr/include/level_zero $HOME/miniconda3/envs/triton/bin/../x86_64-conda-linux-gnu/sysroot/usr/include/level_zero
find /usr -name libze_\* -exec cp -n {} $HOME/miniconda3/envs/triton/lib \;
- name: Add conda info to log
run: |
conda info
conda list -n triton
- name: Build packages
if: ${{ steps.packages-cache.outputs.status == 'miss' }}
run: |
conda run --no-capture-output -n triton ./scripts/compile-triton.sh --llvm
- name: Save packages cache
if: ${{ steps.packages-cache.outputs.status == 'miss' }}
uses: ./.github/actions/save
with:
path: ${{ steps.packages-cache.outputs.path }}
dest: ${{ steps.packages-cache.outputs.dest }}
- name: Build Triton
run: |
conda run -n triton scripts/compile-triton.sh --triton
- name: Run core tests
run: |
conda run -n triton scripts/test-triton.sh
- name: Save conda cache
if: ${{ steps.conda-cache.outputs.status == 'miss' }}
uses: ./.github/actions/save
with:
path: ${{ steps.conda-cache.outputs.path }}
dest: ${{ steps.conda-cache.outputs.dest }}
- name: Run E2E test
run: |
conda activate triton
# Set WORKSPACE for inductor_xpu_test.sh to make sure it creates "inductor_log" outside of pytorch cloned directory
export WORKSPACE=$GITHUB_WORKSPACE
cd ../pytorch
TRANSFORMERS_VERSION="$(<.ci/docker/ci_commit_pins/huggingface.txt)"
pip install pyyaml pandas scipy numpy psutil pyre_extensions torchrec transformers==$TRANSFORMERS_VERSION
# TODO: Find the fastest Hugging Face model
$GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh huggingface float32 inference accuracy xpu 0 static 1 0 AlbertForMaskedLM
# The script above always returns 0, so we need an additional check to see if the accuracy test passed
cat $WORKSPACE/inductor_log/*/*/*.csv
grep AlbertForMaskedLM $WORKSPACE/inductor_log/*/*/*.csv | grep -q ,pass,
- name: Save pip cache
if: ${{ steps.pip-cache.outputs.status == 'miss' }}
uses: ./.github/actions/save
with:
path: ${{ steps.pip-cache.outputs.path }}
dest: ${{ steps.pip-cache.outputs.dest }}