Rockchip RKNPU User Guide RKNN SDK V1.6.0 技術文檔速讀

完整版的RKNN SDK用戶手冊

RKNN SDK用戶手冊的基本資料

文檔發佈文件名:Rockchip RKNPU User Guide RKNN SDK V1.6.0 (中文和英文版)

發佈日期:2023年11月28日

發佈連接:rknn-toolkit2/doc at master · airockchip/rknn-toolkit2 (github.com)

RKNN SDK用戶手冊摘要:

這份名為“Rockchip RKNPU User Guide RKNN SDK V1.6.0”的中英文技術文檔主要介紹了Rockchip的神經處理單元(NPU)的RKNN SDK的使用和特性。內容包括RKNN的概述、開發環境設置、基本指南、模型部署實例、進階指令、量化、準確度和性能優化、記憶體使用優化以及常見問題的解決方法。這份指南為使用Rockchip NPU的開發者提供了全面的指導和故障排除提示。

RKNN SDK用戶手冊的11個主要要點

這些文檔包含以下11個主要要點:

  1. RKNN介紹:軟件棧概覽、工具特性、運行特性、開發過程、支持的硬件平台及術語。
  2. 開發環境設置:使用Docker或Pip安裝RKNN-Toolkit2,設置NPU設備環境,運行示例。
  3. RKNN基礎指導:模型轉換、評估、板上C和Python推理及矩陣乘法API。
  4. 實例:MobileNet和YOLOv5等模型的部署示例。
  5. 進階RKNN指導:數據格式、零拷貝接口、NPU多核配置、動態形狀、自定義運算符、多批次指令、NPU SRAM、模型剪枝、加密及可緩存內存一致性。
  6. 量化:解釋、配置、混合量化及量化感知訓練(QAT)。
  7. 精度疑難解答:模擬器及運行時精度疑難解答。
  8. 性能優化:模型性能優化分析、性能分析、定量加速、圖優化及運算符級優化。
  9. 內存使用優化:內存組成分析、使用外部分配內存、內部記憶體重用、多線程重用RKNN上下文及多分辨率模型共享同一權重。
  10. 疑難解答:與NPU SDK環境、RKNN-Toolkit2安裝、模型轉換、深度學習框架、模型量化、推理及模型評估相關的常見問題。
  11. 參考文獻:額外的資源和參考文獻。

這些指南為使用Rockchip的NPU的開發者提供了全面的指導和疑難解答提示。

The documents “Rockchip RKNPU User Guide RKNN SDK V1.6.0” in both Chinese and English detail the use and features of the RKNN SDK for Rockchip’s Neural Processing Unit (NPU). They cover:

  1. Introduction to RKNN: Overview of the RKNN software stack, toolkit features, runtime features, development process, supported hardware platforms, and glossary.
  2. Development Environment Setup: Instructions for installing RKNN-Toolkit2 using Docker or Pip, setting up the NPU device environment, and running demos.
  3. RKNN Basic Instruction Guide: Model conversion, assessment, C and Python inferencing on board, and matrix multiplication API.
  4. Examples: Deployment examples for models like MobileNet and YOLOv5.
  5. Advanced RKNN Instructions: Data formats, runtime zero-copy interface, NPU multi-core configuration, dynamic shape, custom operators, multi-batch instruction, NPU SRAM, model pruning, encryption, and cacheable memory consistency.
  6. Quantization: Explanation, configuration, hybrid quantization, and Quantization-Aware Training (QAT).
  7. Accuracy Troubleshooting: Simulator and runtime accuracy troubleshooting.
  8. Performance Optimization: Model performance optimization analysis, performance analysis, quantitative acceleration, graph optimization, and operator level optimization.
  9. Memory Usage Optimization: Memory composition and analysis, using externally allocated memory, internal memory reuse, multi-threaded reuse of RKNN context, and multiple resolution models sharing the same weights.
  10. Troubleshooting: Common issues related to the NPU SDK environment, RKNN-Toolkit2 installation, model conversion, deep-learning frameworks, model quantification, inference, and model evaluation.
  11. References: Additional resources and references.

This guide is intended for developers working with Rockchip’s NPU and provides comprehensive instructions and troubleshooting tips for using the RKNN SDK.

RKNN SDK快速上手指南

RKNN SDK快速上手指南基本資料

文檔發佈文件名:Rockchip_RKNPU_Quick_Start_RKNN_SDK_V1.6.0 (中文和英文版)

發佈日期:2023年11月28日

發佈連接:rknn-toolkit2/doc at master · airockchip/rknn-toolkit2 (github.com)

RKNN SDK快速上手指南的摘要

此文档面向零基础用户详细介绍如何快速在计算机上使用 RKNN-Toolkit2 完成模型转换,
并通过 RKNPU2 部署到 Rockchip 开发板上。本文所用示例已集成到 RKNN Model Zoo 中。

