Skip to content

Commit

Permalink
Update RK3562/RK3566/RK3568/RK3576/RK3588/RV1103B/RV1103/RV1106/RK211…
Browse files Browse the repository at this point in the history
…8 NPU SDK to V2.2.0

Signed-off-by: Randall Zhuo <[email protected]>
  • Loading branch information
Randall Zhuo committed Sep 18, 2024
1 parent deaba85 commit 7efa763
Show file tree
Hide file tree
Showing 95 changed files with 803 additions and 312 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## v2.2.0

- Support installation via pip
- Optimize transformer model performance
- Support Python 3.12
- Operator optimization, such as softmax, hardmax, MatMul, etc.

## v2.1.0

- Support RV1103B (Beta)
Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- RK3566/RK3568 Series
- RK3562 Series
- RV1103/RV1106
- RV1103B
- RV1103B/RV1106B
- RK2118


Expand All @@ -42,11 +42,15 @@ Note:

# Notes
- RKNN-Toolkit2 is not compatible with [RKNN-Toolkit](https://github.com/airockchip/rknn-toolkit)
- Currently only support on:
- Ubuntu 18.04 python 3.6/3.7
- Ubuntu 20.04 python 3.8/3.9
- Ubuntu 22.04 python 3.10/3.11
- Latest version:v2.1.0
- The supported Python versions are:
- Python 3.6
- Python 3.7
- Python 3.8
- Python 3.9
- Python 3.10
- Python 3.11
- Python 3.12
- Latest version:v2.2.0



Expand All @@ -60,13 +64,11 @@ https://github.com/airockchip/rknn-llm

# CHANGELOG

## v2.1.0
- Support RV1103B (Beta)
- Support RK2118 (Beta)
- Support Flash Attention (Only RK3562 and RK3576)
- Improve MatMul API
- Improve support for int32 and int64
- Support more operators and operator fusion
## v2.2.0
- Support installation via pip
- Optimize transformer model performance
- Support Python 3.12
- Operator optimization, such as softmax, hardmax, MatMul, etc.

for older version, please refer [CHANGELOG](CHANGELOG.md)

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
6 changes: 3 additions & 3 deletions doc/Using RKNN-ToolKit2 in WSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
- You can refer to the following link for installing WSL: https://learn.microsoft.com/en-us/windows/wsl/install

## 2. Using RKNN-Toolkit2 in WSL
1. Refer to the document[《Rockchip_RKNPU_Quick_Start》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.0.0beta0_EN.pdf) to install the RKNN-ToolKit2 environment in WSL
2. Refer to the document[《Rockchip_RKNPU_User_Guide》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_EN.pdf) for model conversion, quantization, and other operations in WSL.
1. Refer to the document[《Rockchip_RKNPU_Quick_Start》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/) to install the RKNN-ToolKit2 environment in WSL
2. Refer to the document[《Rockchip_RKNPU_User_Guide》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/) for model conversion, quantization, and other operations in WSL.

## 3. Using RKNN-Toolkit2 for Board Debugging in WSL

Expand Down Expand Up @@ -45,7 +45,7 @@ adb connect <IP address:port>
- `IP address` is the IP address of the Windows host.

### 3.3 Using RKNN-Toolkit2 for Board Debugging
Refer to the document [《Rockchip_RKNPU_User_Guide》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_EN.pdf) for board inference, accuracy analysis, and other operations in WSL.
Refer to the document [《Rockchip_RKNPU_User_Guide》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/) for board inference, accuracy analysis, and other operations in WSL.



Expand Down
6 changes: 3 additions & 3 deletions doc/WSL中使用RKNN_ToolKit2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
- 可参考 https://learn.microsoft.com/zh-cn/windows/wsl/install

## 2. WSL 中使用RKNN-Toolkit2
1. 参考[《Rockchip_RKNPU_Quick_Start手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/01_Rockchip_RKNPU_Quick_Start_RKNN_SDK_V2.0.0beta0_CN.pdf)在 WSL 中安装RKNN-ToolKit2环境
2. 参考[《Rockchip_RKNPU_User_Guide手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_CN.pdf)在 WSL 进行模型转换、量化等操作
1. 参考[《Rockchip_RKNPU_Quick_Start手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/)在 WSL 中安装RKNN-ToolKit2环境
2. 参考[《Rockchip_RKNPU_User_Guide手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/)在 WSL 进行模型转换、量化等操作

## 3. WSL 中使用RKNN-Toolkit2进行连板调试

Expand Down Expand Up @@ -45,7 +45,7 @@ adb connect <IP地址:端口号>
- `IP地址` 为 Windows主机 的IP地址

### 3.3 使用RKNN-ToolKit2进行连板调试
参考[《Rockchip_RKNPU_User_Guide手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/02_Rockchip_RKNPU_User_Guide_RKNN_SDK_V2.0.0beta0_CN.pdf)在 WSL 进行连板推理、连板精度分析等操作
参考[《Rockchip_RKNPU_User_Guide手册》](https://github.com/airockchip/rknn-toolkit2/blob/master/doc/)在 WSL 进行连板推理、连板精度分析等操作



Expand Down
4 changes: 4 additions & 0 deletions rknn-toolkit-lite2/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-09-14
版本: v2.2.0
1. 修复已知BUG。

2024-08-08
版本: v2.1.0
1. 修复已知BUG。
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified rknn-toolkit-lite2/examples/resnet18/resnet18_for_rk3562.rknn
Binary file not shown.
Binary file not shown.
Binary file modified rknn-toolkit-lite2/examples/resnet18/resnet18_for_rk3576.rknn
Binary file not shown.
Binary file modified rknn-toolkit-lite2/examples/resnet18/resnet18_for_rk3588.rknn
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
a69816d9d726afb408a14e6b1670b0cb rknn_toolkit_lite2-2.2.0-cp310-cp310-linux_aarch64.whl
ee32d72bbf968133b5314c68d731b661 rknn_toolkit_lite2-2.2.0-cp311-cp311-linux_aarch64.whl
c0986325c9af139916e2383c4a05079c rknn_toolkit_lite2-2.2.0-cp312-cp312-linux_aarch64.whl
c914cc293bbb4a2c1eccfa267bfd727c rknn_toolkit_lite2-2.2.0-cp37-cp37m-linux_aarch64.whl
46a239929fbf7b820646f0d54ec6ed09 rknn_toolkit_lite2-2.2.0-cp38-cp38-linux_aarch64.whl
7c8a01028d0b496c2c805f4b14749a99 rknn_toolkit_lite2-2.2.0-cp39-cp39-linux_aarch64.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
44 changes: 44 additions & 0 deletions rknn-toolkit2/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
2024-9-2:
版本: v2.2.0:
更新内容:
1. 增加对bool输出的连扳推理支持
2. 增加rv1106b支持
3. whl包标准化(manylinux)
4. 优化pad和mul相关的消融规则
5. 优化TP的图级别消除
6. 优化QAT模型支持
7. 优化Gather性能
8. 提高连板稳定性
9. 更新动态shape功能
10. 修复大模型混合量化报错
11. 修复Caffe的inplace layer报错
12. 完善带broadcast的Less/Greater/LessOrEqual/GreaterOrEqual/And/Or/Max/Min/Mean/Sum算子情况支持
13. 增加RK3576 exSoftmaxMask(softmax+where)算子支持
14. 完善Softmax算子支持
15. 增加RK3562、RK3588、RK1106 Hardmax支持
16. 完善RK3576 ConvDepthwise + Eltwise OP融合
17. 增加RK3576 FP16类型Conv稀疏化推理
18. 修复多线程运行失败问题
19. 修复RKLLM模型和RKNN模型混合运行失败问题

2024-8-22
版本: v2.1.1b1:
更新内容:
1. 增加Transpose NPU算子支持,例如放宽perm=[1,2,0,3]规格NPU算子限制。
2. 增强mode=bilinear Resize CPU算子浮点类型性能。
3. 增加pixel-norm算子CPU实现。
4. 增加python3.12的支持
5. 增加动态权重conv的部分支持
6. 增加PixelNorm/Sum支持
7. 优化split&elements子图结构性能
8. 优化exNorm前后Reshape开销
9. 完善 einsum 支持
10. 修复超2G模型报错

2024-8-14
版本: v2.1.1b0:
更新内容:
1. rk3576增加softmaxmask NPU算子支持。
2. 增加lpNormalization非4维支持
3. 优化Pool/GatherElements性能

2024-8-1
版本: v2.1.0:
更新内容:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN pip3 config set install.trusted-host pypi.tuna.tsinghua.edu.cn

RUN python3 --version
RUN pip3 --version
COPY rknn_toolkit2-2.1.0+708089d1-cp38-cp38-linux_x86_64.whl rknn_toolkit2-2.1.0+708089d1-cp38-cp38-linux_x86_64.whl
COPY rknn_toolkit2-2.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl rknn_toolkit2-2.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
RUN pip3 install torch==1.10.1
RUN pip3 install rknn_toolkit2-2.1.0+708089d1-cp38-cp38-linux_x86_64.whl
RUN pip3 install rknn_toolkit2-2.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
RUN pip3 cache purge
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse
13 changes: 7 additions & 6 deletions rknn-toolkit2/packages/md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
49dc6e0b6c276db1db44ba38e6f4a277 rknn_toolkit2-2.1.0+708089d1-cp310-cp310-linux_x86_64.whl
3ed72827476a2b2905471c8dddd33a04 rknn_toolkit2-2.1.0+708089d1-cp311-cp311-linux_x86_64.whl
5d8441cb5951cff671cb678584c83d93 rknn_toolkit2-2.1.0+708089d1-cp36-cp36m-linux_x86_64.whl
004c4d1eebc3f55572858020145ed147 rknn_toolkit2-2.1.0+708089d1-cp37-cp37m-linux_x86_64.whl
f819ebb2a3badbc44b21924969c7f588 rknn_toolkit2-2.1.0+708089d1-cp38-cp38-linux_x86_64.whl
f84006e40bf8039757a2ae67013c8a11 rknn_toolkit2-2.1.0+708089d1-cp39-cp39-linux_x86_64.whl
c251f5bc4f225ef6b51063a049c25c49 rknn_toolkit2-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
a977e101a4442e2318ad65346a1ffc48 rknn_toolkit2-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
f696ddda34999ded3c678fc71a6cf96e rknn_toolkit2-2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
c90dc194440ff14c5e64634eb89a0c10 rknn_toolkit2-2.2.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
8008bf8d3d37d7646e7e68d60e6657cc rknn_toolkit2-2.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
6894f32075a517b78e5f3cab1608dd8c rknn_toolkit2-2.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
f6b2ca1a63b1ef7ec4afadcfde623af8 rknn_toolkit2-2.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ numpy<=1.26.4

# base
onnx==1.14.1
onnxoptimizer==0.3.8
onnxruntime==1.16.0
torch>=1.13.1,<=2.1.0
tensorflow==2.8.1
# tensorflow>=2.8.0rc0,<=2.14.0
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# if install failed, please change the pip source to 'https://pypi.tuna.tsinghua.edu.cn/simple/'

# base deps
protobuf==3.20.3
protobuf>=4.21.0,<=4.25.4

# utils
psutil>=5.9.0
Expand All @@ -10,12 +10,10 @@ scipy>=1.9.3
tqdm>=4.64.1
opencv-python>=4.5.5.64
fast-histogram>=0.11
Pillow>=10.0.1
numpy<=1.26.4

# base
onnx==1.14.1
onnxoptimizer==0.3.8
onnxruntime==1.16.0
torch>=1.13.1,<=2.1.0
tensorflow==2.14.0
# tensorflow>=2.12.0rc0,<=2.14.0
19 changes: 19 additions & 0 deletions rknn-toolkit2/packages/requirements_cp312-2.2.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# if install failed, please change the pip source to 'https://pypi.tuna.tsinghua.edu.cn/simple/'

# base deps
protobuf>=4.21.0,<=4.25.4

# utils
psutil>=5.9.0
ruamel.yaml>=0.17.21
scipy>=1.9.3
tqdm>=4.64.1
opencv-python>=4.5.5.64
fast-histogram>=0.11
numpy<=1.26.4

# base
onnx==1.16.1
onnxruntime==1.17.0
torch>=1.13.1,<=2.2.0
# tensorflow<=2.16.0rc0
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# if install failed, please change the pip source to 'https://pypi.tuna.tsinghua.edu.cn/simple/'

# base deps
protobuf==3.12.2
protobuf>=3.12.2,<=3.19.6

# utils
psutil>=5.9.0
Expand All @@ -14,7 +14,6 @@ numpy<=1.26.4

# base
onnx==1.10.0
onnxoptimizer==0.2.7
onnxruntime==1.10.0
torch>=1.10.1,<=2.1.0
tensorflow==2.6.2
# tensorflow>=1.12.0,<=2.6.2
Loading

0 comments on commit 7efa763

Please sign in to comment.