Skip to content

Commit 405bc16

Browse files
authored
Merge pull request #852 from EESN-W/aicore-ax-m1
AICore ax m1
2 parents 9957cdd + efc3c5c commit 405bc16

File tree

93 files changed

+6526
-0
lines changed

Some content is hidden

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

93 files changed

+6526
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,3 +375,4 @@ i18n/en/docusaurus-plugin-content-docs/current/orion/o6/bios/install-bios.md @me
375375
docs/orion/o6/app-development/artificial-intelligence/npu-introduction.md @vamrs-feng
376376
docs/common/radxa-os/_autologin.mdx @Ken-Vamrs
377377
docs/common/dev/_nvme.mdx @nascs
378+
docs/aicore/ax-m1/text-to-image/sd15.md @vamrs-feng

docs/aicore/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# 瑞莎智核系列
6+
7+
瑞莎智核(AICore)系列是瑞莎推出的高性能、高算力和高性价比的 AI 加速模组。
8+
9+
## 主要特点
10+
11+
瑞莎智核系列具有以下主要特点:
12+
13+
- 高性能
14+
15+
采用高性能 SoC,提供出色的通用计算能力和多任务处理能力。
16+
17+
- 高算力
18+
19+
采用高算力的 NPU,提供出色的 AI 计算推理能力。
20+
21+
- 标准化接口
22+
23+
采用 M.2 M Key 标准接口,支持主流工业和嵌入式主板使用。
24+
25+
## 产品列表
26+
27+
| 瑞莎智核 AX-M1 |
28+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29+
| ![瑞莎智核 AX-M1](/img/aicore-ax-m1/aicore_ax_m1_top.webp) |
30+
| [瑞莎智核 AX-M1](/aicore/ax-m1/README.md) 是一款基于爱芯元智公司 AX8850 SoC 推出的高性能 M.2 加速模组,具有高算力、高能效比等特性,专为边缘智能计算与 AI 推理应用打造 |

docs/aicore/ax-m1/Audio/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# 音频模型
6+
7+
主要介绍音频模型的示例 demo 使用。
8+
9+
<DocCardList />

