親愛的同學們,
感謝各位對於這門課的興趣,2022年二月春季班我們將第一次開設這門以人工智慧運算晶片系統軟題為主題的入門課程,為了協助各位更了解這門課程是不是適合你,這封信會針對我們開課的目的、課程設計的方式、課程的要求與我們想招收的學生做一些說明。由於這門課是選修課程並非必修課程,當你決定來修這門課的時候,請認真思考你修課的目的是否與我們課程設計的核心概念相符合,我們希望把所有的教學資源用於協助真正需要的同學,由於成大選課系統的諸多限制,Playlab 過去的一些課程, 常常讓選課的同學在選課上出現一些困難與問題, 所以這學期我們採用登記選課的方式, 希望能讓適合的同學選到這門課,而不是選了課之後退選或是要花費不必要的時間在選課系統上掙扎,為了避免造成一場美麗的誤會,耽誤了各位同學的青春,與錯置教學團隊一廂情願的熱忱,希望各位詳細了解這封信裡的細節,並審慎評估這門課是否適合你,整個教學團隊希望能把資源留給真正想修這門課的同學。
開課目的
這門課主要是為了提供一個機會給想精進與學習人工智慧系統軟體的同學,這門課只有一學分是因為我們每週聚會的一小時,主要是提供一個機會給大家做群體討論,課程是以交流與討論為主,所有修課的同學在修課的前兩週可以評估一下自己有興趣的主題為何,挑選一個主題之後,自行進行實作,老師在課外時間有開源軟體專案的聚會場合,如果上課時間不夠讓同學討論,歡迎大家來參加開源軟體專案進行分享與討論。這門課會適合下面的同學:
- 想學習人工智慧系統軟體實作的同學
- 想學習如何利用開源軟體做出自己專案的同學
- 有修Sprng 2022 人工智慧運算架構與系統 課程,希望能在軟體部分加強的同學
課程設計的方式
前兩週我們會針對專題的選項做一些概要性的介紹跟討論,讓同學能評估跟做選擇。我們有一個MCVP 的開源專,提供大家一個共同的工作環境。
至於我們專題(AI Software Stack Porting) 的選項說明如下:
Preface
To run an AI model on the target hardware system, there are multiple options to establish the software stacks. Depending on the performance requirement of the target system, the software stack might include a OS and a runtime library. Each option supports different AI model formats. Some options compile and embed the AI models into an executable binary.
Goal
The goals of the software stacks include:
- Running inferences of pre-trained neural network models in a list of supported format
- Integrating with the MCVP for AI accelerator modeling
- Enabling software/toolchain development and research
Requirements
- All the software stacks need to have source code
- The toolchains are better to have source code
Software Stack Options for Low-End Embedded System
Benchmarks
- TinyML
- MNIST
Baremetal
- TensorFlow Lite for Microcontrollers : TensorFlow Lite for Microcontrollers 是以 C++ 11 寫成,必須使用 32 位元平台。此外,TensorFlow Lite for Microcontrollers 已在 ARM Cortex-M Series 架構的多個處理器上經過廣泛測試,並已移植到 ESP32 等其他架構。TensorFlow Lite for Microcontrollers 架構是以 Arduino 程式庫的形式提供,也可以為開發環境 (例如 Mbed) 建立專案。TensorFlow Lite for Microcontrollers 為開放原始碼,可以加入至任何 C++ 11 專案。
- TensorFlow Lite for Microcontrollers currently supports a limited subset of TensorFlow operations, which impacts the model architectures that it is possible to run. We are working on expanding operation support, both in terms of reference implementations and optimizations for specific architectures.The supported operations can be seen in the file all_ops_resolver.cc
- Using Arm development solutions to bring On-Device Machine Learning inference to embedded world
CMSIS + freeRTOS
- CMSIS- ARM Cortex™ 微控制器軟件接口標準(CMSIS:Cortex Microcontroller Software Interface Standard) 是 Cortex-M 處理器系列的與供應商無關的硬件抽象層(英文原文為:a vendor-independent hardware abstraction layer for the Cortex-M processor series and defines generic tool interfaces–來自ARM官方定義)。 使用CMSIS,可以為處理器和外設實現一致且簡單的軟件接口,從而簡化軟件的重用、縮短微控制器新開發人員的學習過程,並縮短新設備的上市時間。軟件的創建被嵌入式行業公認為主要成本系數。通過在所有Cortex-M 芯片供應商產品中標準化軟件接口,這一成本會明顯降低,尤其是在創建新項目或將現有軟件遷移到新設備時。最新版本的CMSIS為5.5.1。
- Arm Common Microcontroller Software Interface Standard (CMSIS)文件說明
- CMSIS Version 5 GitHub Source
- Arm Developer — Converting a Neural Network for Arm Cortex-M with CMSIS-NN
- Deploying a Caffe Model on OpenMV using CMSIS-NN
- Video — Image recognition on Arm Cortex-M with CMSIS-NN in 5 steps
- CMSIS-NN: Efficient Neural Network kernels for Arm Cortex-M CPUs
MicroTVM on baremetal
Software Stack Options for High-End Embedded System
Benchmarks
- Tensorflow Lite Model Zoo
- Pytorch Model Zoo
- ONNX Model Zoo
Tensorflow Lite + Linux
ARM NN/Compute library + Linux
TVM + Linux
- Deploy Models and Integrate TVM — 這個選項裡還有很多子選項, 從裡面的選項中, 挑一個你有興趣的進行porting
選課的要求
這門課我們不點名,但是我們著重各種形式的課程參與,鼓勵大家提問跟參與討論,課程的評分以同學在專案進行過程的表現為主。主要的時程如下:
Week #3 之前決定專案選項
Week #4 Submit project proposal and planning
Week #10–11 Mid-term presentation
Week #17–18 Final presentation
選擇同一個主題的同學可以組隊一起工作