-
Notifications
You must be signed in to change notification settings - Fork 16
188 lines (159 loc) · 5.92 KB
/
Copy pathtest-plugin.yml
File metadata and controls
188 lines (159 loc) · 5.92 KB
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Triton-Shared Plugin Testing
on:
workflow_call:
inputs:
triton-ref:
required: false
type: string
triton-shared-ref:
required: true
type: string
force-failure:
default: false
type: boolean
workflow_dispatch:
inputs:
triton-ref:
required: false
type: string
triton-shared-ref:
required: true
type: string
force-failure:
default: false
type: boolean
jobs:
build_and_test_triton_shared:
runs-on: ubuntu-latest
steps:
- name: Force Failure
if: ${{ inputs.force-failure }}
run: exit 1
- name: Checkout Triton-Shared
uses: actions/checkout@v4
with:
ref: ${{ inputs.triton-shared-ref }}
path: triton_shared
- name: Checkout triton based on triton-hash.txt
run: |
git clone https://github.com/triton-lang/triton.git triton
cd triton
HASH="$(cat ../triton_shared/triton-hash.txt)"
echo "Checking out Triton commit: ${HASH}"
git checkout "${HASH}"
- name: Checkout triton at ${{ inputs.triton-ref }}
if: ${{ inputs.triton-ref }}
working-directory: triton
run: |
git checkout ${{ inputs.triton-ref }}
git log -1
- name: Clear Triton Cache
run: |
rm -rf ~/.triton
- name: Update PATH
run: |
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}"
- name: Check pre-commit
working-directory: triton
run: |
python3 -m pip install --upgrade pre-commit
python3 -m pre_commit run --all-files --verbose
- name: Build/Install Triton
working-directory: triton
run: |
python3 -m pip install --upgrade pip
python3 -m pip install cmake==3.24 ninja pytest-xdist nanobind==2.10.2 setuptools
sudo apt-get update -y
sudo apt-get install -y ccache clang lld
export TRITON_PLUGIN_DIRS="${GITHUB_WORKSPACE}/triton_shared"
TRITON_BUILD_WITH_CLANG_LLD=true TRITON_BUILD_WITH_CCACHE=true python3 -m pip install --no-build-isolation -vvv '.[tests]'
- name: Run shared middle-layer lit tests
working-directory: triton
run: |
python3 -m pip install lit
LIT_TEST_DIR="build/$(ls build | grep -i cmake)/third_party/triton_shared/test"
if [ ! -d "${LIT_TEST_DIR}" ]; then
echo "Could not find '${LIT_TEST_DIR}'" ; exit -1
fi
lit -v "${LIT_TEST_DIR}"
- name: Install CPU backend example dependencies
run: |
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python3 -m pip install pytest numpy
- name: Prepare CPU backend environment
working-directory: triton
run: |
CMAKE_BUILD_DIR=$(ls $(pwd)/build | grep -i cmake)
LLVM_BINARY_DIR=$(find ${HOME}/.triton/llvm/ -name bin | head -1)
echo "TRITON_SHARED_OPT_PATH=$(pwd)/build/${CMAKE_BUILD_DIR}/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt" >> "${GITHUB_ENV}"
echo "LLVM_BINARY_DIR=${LLVM_BINARY_DIR}" >> "${GITHUB_ENV}"
- name: Run CPU backend examples
working-directory: triton_shared/python/examples
run: pytest .
build_and_test_triton_shared_arm:
runs-on: ubuntu-24.04-arm
steps:
- name: Check Architecture
run: uname -a
- name: Force Failure
if: ${{ inputs.force-failure }}
run: exit 1
- name: Checkout Triton-Shared
uses: actions/checkout@v4
with:
ref: ${{ inputs.triton-shared-ref }}
path: triton_shared
- name: Checkout triton based on triton-hash.txt
run: |
git clone https://github.com/triton-lang/triton.git triton
cd triton
HASH="$(cat ../triton_shared/triton-hash.txt)"
echo "Checking out Triton commit: ${HASH}"
git checkout "${HASH}"
- name: Clear Triton Cache
run: |
rm -rf ~/.triton
- name: Modify Instance
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build python3-pip libc6
- name: Update PATH
run: |
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}"
- name: Check pre-commit
working-directory: triton
run: |
python3 -m pip install --upgrade pre-commit
python3 -m pre_commit run --all-files --verbose
- name: Build/Install Triton
working-directory: triton
run: |
python3 -m pip install --upgrade pip
python3 -m pip install cmake==3.24 ninja pytest-xdist nanobind==2.10.2 setuptools
sudo apt-get update -y
sudo apt-get install -y ccache clang lld
export TRITON_PLUGIN_DIRS="${GITHUB_WORKSPACE}/triton_shared"
TRITON_BUILD_WITH_CLANG_LLD=true TRITON_BUILD_WITH_CCACHE=true python3 -m pip install --no-build-isolation -vvv '.[tests]'
- name: Run shared middle-layer lit tests
working-directory: triton
run: |
python3 -m pip install lit
LIT_TEST_DIR="build/$(ls build | grep -i cmake)/third_party/triton_shared/test"
if [ ! -d "${LIT_TEST_DIR}" ]; then
echo "Coult not find '${LIT_TEST_DIR}'" ; exit -1
fi
lit -v "${LIT_TEST_DIR}"
- name: Install CPU backend example dependencies
run: |
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python3 -m pip install pytest numpy
- name: Prepare CPU backend environment
working-directory: triton
run: |
CMAKE_BUILD_DIR=$(ls $(pwd)/build | grep -i cmake)
LLVM_BINARY_DIR=$(find ${HOME}/.triton/llvm/ -name bin | head -1)
echo "TRITON_SHARED_OPT_PATH=$(pwd)/build/${CMAKE_BUILD_DIR}/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt" >> "${GITHUB_ENV}"
echo "LLVM_BINARY_DIR=${LLVM_BINARY_DIR}" >> "${GITHUB_ENV}"
- name: Run CPU backend examples
working-directory: triton_shared/python/examples
run: pytest .