Skip to content

Commit 5aa8a95

Browse files
authored
Support exporting SenseVoice and Paraformer to Ascend 310P3 NPU. (#2716)
1 parent b68e69d commit 5aa8a95

File tree

7 files changed

+388
-58
lines changed

7 files changed

+388
-58
lines changed

.github/workflows/build-wheels-aarch64.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jobs:
6666
find /opt -name "python*"
6767
6868
echo "--------------------"
69-
export PATH=/opt/_internal/cpython-3.10.18/bin:$PATH
69+
PY_PATH=$(echo /opt/_internal/cpython-3.10*/bin)
70+
export PATH=$PY_PATH:$PATH
7071
which python3
7172
python3 --version
7273

.github/workflows/build-wheels-linux.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jobs:
6666
find /opt -name "python*"
6767
6868
echo "--------------------"
69-
export PATH=/opt/_internal/cpython-3.10.18/bin:$PATH
69+
PY_PATH=$(echo /opt/_internal/cpython-3.10*/bin)
70+
export PATH=$PY_PATH:$PATH
7071
which python3
7172
python3 --version
7273

.github/workflows/export-paraformer-to-ascend-npu.yaml

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: export-paraformer-to-ascend-npu
33
on:
44
push:
55
branches:
6-
- ascend-npu
6+
- ascend-npu-310
77
workflow_dispatch:
88

99
concurrency:
@@ -13,32 +13,53 @@ concurrency:
1313
jobs:
1414
export-paraformer-to-rknn:
1515
if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj'
16-
name: ${{ matrix.framework }}
17-
runs-on: ${{ matrix.os }}
16+
name: ${{ matrix.framework }} ${{ matrix.soc_version }}
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
# ===== Ascend 910B =====
24+
- soc_version: "910B"
25+
image: "gpustack/ascendai-cann:8.0.RC3-910b-ubuntu20.04-py3.9"
26+
framework: "FunASR"
27+
28+
- soc_version: "910B"
29+
image: "gpustack/ascendai-cann:8.0.RC3-910b-ubuntu20.04-py3.9"
30+
framework: "WSChuan-ASR"
31+
32+
# ===== Ascend 310 =====
33+
- soc_version: "310P3"
34+
# image: "gpustack/ascendai-cann:8.0.RC2.alpha003-310p-ubuntu20.04-py3.9"
35+
image: "gpustack/devel-ascendai-cann:8.0.rc3.beta1-310p-ubuntu20.04-v2"
36+
framework: "FunASR"
37+
38+
- soc_version: "310P3"
39+
# image: "gpustack/ascendai-cann:8.0.RC2.alpha003-310p-ubuntu20.04-py3.9"
40+
image: "gpustack/devel-ascendai-cann:8.0.rc3.beta1-310p-ubuntu20.04-v2"
41+
framework: "WSChuan-ASR"
42+
1843
container:
1944
# image: ascendai/cann:latest
2045
# image: ascendai/cann:8.1.rc1-910b-ubuntu22.04-py3.10
2146
# see https://hub.docker.com/r/gpustack/ascendai-cann/tags?name=8.0
22-
image: gpustack/ascendai-cann:8.0.RC3-910b-ubuntu20.04-py3.9
23-
strategy:
24-
fail-fast: false
25-
matrix:
26-
os: [ubuntu-latest]
27-
python-version: ["3.8"]
28-
framework: ["FunASR", "WSChuan-ASR"]
47+
# see https://hub.docker.com/r/gpustack/devel-ascendai-cann/tags?name=310p
48+
image: ${{ matrix.image }}
2949

3050
steps:
3151
- uses: actions/checkout@v4
3252

33-
- name: Setup Python ${{ matrix.python-version }}
53+
- name: Setup Python 3.8
3454
uses: actions/setup-python@v5
3555
with:
36-
python-version: ${{ matrix.python-version }}
56+
python-version: "3.8"
3757

3858
- name: Show Python
3959
shell: bash
4060
run: |
4161
python3 --version
62+
which python3
4263
4364
- name: Install curl
4465
shell: bash
@@ -109,14 +130,16 @@ jobs:
109130
source /usr/local/Ascend/ascend-toolkit/set_env.sh
110131
export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib/linux/x86_64:$LD_LIBRARY_PATH
111132
133+
soc_version=${{ matrix.soc_version }}
134+
112135
atc --model=./predictor.onnx \
113136
--framework=5 \
114137
--host_env_os=linux \
115138
--host_env_cpu=aarch64 \
116139
--output=predictor \
117140
--input_format=ND \
118141
--input_shape="encoder_out:1,-1,512" \
119-
--soc_version="Ascend910B"
142+
--soc_version="Ascend${soc_version}"
120143
121144
ls -lh *.om
122145
@@ -127,7 +150,7 @@ jobs:
127150
--output=decoder \
128151
--input_format=ND \
129152
--input_shape="encoder_out:1,-1,512;acoustic_embedding:1,-1,512" \
130-
--soc_version="Ascend910B"
153+
--soc_version="Ascend${soc_version}"
131154
132155
ls -lh *.om
133156
@@ -138,7 +161,7 @@ jobs:
138161
--output=encoder \
139162
--input_format=ND \
140163
--input_shape="x:1,-1,560" \
141-
--soc_version="Ascend910B"
164+
--soc_version="Ascend${soc_version}"
142165
143166
ls -lh *.om
144167
@@ -199,14 +222,16 @@ jobs:
199222
source /usr/local/Ascend/ascend-toolkit/set_env.sh
200223
export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib/linux/x86_64:$LD_LIBRARY_PATH
201224
225+
soc_version=${{ matrix.soc_version }}
226+
202227
atc --model=./predictor.onnx \
203228
--framework=5 \
204229
--host_env_os=linux \
205230
--host_env_cpu=aarch64 \
206231
--output=predictor \
207232
--input_format=ND \
208233
--input_shape="encoder_out:1,-1,512" \
209-
--soc_version="Ascend910B"
234+
--soc_version="Ascend${soc_version}"
210235
211236
ls -lh *.om
212237
@@ -217,7 +242,7 @@ jobs:
217242
--output=decoder \
218243
--input_format=ND \
219244
--input_shape="encoder_out:1,-1,512;acoustic_embedding:1,-1,512" \
220-
--soc_version="Ascend910B"
245+
--soc_version="Ascend${soc_version}"
221246
222247
ls -lh *.om
223248
@@ -228,13 +253,13 @@ jobs:
228253
--output=encoder \
229254
--input_format=ND \
230255
--input_shape="x:1,-1,560" \
231-
--soc_version="Ascend910B"
256+
--soc_version="Ascend${soc_version}"
232257
233258
ls -lh *.om
234259
235260
236261
echo "collect results"
237-
d=sherpa-onnx-ascend-910B-paraformer-zh-2025-10-07
262+
d=sherpa-onnx-ascend-${soc_version}-paraformer-zh-2025-10-07
238263
239264
mkdir -p $d
240265
mkdir -p $d/test_wavs

.github/workflows/export-sense-voice-to-ascend-npu.yaml

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: export-sense-voice-to-ascend-npu
33
on:
44
push:
55
branches:
6-
- export-sense-voice-ascend
6+
- ascend-npu-310-
77
workflow_dispatch:
88

99
concurrency:
@@ -13,32 +13,53 @@ concurrency:
1313
jobs:
1414
export-sense-voice-to-ascend-npu:
1515
if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj'
16-
name: ${{ matrix.framework }}
17-
runs-on: ${{ matrix.os }}
16+
name: ${{ matrix.framework }} ${{ matrix.soc_version }}
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
# ===== Ascend 910B =====
24+
- soc_version: "910B"
25+
image: "gpustack/ascendai-cann:8.0.RC3-910b-ubuntu20.04-py3.9"
26+
framework: "FunASR"
27+
28+
- soc_version: "910B"
29+
image: "gpustack/ascendai-cann:8.0.RC3-910b-ubuntu20.04-py3.9"
30+
framework: "WSYue-ASR"
31+
32+
# ===== Ascend 310 =====
33+
- soc_version: "310P3"
34+
# image: "gpustack/ascendai-cann:8.0.RC2.alpha003-310p-ubuntu20.04-py3.9"
35+
image: "gpustack/devel-ascendai-cann:8.0.rc3.beta1-310p-ubuntu20.04-v2"
36+
framework: "FunASR"
37+
38+
- soc_version: "310P3"
39+
# image: "gpustack/ascendai-cann:8.0.RC2.alpha003-310p-ubuntu20.04-py3.9"
40+
image: "gpustack/devel-ascendai-cann:8.0.rc3.beta1-310p-ubuntu20.04-v2"
41+
framework: "WSYue-ASR"
42+
1843
container:
1944
# image: ascendai/cann:latest
2045
# image: ascendai/cann:8.1.rc1-910b-ubuntu22.04-py3.10
2146
# see https://hub.docker.com/r/gpustack/ascendai-cann/tags?name=8.0
22-
image: gpustack/ascendai-cann:8.0.RC3-910b-ubuntu20.04-py3.9
23-
strategy:
24-
fail-fast: false
25-
matrix:
26-
os: [ubuntu-latest]
27-
python-version: ["3.8"]
28-
framework: ["FunASR", "WSYue-ASR"]
47+
# see https://hub.docker.com/r/gpustack/devel-ascendai-cann/tags?name=310p
48+
image: ${{ matrix.image }}
2949

3050
steps:
3151
- uses: actions/checkout@v4
3252

33-
- name: Setup Python ${{ matrix.python-version }}
53+
- name: Setup Python 3.8
3454
uses: actions/setup-python@v5
3555
with:
36-
python-version: ${{ matrix.python-version }}
56+
python-version: "3.8"
3757

3858
- name: Show Python
3959
shell: bash
4060
run: |
4161
python3 --version
62+
which python3
4263
4364
- name: Install curl
4465
shell: bash
@@ -99,19 +120,21 @@ jobs:
99120
source /usr/local/Ascend/ascend-toolkit/set_env.sh
100121
export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib/linux/x86_64:$LD_LIBRARY_PATH
101122
123+
soc_version=${{ matrix.soc_version }}
124+
102125
atc --model=./model.onnx \
103126
--framework=5 \
104127
--host_env_os=linux \
105128
--host_env_cpu=aarch64 \
106129
--output=model \
107130
--input_format=ND \
108131
--input_shape="x:1,-1,560;prompt:4" \
109-
--soc_version="Ascend910B"
132+
--soc_version="Ascend${soc_version}"
110133
111134
ls -lh *.om
112135
113136
echo "collect results"
114-
d=sherpa-onnx-ascend-910B-sense-voice-zh-en-ja-ko-yue-2024-07-17
137+
d=sherpa-onnx-ascend-${soc_version}-sense-voice-zh-en-ja-ko-yue-2024-07-17
115138
116139
mkdir -p $d
117140
mkdir -p $d/test_wavs
@@ -163,19 +186,21 @@ jobs:
163186
source /usr/local/Ascend/ascend-toolkit/set_env.sh
164187
export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib/linux/x86_64:$LD_LIBRARY_PATH
165188
189+
soc_version=${{ matrix.soc_version }}
190+
166191
atc --model=./model.onnx \
167192
--framework=5 \
168193
--host_env_os=linux \
169194
--host_env_cpu=aarch64 \
170195
--output=model \
171196
--input_format=ND \
172197
--input_shape="x:1,-1,560;prompt:4" \
173-
--soc_version="Ascend910B"
198+
--soc_version="Ascend${soc_version}"
174199
175200
ls -lh *.om
176201
177202
echo "collect results"
178-
d=sherpa-onnx-ascend-910B-sense-voice-zh-en-ja-ko-yue-2025-09-09
203+
d=sherpa-onnx-ascend-${soc_version}-sense-voice-zh-en-ja-ko-yue-2025-09-09
179204
180205
mkdir -p $d
181206
mkdir -p $d/test_wavs

0 commit comments

Comments
 (0)