Skip to content

Commit f45f49c

Browse files
committed
001: all files
1 parent 6f83cce commit f45f49c

7 files changed

+295
-41
lines changed

.github/workflows/_ascend_npu_build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ jobs:
7676
with:
7777
name: ${{ steps.list-dist.outputs.dist_name }}
7878
path: ${{ steps.list-dist.outputs.dist_path }}
79+
if-no-files-found: error
7980
retention-days: 1
81+
overwrite: true
8082

8183
- name: Write to workflow job summary
8284
if: ${{ steps.upload-dist.outputs.artifact-url }}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: '_ascend_npu_pytorch_benchmark'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
required: true
8+
type: string
9+
description: 'The runner selected to run on'
10+
image:
11+
required: true
12+
type: string
13+
description: 'The docker image which will be loaded'
14+
device:
15+
required: true
16+
type: string
17+
description: 'The device selected to run on'
18+
artifact_name:
19+
required: true
20+
type: string
21+
description: 'The torch_npu distribution artifact name'
22+
23+
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
24+
# declared as "shell: bash -el {0}" on steps that need to be properly activated.
25+
# It's used to activate ascend-toolkit environment variables.
26+
defaults:
27+
run:
28+
shell: bash -el {0}
29+
30+
jobs:
31+
test:
32+
name: run pytorch benchmark in ${{ inputs.image }} with ${{ inputs.device }}
33+
runs-on: ${{ inputs.runner }}
34+
container:
35+
image: ${{ inputs.image }}
36+
volumes:
37+
- /usr/local/dcmi:/usr/local/dcmi
38+
- /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
39+
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
40+
- /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info
41+
- /etc/ascend_install.info:/etc/ascend_install.info
42+
- /home/runner/actions-runner/codes:/root/codes
43+
options: >-
44+
--network host
45+
--device ${{ inputs.device }}
46+
--device /dev/davinci_manager
47+
--device /dev/devmm_svm
48+
--device /dev/hisi_hdc
49+
steps:
50+
- name: Show NPU info
51+
run: |
52+
npu-smi info
53+
54+
- name: Download distribution artifact
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: ${{ inputs.artifact_name }}
58+
path: /root/build
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: '_ascend_npu_pytorch_examples'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
required: true
8+
type: string
9+
description: 'The runner selected to run on'
10+
image:
11+
required: true
12+
type: string
13+
description: 'The docker image which will be loaded'
14+
device:
15+
required: true
16+
type: string
17+
description: 'The device selected to run on'
18+
artifact_name:
19+
required: true
20+
type: string
21+
description: 'The torch_npu distribution artifact name'
22+
23+
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
24+
# declared as "shell: bash -el {0}" on steps that need to be properly activated.
25+
# It's used to activate ascend-toolkit environment variables.
26+
defaults:
27+
run:
28+
shell: bash -el {0}
29+
30+
jobs:
31+
test:
32+
name: run pytorch examples in ${{ inputs.image }} with ${{ inputs.device }}
33+
runs-on: ${{ inputs.runner }}
34+
container:
35+
image: ${{ inputs.image }}
36+
volumes:
37+
- /usr/local/dcmi:/usr/local/dcmi
38+
- /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
39+
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
40+
- /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info
41+
- /etc/ascend_install.info:/etc/ascend_install.info
42+
- /home/runner/actions-runner/codes:/root/codes
43+
options: >-
44+
--network host
45+
--device ${{ inputs.device }}
46+
--device /dev/davinci_manager
47+
--device /dev/devmm_svm
48+
--device /dev/hisi_hdc
49+
steps:
50+
- name: Show NPU info
51+
run: |
52+
npu-smi info
53+
54+
- name: Download distribution artifact
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: ${{ inputs.artifact_name }}
58+
path: /root/build
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: '_ascend_npu_transformers_examples'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
required: true
8+
type: string
9+
description: 'The runner selected to run on'
10+
image:
11+
required: true
12+
type: string
13+
description: 'The docker image which will be loaded'
14+
device:
15+
required: true
16+
type: string
17+
description: 'The device selected to run on'
18+
artifact_name:
19+
required: true
20+
type: string
21+
description: 'The torch_npu distribution artifact name'
22+
23+
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
24+
# declared as "shell: bash -el {0}" on steps that need to be properly activated.
25+
# It's used to activate ascend-toolkit environment variables.
26+
defaults:
27+
run:
28+
shell: bash -el {0}
29+
30+
jobs:
31+
test:
32+
name: run transformers examples in ${{ inputs.image }} with ${{ inputs.device }}
33+
runs-on: ${{ inputs.runner }}
34+
container:
35+
image: ${{ inputs.image }}
36+
volumes:
37+
- /usr/local/dcmi:/usr/local/dcmi
38+
- /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
39+
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
40+
- /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info
41+
- /etc/ascend_install.info:/etc/ascend_install.info
42+
- /home/runner/actions-runner/codes:/root/codes
43+
options: >-
44+
--network host
45+
--device ${{ inputs.device }}
46+
--device /dev/davinci_manager
47+
--device /dev/devmm_svm
48+
--device /dev/hisi_hdc
49+
steps:
50+
- name: Show NPU info
51+
run: |
52+
npu-smi info
53+
54+
- name: Download distribution artifact
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: ${{ inputs.artifact_name }}
58+
path: /root/build
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: '_ascend_npu_transformers_timm'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
required: true
8+
type: string
9+
description: 'The runner selected to run on'
10+
image:
11+
required: true
12+
type: string
13+
description: 'The docker image which will be loaded'
14+
device:
15+
required: true
16+
type: string
17+
description: 'The device selected to run on'
18+
artifact_name:
19+
required: true
20+
type: string
21+
description: 'The torch_npu distribution artifact name'
22+
23+
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
24+
# declared as "shell: bash -el {0}" on steps that need to be properly activated.
25+
# It's used to activate ascend-toolkit environment variables.
26+
defaults:
27+
run:
28+
shell: bash -el {0}
29+
30+
jobs:
31+
test:
32+
name: run transformers timm in ${{ inputs.image }} with ${{ inputs.device }}
33+
runs-on: ${{ inputs.runner }}
34+
container:
35+
image: ${{ inputs.image }}
36+
volumes:
37+
- /usr/local/dcmi:/usr/local/dcmi
38+
- /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
39+
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
40+
- /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info
41+
- /etc/ascend_install.info:/etc/ascend_install.info
42+
- /home/runner/actions-runner/codes:/root/codes
43+
options: >-
44+
--network host
45+
--device ${{ inputs.device }}
46+
--device /dev/davinci_manager
47+
--device /dev/devmm_svm
48+
--device /dev/hisi_hdc
49+
steps:
50+
- name: Show NPU info
51+
run: |
52+
npu-smi info
53+
54+
- name: Download distribution artifact
55+
uses: actions/download-artifact@v4
56+
with:
57+
name: ${{ inputs.artifact_name }}
58+
path: /root/build

