happyme531
commited on
Commit
•
e2fa3aa
1
Parent(s):
c0ea013
Update README.md
Browse files
README.md
CHANGED
@@ -13,8 +13,8 @@ tags:
|
|
13 |
|
14 |
ONNX/RKNN2部署Florence-2视觉多模态大模型!
|
15 |
|
16 |
-
- 推理速度(RKNN2):RK3588推理一张
|
17 |
-
- 内存占用(RKNN2):约
|
18 |
|
19 |
## 使用方法
|
20 |
|
@@ -54,9 +54,9 @@ python convert.py all
|
|
54 |
注意: RKNN模型不支持运行时任意长度的输入, 所以需要提前确定好输入的shape. 之后可以修改convert.py中的`vision_size`, `vision_tokens`, `prompt_tokens`来修改输入的shape.
|
55 |
|
56 |
## 存在的问题(rknn)
|
57 |
-
-
|
58 |
-
-
|
59 |
-
- vision encoder推理需要1.5秒, 占比最大, 但其中大半时间都在做Transpose,
|
60 |
- decode阶段因为kvcache的长度不断变化, 貌似无法简单的使用NPU推理. 不过用onnxruntime应该也足够了
|
61 |
|
62 |
## 参考
|
@@ -71,8 +71,8 @@ python convert.py all
|
|
71 |
|
72 |
ONNX/RKNN2 deployment for Florence-2 visual-language multimodal large model!
|
73 |
|
74 |
-
- Inference speed (RKNN2): RK3588 inference with a
|
75 |
-
- Memory usage (RKNN2): Approximately
|
76 |
|
77 |
## Usage
|
78 |
|
@@ -113,9 +113,9 @@ Note: The RKNN model does not support arbitrary input lengths at runtime, so you
|
|
113 |
|
114 |
## Existing Issues (rknn)
|
115 |
|
116 |
-
- It is known that converting the vision encoder with an input resolution >= 640x640 will result in a `Buffer overflow!` error and conversion failure. Therefore, the current input is 512x512, which will reduce inference quality.
|
117 |
-
- Inference accuracy is significantly lower compared to onnxruntime at the same resolution. The problem has been identified in the vision encoder part. If high accuracy is required, this part can be replaced with onnxruntime.
|
118 |
-
- Vision encoder inference takes 1.5 seconds, accounting for the largest proportion, but most of this time is spent on Transpose op, which may be further optimized.
|
119 |
- The decode phase seems unable to simply use NPU inference because the length of kvcache keeps changing. However, using onnxruntime should be sufficient.
|
120 |
|
121 |
## References
|
|
|
13 |
|
14 |
ONNX/RKNN2部署Florence-2视觉多模态大模型!
|
15 |
|
16 |
+
- 推理速度(RKNN2):RK3588推理一张768x768图片, 使用`<MORE_DETAILED_CAPTION>`指令, 总时间需要~4.5秒
|
17 |
+
- 内存占用(RKNN2):约2GB
|
18 |
|
19 |
## 使用方法
|
20 |
|
|
|
54 |
注意: RKNN模型不支持运行时任意长度的输入, 所以需要提前确定好输入的shape. 之后可以修改convert.py中的`vision_size`, `vision_tokens`, `prompt_tokens`来修改输入的shape.
|
55 |
|
56 |
## 存在的问题(rknn)
|
57 |
+
- ~~已知转换vision encoder时输入分辨率>=640x640时会报错`Buffer overflow!`然后转换失败, 所以目前是使用512x512的输入, 推理质量会下降~~ (已解决)
|
58 |
+
- ~~在同分辨率下推理精度相比onnxruntime有显著下降, 已确定问题出在vision encoder部分. 如果对精度要求高, 这部分可以换成onnxruntime~~ (已解决, 不过现在貌似仍然会丢失一点精度)
|
59 |
+
- ~~vision encoder推理需要1.5秒, 占比最大, 但其中大半时间都在做Transpose, 也许还可以优化~~ (已优化)
|
60 |
- decode阶段因为kvcache的长度不断变化, 貌似无法简单的使用NPU推理. 不过用onnxruntime应该也足够了
|
61 |
|
62 |
## 参考
|
|
|
71 |
|
72 |
ONNX/RKNN2 deployment for Florence-2 visual-language multimodal large model!
|
73 |
|
74 |
+
- Inference speed (RKNN2): RK3588 inference with a 768x768 image, using the `<MORE_DETAILED_CAPTION>` instruction, takes ~4.5 seconds in total.
|
75 |
+
- Memory usage (RKNN2): Approximately 2GB
|
76 |
|
77 |
## Usage
|
78 |
|
|
|
113 |
|
114 |
## Existing Issues (rknn)
|
115 |
|
116 |
+
- ~~It is known that converting the vision encoder with an input resolution >= 640x640 will result in a `Buffer overflow!` error and conversion failure. Therefore, the current input is 512x512, which will reduce inference quality.~~ (Solved.)
|
117 |
+
- ~~Inference accuracy is significantly lower compared to onnxruntime at the same resolution. The problem has been identified in the vision encoder part. If high accuracy is required, this part can be replaced with onnxruntime.~~ (Solved, although there is still some precision loss present.)
|
118 |
+
- ~~Vision encoder inference takes 1.5 seconds, accounting for the largest proportion, but most of this time is spent on Transpose op, which may be further optimized.~~ (Solved.)
|
119 |
- The decode phase seems unable to simply use NPU inference because the length of kvcache keeps changing. However, using onnxruntime should be sufficient.
|
120 |
|
121 |
## References
|