這份文檔是一個全面的指南,旨在指導使用者如何使用RKNN-Toolkit2与Rockchip开发板。它详细介绍了开发环境的设置、开发板的准备、运行示例程序的步骤,以及如何在Docker环境中使用RKNN Python演示。此外,还提供了常见问题解答和参考文档,为各级别的使用者提供了实用的信息和指导。

RKNN SDK快速上手指南的7個主要要點

这份文档是关于如何使用RKNN-Toolkit2与Rockchip开发板的详细指南。主要内容包括:

  1. 介绍:解释RKNN-Toolkit2的用途和支持的Rockchip平台。
  2. 开发板准备:指导如何将开发板连接到计算机,包括硬件描述和连接工具。
  3. 开发环境设置:下载RKNN仓库、安装RKNN-Toolkit2环境、编译工具和开发板上的RKNPU2环境的步骤。
  4. 运行示例程序:指导如何运行RKNN Python和C示例程序,包括模型准备、转换和执行。
  5. 可选Docker使用:如何在Docker环境中运行RKNN Python演示。
  6. 常见问题解答:解决常见问题和故障排除。
  7. 参考文档:提供更多信息的额外资源。

这份文档全面且详细,为初学者到高级用户提供了使用RKNN-Toolkit2与Rockchip开发板的分步指导。

The document is a detailed guide on using the RKNN-Toolkit2 with Rockchip development boards. It covers:

  1. Introduction: Explains the purpose of the RKNN-Toolkit2 and the supported Rockchip platforms.
  2. Development Board Preparation: Guides on connecting the development board to a computer, including hardware descriptions and connection tools.
  3. Development Environment Setup: Steps to download RKNN repositories, install the RKNN-Toolkit2 environment, compilation tools, and the RKNPU2 environment on the development board.
  4. Running Example Programs: Instructions for running RKNN Python and C demos, including model preparation, conversion, and execution.
  5. Optional Docker Usage: How to run the RKNN Python demo in a Docker environment.
  6. FAQs: Addresses common issues and troubleshooting.
  7. Reference Documentation: Additional resources for further information.

The document is comprehensive, providing step-by-step instructions for beginners to advanced users on utilizing RKNN-Toolkit2 with Rockchip development boards.

連板推理 vs 板端推理

在 “Rockchip RKNPU User Guide RKNN SDK V1.6.0” 文檔中,”連板推理”(Inference with board-connected)和”板端推理”(On-board inference)的概念如下:

  1. 連板推理:當開發板連接到PC時,使用RKNN-Toolkit2的Python API對模型進行推理並獲取推理結果。這種方式涉及額外的數據複製和傳輸過程,因此性能不如直接在開發板上進行推理。當推理與板端連接時,模型的初始化和推理主要在開發板上完成,並且日誌信息主要在板端生成。
  2. 板端推理:使用RKNPU2的C API接口在開發板上直接獲取推理結果。這種方式比連板推理更快,因為它不涉及額外的數據複製和傳輸過程。因此,NPU的實際推理性能取決於板端推理的性能。

RKNN-Toolkit2 的用途

  1. 模型轉換:支持將PyTorch、ONNX、TensorFlow、TensorFlow Lite、Caffe、DarkNet等框架的模型轉換為適用於Rockchip芯片的RKNN格式模型。
  2. 量化功能:支持將浮點模型量化為固定點模型,並提供混合量化功能。
  3. 模型推理:將RKNN模型分發到指定的NPU設備上進行推理並獲得推理結果;或在電腦上模擬NPU運行RKNN模型並獲得推理結果。
  4. 性能和內存評估:將RKNN模型分發到指定的NPU設備上,評估模型在實際設備上運行時的性能和內存使用情況。

RKNN-Toolkit2允許用戶在電腦上轉換、推斷和評估模型,從而快速將AI模型部署到Rockchip芯片上

RKNN-Toolkit2 和 RKNN-Toolkit2-lite 有什麼差別

RKNN-Toolkit2和RKNN-Toolkit2-lite的主要區別是支援的作業系統和CPU架構。RKNN-Toolkit2適用於Linux x86_64系統和CPU架構。而對於需要在ARM Linux上使用Python接口進行推理的情況,則可以安裝RKNN-Toolkit2-lite,因為它支持在ARM Linux上使用Python進行推理​​。

簡言之,RKNN-Toolkit2-lite是針對ARM Linux環境的輕量化版本,適用於在ARM處理器上進行模型推理,而RKNN-Toolkit2則適用於標準的Linux x86_64環境。

Read and summarized by CHATGPT.

歡迎你的留言討論:

你可以一針見血

by Upsangel
Logo