.github/workflows/_ascend_npu_test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77
required: true
88
type: string
99
description: 'The runner selected to run on'
10-
device:
11-
required: true
12-
type: string
13-
description: 'The device selected to run on'
1410
image:
1511
required: true
1612
type: string
1713
description: 'The docker image which will be loaded'
14+
device:
15+
required: true
16+
type: string
17+
description: 'The device selected to run on'
1818
artifact_name:
1919
required: true
2020
type: string

.github/workflows/ascend_npu_test.yml

Lines changed: 57 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ on:
2929
- npu-arm64
3030
default: 'self-hosted'
3131
description: 'The runner selected to run on'
32+
image:
33+
required: true
34+
type: choice
35+
options:
36+
- ascendai/cann:7.1-openeuler2203sp2
37+
- ascendai/cann:8.0.rc2.alpha003-910b-ubuntu22.04-py3.9
38+
- ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9
39+
default: 'ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9'
40+
description: 'The docker image which will be loaded'
3241
device:
3342
required: true
3443
type: choice
@@ -43,15 +52,6 @@ on:
4352
- /dev/davinci8
4453
default: '/dev/davinci6'
4554
description: 'The device selected to run on'
46-
image:
47-
required: true
48-
type: choice
49-
options:
50-
- ascendai/cann:7.1-openeuler2203sp2
51-
- ascendai/cann:8.0.rc2.alpha003-910b-ubuntu22.04-py3.9
52-
- ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9
53-
default: 'ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9'
54-
description: 'The docker image which will be loaded'
5555