docs/aicore/ax-m1/Audio/melotts.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
sidebar_position: 0
3+
---
4+
5+
# MeloTTS
6+
7+
此文档讲解如何在安装了瑞莎智核 AX-M1 的 host 设备上运行 [MeloTTS](https://github.com/myshell-ai/MeloTTS) 示例应用。
8+
9+
## 下载示例应用仓库
10+
11+
使用 `huggingfcae-cli` 下载示例应用仓库。
12+
13+
<NewCodeBlock tip="Host" type="Device">
14+
15+
```bash
16+
pip3 install -U "huggingface_hub[cli]"
17+
huggingface-cli download AXERA-TECH/MeloTTS --local-dir ./MeloTTS
18+
cd MeloTTS
19+
```
20+
21+
</NewCodeBlock>
22+
23+
## 示例使用
24+
25+
### 安装 python 依赖
26+
27+
<NewCodeBlock tip="Host" type="Device">
28+
29+
```bash
30+
cd python
31+
pip3 install -r requirements.txt
32+
pip3 install https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc1/axengine-0.1.3-py3-none-any.whl
33+
```
34+
35+
</NewCodeBlock>
36+
37+
### 安装系统依赖
38+
39+
<NewCodeBlock tip="Host" type="Device">
40+
41+
```bash
42+
sudo apt-get install libsndfile1-dev libmecab-dev
43+
44+
```
45+
46+
</NewCodeBlock>
47+
48+
### 复制 nltk_data 文件
49+
50+
<NewCodeBlock tip="Host" type="Device">
51+
52+
```bash
53+
cp -r ../nltk_data ~/
54+
```
55+
56+
</NewCodeBlock>
57+
58+
### 模型推理
59+
60+
<NewCodeBlock tip="Host" type="Device">
61+
62+
```bash
63+
python3 melotts.py -s 瑞莎计算机是一家专注于开发和制造单板计算机的中国科技公司,总部位于深圳。 -e ../encoder-onnx/encoder-zh.onnx -d ../decoder-ax650/decoder-zh.axmodel
64+
```
65+
66+
</NewCodeBlock>
67+
68+
:::tip
69+
请自行修改 melotts.py 中 164 行的 `g-{language.lower()}.bin` 路径
70+
:::
71+
72+
```bash
73+
(.venv) rock@rock-5b-plus:~/ssd/axera/MeloTTS/python$ python3 melotts.py -s 瑞莎计算机是一家专注于开发和制造单板计算机的中国科技公司,总部位于深圳。 -e ../encoder-onnx/encoder-zh.onnx -d ../decoder-ax650/decoder-zh.axmodel
74+
[INFO] Available providers: ['AXCLRTExecutionProvider']
75+
sentence: 瑞莎计算机是一家专注于开发和制造单板计算机的中国科技公司,总部位于深圳。
76+
sample_rate: 44100
77+
encoder: ../encoder-onnx/encoder-zh.onnx
78+
decoder: ../decoder-ax650/decoder-zh.axmodel
79+
language: ZH_MIX_EN
80+
> Text split to sentences.
81+
瑞莎计算机是一家专注于开发和制造单板计算机的中国科技公司,
82+
总部位于深圳.
83+
> ===========================
84+
split_sentences_into_pieces take 0.5743503570556641ms
85+
[INFO] Using provider: AXCLRTExecutionProvider
86+
[INFO] SOC Name: AX650N
87+
[INFO] VNPU type: VNPUType.DISABLED
88+
[INFO] Compiler version: 3.3 3251425d
89+
load models take 2446.855306625366ms
90+
91+
Sentence[0]: 瑞莎计算机是一家专注于开发和制造单板计算机的中国科技公司,
92+
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
93+
Load language module take 7701.969146728516ms
94+
Building prefix dict from the default dictionary ...
95+
Loading model from cache /tmp/jieba.cache
96+
Loading model cost 0.809 seconds.
97+
Prefix dict has been built successfully.
98+
encoder run take 113.38ms
99+
Decode slice[0]: decoder run take 94.97ms
100+
Decode slice[1]: decoder run take 92.53ms
101+
Decode slice[2]: decoder run take 92.46ms
102+
Decode slice[3]: decoder run take 92.45ms
103+
Decode slice[4]: decoder run take 92.44ms
104+
Decode slice[5]: decoder run take 92.38ms
105+
106+
Sentence[1]: 总部位于深圳.
107+
Load language module take 0.013828277587890625ms
108+
encoder run take 52.27ms
109+
Decode slice[0]: decoder run take 93.02ms
110+
Decode slice[1]: decoder run take 92.62ms
111+
Save to output.wav
112+
```

docs/aicore/ax-m1/Audio/whisper.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Whisper
6+
7+
此文档讲解如何在安装了瑞莎智核 AX-M1 的 host 设备上运行 [Whisper](https://github.com/openai/whisper) 示例应用。
8+
9+
## 下载示例应用仓库
10+
11+
使用 `huggingfcae-cli` 下载示例应用仓库。
12+
13+
<NewCodeBlock tip="Host" type="Device">
14+
15+
```bash
16+
pip3 install -U "huggingface_hub[cli]"
17+
huggingface-cli download AXERA-TECH/Whisper --local-dir ./Whisper
18+
cd Whisper
19+
```
20+
21+
</NewCodeBlock>
22+
23+
## 示例使用
24+
25+
### 安装 python 依赖
26+
27+
<NewCodeBlock tip="Host" type="Device">
28+
29+
```bash
30+
cd python
31+
pip3 install -r requirements.txt
32+
pip3 install https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc1/axengine-0.1.3-py3-none-any.whl
33+
```
34+
35+
</NewCodeBlock>
36+
37+
### 模型推理
38+
39+
<NewCodeBlock tip="Host" type="Device">
40+
41+
```bash
42+
python3 whisper.py --wav ../demo.wav --model_type small --model_path ../models-ax650/small/ -l zh
43+
```
44+
45+
</NewCodeBlock>
46+
47+
:::tip
48+
请自行修改 melotts.py 中 164 行的 `g-{language.lower()}.bin` 路径
49+
:::
50+
51+
```bash
52+
(.venv) rock@rock-5b-plus:~/ssd/axera/Whisper/python$ python3 whisper.py --wav ../demo.wav --model_type small --model_path ../models-ax650/small/ -l zh
53+
[INFO] Available providers: ['AXCLRTExecutionProvider']
54+
wav: ../demo.wav
55+
model_type: small
56+
model_path: ../models-ax650/small/
57+
language: zh
58+
[INFO] Using provider: AXCLRTExecutionProvider
59+
[INFO] SOC Name: AX650N
60+
[INFO] VNPU type: VNPUType.DISABLED
61+
[INFO] Compiler version: 3.2-patch1 117f5fd4
62+
[INFO] Using provider: AXCLRTExecutionProvider
63+
[INFO] SOC Name: AX650N
64+
[INFO] VNPU type: VNPUType.DISABLED
65+
[INFO] Compiler version: 3.2-patch1 117f5fd4
66+
[INFO] Using provider: AXCLRTExecutionProvider
67+
[INFO] SOC Name: AX650N
68+
[INFO] VNPU type: VNPUType.DISABLED
69+
[INFO] Compiler version: 3.2-patch1 117f5fd4
70+
Load models take 10340.124607086182ms
71+
Preprocess wav take 52.04367637634277ms
72+
Run encoder take 382.8761577606201ms
73+
Run decoder_main take 260.6687545776367ms
74+
First token: 17556
75+
Run decoder_loop take 320.3253746032715ms
76+
Iter 0 Token: 20844
77+
Run decoder_loop take 378.09014320373535ms
78+
Iter 1 Token: 7781
79+
Run decoder_loop take 320.0690746307373ms
80+
Iter 2 Token: 20204
81+
Run decoder_loop take 307.8148365020752ms
82+
Iter 3 Token: 28455
83+
Run decoder_loop take 319.16141510009766ms
84+
Iter 4 Token: 31962
85+
Run decoder_loop take 307.8572750091553ms
86+
Iter 5 Token: 6336
87+
Run decoder_loop take 318.7582492828369ms
88+
Iter 6 Token: 254
89+
Run decoder_loop take 307.97505378723145ms
90+
Iter 7 Token: 2930
91+
Run decoder_loop take 318.79711151123047ms
92+
Iter 8 Token: 236
93+
Run decoder_loop take 307.94668197631836ms
94+
Iter 9 Token: 36135
95+
Run decoder_loop take 317.66581535339355ms
96+
Iter 10 Token: 15868
97+
Run decoder_loop take 308.0439567565918ms
98+
Iter 11 Token: 252
99+
Run decoder_loop take 317.3696994781494ms
100+
Iter 12 Token: 1546
101+
Run decoder_loop take 308.08019638061523ms
102+
Iter 13 Token: 46514
103+
Run decoder_loop take 317.45195388793945ms
104+
Iter 14 Token: 50257
105+
Result: 甚至出现交易几乎停滞的情况
106+
```

docs/aicore/ax-m1/LLM/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
sidebar_position: 7
3+
---
4+
5+
# 大语言模型
6+
7+
主要介绍大语言模型(LLM)的示例 demo 使用。
8+
9+
<DocCardList />

0 commit comments

Comments
 (0)