Skip to content

Commit 13862a4

Browse files
authored
Merge branch 'master' into auto-gen/fmod
Signed-off-by: Zang Peiyu <166481866+factnn@users.noreply.github.com>
2 parents 5beb3b8 + ce527e0 commit 13862a4

451 files changed

Lines changed: 28952 additions & 11144 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# @global-owner1 and @global-owner2 will be requested for
44
# review when someone opens a pull request.
55

6-
/src/flag_gems/* @kiddyjinjin @0x45f @zhangpeiyang1 @huangyiqun
6+
/src/flag_gems/* @0x45f @huangyiqun @douxetpur @bin913 @w1120029931-bit
77
/src/flag_gems/runtime/backend/*
88

9-
/tests/* @kiddyjinjin @0x45f @zhangpeiyang1 @huangyiqun
10-
/modules_tests/* @kiddyjinjin @0x45f @zhangpeiyang1 @huangyiqun
11-
/benchmark/* @kiddyjinjin @0x45f @zhangpeiyang1 @huangyiqun
9+
/tests/* @0x45f @huangyiqun @douxetpur @bin913 @w1120029931-bit
10+
/modules_tests/* @0x45f @huangyiqun @douxetpur @bin913 @w1120029931-bit
11+
/benchmark/* @0x45f @huangyiqun @douxetpur @bin913 @w1120029931-bit
1212

1313

14-
/lib/* @kiddyjinjin @0x45f @zhangpeiyang1 @huangyiqun
15-
/ctests/* @kiddyjinjin @0x45f @zhangpeiyang1 @huangyiqun
16-
/include/* @kiddyjinjin @0x45f @zhangpeiyang1 @huangyiqun
14+
/lib/* @0x45f @huangyiqun @douxetpur @bin913 @w1120029931-bit
15+
/ctests/* @0x45f @huangyiqun @douxetpur @bin913 @w1120029931-bit
16+
/include/* @0x45f @huangyiqun @douxetpur @bin913 @w1120029931-bit

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,6 @@ tests:
146146
- 'pytest.ini'
147147
# NOTE: This directory also contains DSA, FLA operator tests
148148
- 'tests/**'
149+
- 'benchmark/**'
149150
# TODO: Move test scripts to tests/scripts
150151
- 'tools/**'

.github/workflows/backend-test.yaml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ on:
3535
secrets:
3636
RUNNER_SSH_KEY:
3737
required: true
38+
PROXYC:
39+
required: true
40+
PROXYG:
41+
required: true
3842

3943
permissions:
4044
contents: read
@@ -51,14 +55,26 @@ jobs:
5155
shell: bash
5256
env:
5357
RUNNER_LABEL: ${{ inputs.runner_label }}
58+
PROXY: ${{ secrets.PROXYG }}
5459
run: |
5560
if [[ "${RUNNER_LABEL}" != "h20" ]]; then
56-
echo "HTTP_PROXY=http://10.1.7.116:7890" >> $GITHUB_ENV
57-
echo "HTTPS_PROXY=http://10.1.7.116:7890" >> $GITHUB_ENV
61+
echo "HTTP_PROXY=${PROXY}" >> $GITHUB_ENV
62+
echo "HTTPS_PROXY=${PROXY}" >> $GITHUB_ENV
5863
fi
5964
- uses: actions/checkout@v6
6065
with:
6166
ssh-key: ${{ secrets.RUNNER_SSH_KEY }}
67+
- name: Setup FlagGems
68+
shell: bash
69+
env:
70+
RUNNER_LABEL: ${{ inputs.runner_label }}
71+
PROXY: ${{ secrets.PROXYC }}
72+
run: |
73+
if [[ "${RUNNER_LABEL}" != "h20" ]]; then
74+
export HTTP_PROXY="${PROXY}"
75+
export HTTPS_PROXY="${PROXY}"
76+
fi
77+
./setup.sh ${{ inputs.vendor }}
6278
- name: Check GPU availability
6379
if: ${{ inputs.gpu_check_script != '' }}
6480
shell: bash
@@ -76,11 +92,7 @@ jobs:
7692
shell: bash
7793
env:
7894
CHANGED_FILES: ${{ inputs.changed_files }}
79-
RUNNER_LABEL: ${{ inputs.runner_label }}
8095
run: |
81-
if [[ "${RUNNER_LABEL}" != "h20" ]]; then
82-
export HTTP_PROXY="http://10.1.12.38:38002"
83-
export HTTPS_PROXY="http://10.1.12.38:38002"
84-
fi
85-
86-
tools/test_backends.sh ${{ inputs.vendor }} ${{ inputs.pr_id }}
96+
source .venv/bin/activate
97+
source tools/set-env.sh ${{ inputs.vendor }}
98+
tools/test-op.sh ${{ inputs.pr_id }}

.github/workflows/code_scan.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/random-test.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
name: Random Test
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
runner:
8+
description: "Label for selecting runners"
9+
required: true
10+
type: string
11+
operators:
12+
description: "Operators (comma separated names)"
13+
required: true
14+
type: string
15+
gpus:
16+
description: "GPUs (comma separated numbers)"
17+
required: true
18+
type: string
19+
secrets:
20+
RUNNER_SSH_KEY:
21+
required: true
22+
PROXYC:
23+
required: true
24+
PROXYG:
25+
required: true
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
test:
31+
runs-on: ${{ inputs.runner }}
32+
steps:
33+
- name: Set global proxy
34+
shell: bash
35+
env:
36+
RUNNER_LABEL: ${{ inputs.runner }}
37+
PROXY: ${{ secrets.PROXYG }}
38+
run: |
39+
# Setup proxy for git checkout
40+
case "${RUNNER_LABEL}" in
41+
h20|metax|hygon)
42+
;;
43+
*)
44+
echo "HTTP_PROXY=${PROXY}" >> $GITHUB_ENV
45+
echo "HTTPS_PROXY=${PROXY}" >> $GITHUB_ENV
46+
;;
47+
esac
48+
49+
- uses: actions/checkout@v6
50+
with:
51+
ssh-key: ${{ secrets.RUNNER_SSH_KEY }}
52+
53+
- name: Setup FlagGems
54+
shell: bash
55+
env:
56+
RUNNER_LABEL: ${{ inputs.runner }}
57+
PROXY: ${{ secrets.PROXYC }}
58+
run: |
59+
# Setup proxy for install if needed
60+
case "${RUNNER_LABEL}" in
61+
h20|metax|hygon)
62+
if [[ "${RUNNER_LABEL}" == "h20" ]]; then
63+
VENDOR="nvidia"
64+
else
65+
VENDOR="${RUNNER_LABEL}"
66+
fi
67+
;;
68+
*)
69+
export HTTP_PROXY="${PROXY}"
70+
export HTTPS_PROXY="${PROXY}"
71+
if [[ "{RUNNER_LABEL}" == "moore" ]]; then
72+
VENDOR="mthreads"
73+
else
74+
VENDOR="${RUNNER_LABEL}"
75+
fi
76+
;;
77+
esac
78+
79+
echo "VENDOR=${VENDOR}"
80+
echo "VENDOR=${VENDOR}" >> $GITHUB_ENV
81+
82+
./setup.sh ${VENDOR}
83+
84+
- name: Check GPU availability
85+
shell: bash
86+
run: |
87+
bash "tools/gpu_check_${VENDOR}.sh"
88+
89+
- name: Run tests
90+
shell: bash
91+
run: |
92+
source .venv/bin/activate
93+
source tools/set-env.sh ${VENDOR}
94+
tools/run_tests.py --ops ${{ inputs.operators }} --gpus ${{ inputs.gpus }}
95+
96+
- name: Upload results
97+
uses: actions/upload-artifact@v7
98+
with:
99+
name: random-test
100+
path: results/

.github/workflows/unittest.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ jobs:
116116
pr_id: ${{ needs.preprocess.outputs.pr_id }}
117117
secrets:
118118
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
119+
PROXYC: ${{ secrets.PROXYC }}
120+
PROXYG: ${{ secrets.PROXYG }}
119121

120122
backend-hygon:
121123
needs: preprocess
@@ -129,6 +131,8 @@ jobs:
129131
pr_id: ${{ needs.preprocess.outputs.pr_id }}
130132
secrets:
131133
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
134+
PROXYC: ${{ secrets.PROXYC }}
135+
PROXYG: ${{ secrets.PROXYG }}
132136

133137
backend-iluvatar:
134138
needs: preprocess
@@ -142,6 +146,8 @@ jobs:
142146
pr_id: ${{ needs.preprocess.outputs.pr_id }}
143147
secrets:
144148
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
149+
PROXYC: ${{ secrets.PROXYC }}
150+
PROXYG: ${{ secrets.PROXYG }}
145151

146152
backend-kunlunxin:
147153
needs: preprocess
@@ -157,6 +163,8 @@ jobs:
157163
pr_id: ${{ needs.preprocess.outputs.pr_id }}
158164
secrets:
159165
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
166+
PROXYC: ${{ secrets.PROXYC }}
167+
PROXYG: ${{ secrets.PROXYG }}
160168

161169
backend-metax:
162170
needs: preprocess
@@ -170,6 +178,8 @@ jobs:
170178
pr_id: ${{ needs.preprocess.outputs.pr_id }}
171179
secrets:
172180
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
181+
PROXYC: ${{ secrets.PROXYC }}
182+
PROXYG: ${{ secrets.PROXYG }}
173183

174184
backend-mthreads:
175185
needs: preprocess
@@ -183,6 +193,8 @@ jobs:
183193
pr_id: ${{ needs.preprocess.outputs.pr_id }}
184194
secrets:
185195
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
196+
PROXYC: ${{ secrets.PROXYC }}
197+
PROXYG: ${{ secrets.PROXYG }}
186198

187199
backend-nvidia:
188200
needs: preprocess
@@ -196,6 +208,8 @@ jobs:
196208
pr_id: ${{ needs.preprocess.outputs.pr_id }}
197209
secrets:
198210
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
211+
PROXYC: ${{ secrets.PROXYC }}
212+
PROXYG: ${{ secrets.PROXYG }}
199213

200214
backend-tsingmicro:
201215
needs: preprocess
@@ -209,6 +223,8 @@ jobs:
209223
pr_id: ${{ needs.preprocess.outputs.pr_id }}
210224
secrets:
211225
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
226+
PROXYC: ${{ secrets.PROXYC }}
227+
PROXYG: ${{ secrets.PROXYG }}
212228

213229
backend-thead:
214230
needs: preprocess
@@ -222,6 +238,8 @@ jobs:
222238
pr_id: ${{ needs.preprocess.outputs.pr_id }}
223239
secrets:
224240
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
241+
PROXYC: ${{ secrets.PROXYC }}
242+
PROXYG: ${{ secrets.PROXYG }}
225243

226244
# TODO(Qiming): This job doesn't require an nvidia backend, the generic
227245
# test-op workflow should be fine.
@@ -237,3 +255,5 @@ jobs:
237255
changed_files: ${{ needs.preprocess.outputs.changed_files }}
238256
secrets:
239257
RUNNER_SSH_KEY: ${{ secrets.RUNNER_SSH_KEY }}
258+
PROXYC: ${{ secrets.PROXYC }}
259+
PROXYG: ${{ secrets.PROXYG }}

0 commit comments

Comments
 (0)