5656
# Only cancel the previous runs when triggered by a pull request
5757
concurrency:
@@ -64,8 +64,8 @@ jobs:
6464
runs-on: ubuntu-latest
6565
outputs:
6666
runner: ${{ steps.set-param.outputs.runner }}
67-
device: ${{ steps.set-param.outputs.device }}
6867
image: ${{ steps.set-param.outputs.image }}
68+
device: ${{ steps.set-param.outputs.device }}
6969
steps:
7070
- name: Set param
7171
id: set-param
@@ -107,34 +107,54 @@ jobs:
107107
uses: ./.github/workflows/_ascend_npu_test.yml
108108
with:
109109
runner: ${{ needs.prepare.outputs.runner }}
110+
image: ${{ needs.prepare.outputs.image }}
110111
device: ${{ needs.prepare.outputs.device }}
112+
artifact_name: ${{ needs.build.outputs.artifact_name }}
113+
114+
pytorch-examples:
115+
name: Run PyTorch examples
116+
needs:
117+
- prepare
118+
- test
119+
uses: ./.github/workflows/_ascend_npu_run_pytorch_examples.yml
120+
with:
121+
runner: ${{ needs.prepare.outputs.runner }}
111122
image: ${{ needs.prepare.outputs.image }}
123+
device: ${{ needs.prepare.outputs.device }}
112124
artifact_name: ${{ needs.build.outputs.artifact_name }}
113125

114-
# pytorch-examples:
115-
# name: Run PyTorch examples
116-
# needs:
117-
# - prepare
118-
# - build
119-
# runs-on: ${{ needs.prepare.outputs.runner }}
120-
#
121-
# pytorch-benchmark:
122-
# name: Run PyTorch benchmark
123-
# needs:
124-
# - prepare
125-
# - build
126-
# runs-on: ${{ needs.prepare.outputs.runner }}
127-
#
128-
# transformers-examples:
129-
# name: Run transformers examples
130-
# needs:
131-
# - prepare
132-
# - build
133-
# runs-on: ${{ needs.prepare.outputs.runner }}
134-
#
135-
# transformers-timm:
136-
# name: Run PyTorch examples
137-
# needs:
138-
# - prepare
139-
# - build
140-
# runs-on: ${{ needs.prepare.outputs.runner }}
126+
pytorch-benchmark:
127+
name: Run PyTorch benchmark
128+
needs:
129+
- prepare
130+
- pytorch-examples
131+
uses: ./.github/workflows/_ascend_npu_run_pytorch_benchmark.yml
132+
with:
133+
runner: ${{ needs.prepare.outputs.runner }}
134+
image: ${{ needs.prepare.outputs.image }}
135+
device: ${{ needs.prepare.outputs.device }}
136+
artifact_name: ${{ needs.build.outputs.artifact_name }}
137+
138+
transformers-examples:
139+
name: Run transformers examples
140+
needs:
141+
- prepare
142+
- pytorch-benchmark
143+
uses: ./.github/workflows/_ascend_npu_run_transformers_examples.yml
144+
with:
145+
runner: ${{ needs.prepare.outputs.runner }}
146+
image: ${{ needs.prepare.outputs.image }}
147+
device: ${{ needs.prepare.outputs.device }}
148+
artifact_name: ${{ needs.build.outputs.artifact_name }}
149+
150+
transformers-timm:
151+
name: Run PyTorch image models(timm)
152+
needs:
153+
- prepare
154+
- transformers-examples
155+
uses: ./.github/workflows/_ascend_npu_run_transformers_timm.yml
156+
with:
157+
runner: ${{ needs.prepare.outputs.runner }}
158+
image: ${{ needs.prepare.outputs.image }}
159+
device: ${{ needs.prepare.outputs.device }}
160+
artifact_name: ${{ needs.build.outputs.artifact_name }}

0 commit comments

Comments
 (0)