Luận văn an ai accelerator on a risc v system on chip

Tài liệu nghiên cứu Luận văn an ai accelerator on a risc v system on chip, tổng hợp lý thuyết và thực hành, cung cấp kiến thức chuyên sâu về .

Chuyên ngành

Computer Engineering

Người đăng

Ẩn danh

Thể loại

Capstone Project

2023

131
1
0

Phí lưu trữ

35 Point

Tóm tắt

I. Kiến trúc RISC V và Hệ thống trên Chip

RISC-V là một kiến trúc bộ xử lý mở, được thiết kế để hỗ trợ các ứng dụng đa dạng từ nhúng đến hiệu năng cao. Hệ thống trên chip (SoC) RISC-V cung cấp nền tảng linh hoạt cho việc tích hợp các thành phần tùy chỉnh như bộ tăng tốc AI. Việc xây dựng AI Accelerator trên RISC-V SoC cho phép tối ưu hóa hiệu năng xử lý các mô hình học sâu (deep learning) như CNN. Kiến trúc này kết hợp khả năng xử lý vectơ (vector processing) với các kỹ thuật lượng tử hóa dữ liệu, giảm từ 32-bit xuống 8-bit để tiết kiệm tài nguyên và tối ưu truy cập bộ nhớ.

1.1. Đặc điểm của kiến trúc RISC V

RISC-V sở hữu tập lệnh cơ bản tối thiểu nhưng khả năng mở rộng cao. Kiến trúc này cho phép tích hợp extension tùy chỉnh như vector extension để tăng cường khả năng xử lý dữ liệu song song. Điều này làm cho RISC-V trở thành lựa chọn lý tưởng cho các hệ thống AI SoC cần hiệu năng tối ưu mà không cần chi phí phát triển quá cao.

1.2. Ưu điểm của SoC trên nền tảng RISC V

Xây dựng RISC-V System-on-Chip cho phép tích hợp CPU, bộ nhớ, và các thành phần gia tốc trên một chip duy nhất. Điều này giảm độ trễ truyền thông, tiết kiệm năng lượng, và cải thiện hiệu năng tổng thể. AI Accelerator được tích hợp vào SoC có thể xử lý các tác vụ học máy nhanh chóng và hiệu quả.

II. Thiết kế và Triển khai Bộ Tăng tốc AI

AI Accelerator được thiết kế để tối ưu hóa xử lý các mô hình mạng thần kinh nhân tạo, đặc biệt là mạng thần kinh tích chập (CNN). Bộ tăng tốc này sử dụng đường ống xử lý phần cứng (hardware pipeline) và khả năng xử lý song song (parallel processing) để đạt hiệu năng cao. Kỹ thuật lượng tử hóa (quantization) từ 32-bit thành 8-bit giúp giảm đáng kể nhu cầu bộ nhớ và công suất tiêu thụ. Hệ thống được tích hợp vào CVA5-Vector-SOC thông qua các extension lệnh tùy chỉnh, tạo thành một hệ thống hoàn chỉnh cho các ứng dụng học sâu trên thiết bị nhúng.

2.1. Kỹ thuật lượng tử hóa dữ liệu

Quantization giảm độ chính xác dữ liệu từ 32-bit (float) xuống 8-bit (int8) mà không ảnh hưởng đáng kể đến độ chính xác. Phương pháp này tiết kiệm 75% bộ nhớ và giảm bandwidth truyền dữ liệu. Với AI Accelerator, lượng tử hóa cho phép xử lý nhanh hơn và tiêu thụ năng lượng ít hơn, đặc biệt phù hợp cho các ứng dụng IoT và edge computing.

2.2. Pipeline xử lý và xử lý song song

Bộ tăng tốc sử dụng hardware pipeline để xử lý nhiều phép toán đồng thời. Xử lý song song cho phép tính toán từng phần của ma trận trong một chu kỳ đồng hồ. Kết quả là CVA5-Vector-SOC đạt 97.37% độ chính xác trên dataset MNIST, vượt quá 9% so với CVA5-SOC cơ bản, trong khi giảm 8.6 lần tài nguyên2.3 lần tiêu thụ năng lượng.

III. Kết quả Kiểm thử và So sánh Hiệu năng

Hệ thống AI Accelerator on RISC-V SoC được kiểm thử với dataset MNIST để đánh giá độ chính xác và hiệu năng. Kết quả cho thấy độ chính xác đạt 97.37%, vượt vượt quá phiên bản CVA5-SOC ban đầu. Đặc biệt quan trọng, hệ thống đạt được những cải thiện này với mức tiêu thụ tài nguyên giảm 8.6 lầnnăng lượng tiêu thụ giảm 2.3 lần. Những con số này chứng minh rằng AI Accelerator không chỉ cải thiện hiệu năng mà còn tối ưu hóa hiệu suất năng lượng, làm cho nó trở thành giải pháp lý tưởng cho các ứng dụng edge computingIoT devices có ràng buộc năng lượng.

3.1. Kết quả độ chính xác trên MNIST

CVA5-Vector-SOC với AI Accelerator đạt 97.37% accuracy trên MNIST dataset, vượt quá 9% so với hệ thống gốc. Điểm số này cho thấy hiệu quả của vector extensionhardware acceleration. Việc sử dụng quantization 8-bit vẫn duy trì độ chính xác cao, chứng minh rằng AI Accelerator xử lý CNN models một cách hiệu quả.

3.2. Tối ưu hóa tài nguyên và năng lượng

AI Accelerator giảm sử dụng tài nguyên FPGA 8.6 lần so với các phương pháp truyền thống. Tiêu thụ năng lượng giảm 2.3 lần đáng kể, làm cho hệ thống phù hợp cho các embedded systemsIoT applications. Những tối ưu hóa này là kết quả của lượng tử hóa, vector processing, và hardware pipeline hiệu quả.

IV. Ứng dụng Thực tiễn và Hướng Phát triển

AI Accelerator on RISC-V SoC mở ra nhiều ứng dụng thực tiễn trong IoT devices, edge computing, và embedded systems. Hệ thống có thể được triển khai trên các FPGA boards như Zedboard để thực hiện các tác vụ nhận dạng hình ảnh, xử lý tín hiệu, và phân loại dữ liệu. Nghiên cứu này cung cấp nền tảng cho việc phát triển các accelerator AI hiệu quả hơn trên RISC-V architecture. Hướng phát triển tương lai bao gồm tối ưu hóa thêm tài nguyên, kiểm thử trên các FPGA board thực tế, so sánh với các accelerator AI khác, và mở rộng hỗ trợ các mô hình deep learning phức tạp hơn như ResNet hoặc VGG.

4.1. Ứng dụng trong IoT và Edge Computing

AI Accelerator trên RISC-V SoC cho phép triển khai machine learning models trên các edge devices với hiệu năng cao và tiêu thụ năng lượng thấp. Các IoT applications như smart sensors, video monitoring, và autonomous systems có thể tận dụng CNN acceleration để xử lý dữ liệu cục bộ mà không cần truyền lên cloud.

4.2. Hướng phát triển trong tương lai

Các nghiên cứu tiếp theo nên tập trung vào triển khai CVA5-Vector-SOC trên Zedboard FPGA, so sánh với các AI accelerator implementations khác, và kiểm thử với các IoT applications thực tế. Mở rộng hỗ trợ các mô hình deep learning phức tạp hơn và tối ưu hóa thêm memory access patterns sẽ giúp nâng cao hiệu năng hệ thống.

10/12/2025

Trích đoạn nội dung tài liệu

VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY FACULTY OF COMPUTER SCIENCE AND ENGINEERING CAPSTONE PROJECT AN AI ACCELERATOR ON A RISC-V SYSTEM-ON-CHIP MAJOR: COMPUTER ENGINEERING THESIS COMMITTEE: COMPUTER ENGINEERING 1 SUPERVISOR: Assoc. TRAN NGOC THINH REVIEWER: Assoc. PHAM QUOC CUONG STUDENT 1: NGUYEN LY DANG KHOA (1952785) STUDENT 2: LE NGUYEN TAN LOC (1952088) Ho Chi Minh City, 12/2023 1 ĐẠI HỌC QUỐC GIA TP.HCM CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM TRƯỜNG ĐẠI HỌC BÁCH KHOA Độc lập - Tự do - Hạnh phúc KHOA:KH & KT Máy tính NHIỆM VỤ LUẬN VĂN/ ĐỒ ÁN TỐT NGHIỆP BỘ MÔN:KTMT Chú ý: Sinh viên phải dán tờ này vào trang nhất của bản thuyết trình HỌ VÀ TÊN: Nguyễn Lý Đăng Khoa MSSV: 1952785 HỌ VÀ TÊN: Lê Nguyễn Tân Lộc MSSV: 1952088 NGÀNH: Kỹ thuật Máy tính LỚP: 1. Đầu đề luận văn/ đồ án tốt nghiệp: An AI accelerator in a RISC-V System-on-Chip (Xây dựng Bộ tăng tốc AI trong Hệ thống trên chip RISC-V) 2.

Nhiệm vụ (yêu cầu về nội dung và số liệu ban đầu): • Study RISC-V architecture • Study simulation software, and reconfigurable RISC-V SOCs on FPGA platforms • Survey research works, algorithms on AI, and machine learning can be ported to RISC-V system-on-chip • Implement a suitable RISC-V SOC on FPGA platforms • Implement a suitable AI accelerator on RISC-V SOC • Compare with other implementations • Test with a simple application. Ngày giao nhiệm vụ: 28/08/2023 4. Ngày hoàn thành nhiệm vụ: 01/01/2024 5. Họ tên giảng viên hướng dẫn: Phần hướng dẫn: 1) PGS.

Trần Ngọc Thịnh Nội dung và yêu cầu LVTN/ ĐATN đã được thông qua Bộ môn. CHỦ NHIỆM BỘ MÔN GIẢNG VIÊN HƯỚNG DẪN CHÍNH (Ký và ghi rõ họ tên) (Ký và ghi rõ họ tên) PGS. Trần Ngọc Thịnh PHẦN DÀNH CHO KHOA, BỘ MÔN: Người duyệt (chấm sơ bộ): Đơn vị: Ngày bảo vệ: Điểm tổng kết: Nơi lưu trữ LVTN/ĐATN: TRƯỜNG ĐẠI HỌC BÁCH KHOA CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM KHOA KH & KT MÁY TÍNH Độc lập - Tự do - Hạnh phúc ---------------------------- Ngày 02 tháng 01 năm 2024 PHIẾU ĐÁNH GIÁ LUẬN VĂN/ ĐỒ ÁN TỐT NGHIỆP (Dành cho người hướng dẫn/phản biện) 1. Họ và tên SV1: Nguyễn Lý Đăng Khoa MSSV1: 1952785 Ngành (chuyên ngành): KTMT Họ và tên SV2: Lê Nguyễn Tân Lộc MSSV1: 1952088 Ngành (chuyên ngành): KTMT 2.

Đề tài: An AI accelerator in a RISC-V System-on-Chip (Xây dựng Bộ tăng tốc AI trong Hệ thống trên chip RISC-V) 3. Họ tên người hướng dẫn: Assoc. Trần Ngọc Thịnh 4. Tổng quát về bản thuyết minh: Số trang: 132 Số chương: 7 Số bảng số liệu: 33 Số hình vẽ: 89 Số tài liệu tham khảo: 18 Phần mềm tính toán: Hiện vật (sản phẩm) 5.

Những ưu điểm chính của LV/ ĐATN:  Study and implement a suitable SOC RISC-V architecture, named CVA5-SOC  Study and implement a suitable AI accelerator that can accelerate CNN deep learning model processing based on hardware pipeline/parallel capabilities, in addition to quantizing data from 32-bit to 8-bit to save resources and optimize memory access.  Integrate AI Accelerator core into SOC CVA5 into CVA5-Vector-SOC system based on instruction extension capability of CVA5, build appropriate translation and training software for the entire system;  The system's testing with the MNIST dataset demonstrates an accuracy of up to 97.37%, surpassing the CVA5-SOC system's performance by over 9. Notably, it achieves this with an 8.6 times reduction in resource utilization and a 2.3 times decrease in energy consumption. Những thiếu sót chính của LV/ĐATN:  The system is not well optimized in terms of resource consumption.

 The system has not been implemented on the Zedboard FPGA board yet.  The system has not been compared and evaluated with other implementations.  The system has not been tested with some simple IoTs applications. Đề nghị: Được bảo vệ  Bổ sung thêm để bảo vệ  Không được bảo vệ  8.

Các câu hỏi SV phải trả lời trước Hội đồng: 9. Đánh giá chung (bằng chữ: Xuất sắc, Giỏi, Khá, TB): Fair Good (khá) Điểm : 7/10 Ký tên (ghi rõ họ tên) Trần Ngọc Thịnh TRƯỜNG ĐẠI HỌC BÁCH KHOA CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM KHOA KH & KT MÁY TÍNH Độc lập - Tự do - Hạnh phúc ---------------------------- Ngày 02 tháng 01 năm 2024 PHIẾU ĐÁNH GIÁ LUẬN VĂN/ ĐỒ ÁN TỐT NGHIỆP (Dành cho người phản biện) 2. Họ và tên SV: - Nguyễn Lý Đăng Khoa 1952785 Computer Engineering - Lê Nguyễn Tân Lộc 1952088 Computer Engineering 2. Đề tài: An AI accelerator in a RISC-V System-on-Chip (Xây dựng Bộ tăng tốc AI trong hệ thống trên chip RISC-V) 3.

Họ tên người hướng dẫn/phản biện: Phạm Quốc Cường 4. Tổng quát về bản thuyết minh: Số trang: Số chương: Số bảng số liệu Số hình vẽ: Số tài liệu tham khảo: Phần mềm tính toán: Hiện vật (sản phẩm) 5. Những ưu điểm chính của LV/ ĐATN: - The students have designed and implemented the proposed vector processing module with RTL model and sucessfully integrated it into a RISC-V processor - The system is simulated correctly and tested with a dataset 6. Những thiếu sót chính của LV/ĐATN: - The system has not yet been tested with a real FPGA board.

Hence, the soundness and correctness of the system has not been validated yet. - With simulation only, the accuracy, power consumption, etc., results cannot be used for comparing with other implementations and it makes the system less reliability. Đề nghị: Được bảo vệ x Bổ sung thêm để bảo vệ □ Không được bảo vệ □ 8. Các câu hỏi SV phải trả lời trước Hội đồng: 9.

Đánh giá chung (bằng chữ: Xuất sắc, Giỏi, Khá, TB): Điểm: 6/10 Ký tên (ghi rõ họ tên) Phạm Quốc Cường Protestation We hereby declare that except where specific reference is made to the work of others, the contents of this dissertation are original and have not been submitted in whole or in part for any other degree or qualification in any other university. This dissertation is our own work and contains nothing which is the outcome of work done in collaboration with others, except as specified in the text and Acknowledgements. Ho Chi Minh University of Technology, December 2023, Project author Nguyen Ly Dang Khoa Le Nguyen Tan Loc Computer Engineering Capstone Project (CO4347) Page 7 Acknowlegdement We would like to express our special thanks of gratitude to our teacher Assoc. Tran Ngoc Thinh who gave us the opportunity to do this wonderful project on the topic of An AI accelerator in a RISC-V System- on-Chip.

Without their help and guidance, this project would not have been possible. We would also like to thank all the teachers of Ho Chi Minh City Univer- sity of Technology and the Faculty of Computer Science and Engineering, who have taught us many valuable and important lessons, knowledge and experiences while studying at the university. Last of all, we gave our thanks to our parents, and friends who helped support us finishing this project on time Page 8 Faculty of Computer Science and Engineering Abstract With the current advancement of semiconductor technology, the need for fast prototyping to showcase proof of concept for new architectures of CPU cores has led to a wide adoption of deploying soft cores on Field- programmable gate array (FPGA) boards. Along with this, the RISC-V in- struction specification fills the need of an open-source Instruction Set Ar- chitecture (ISA) that enables independent CPU cores development, which was once under the exclusive control of major CPU instruction set own- ers such as Intel (with X86) or ARM (with ARM).

RISC-V has evolved over years from a research project at UC Berkeley in 2010 to a RISC-V Founda- tion and the RISC-V ISA has been adopted by many companies for nu- merious applications, from microcontroller and embedded systems to high-performance computing and data center processors. In the field of machine learning, RISC-V provides a vector instruction set specification, which supports element wise parallel computing, this is the key advan- tage of vector operations over the scalar operations that helps to acceler- ate the computation processes of machine learning algorithm. In this project, we implement our custom vector instructions based on the standard vector extension of RISC-V onto a RISC-V soft core namely CVA5, with the aim to accelerate matrix operations of neural network inference activities. The FPGA board in use is the Zedboard.

We approached the project by integrating our design of vector processing units into the CVA5 architecture. The reason for this approach is because of the nature of the CVA5 core, which provides interfaces for additional processing units inte- gration. With this approach, the result yields the total speedup of approx- imately 10 times faster than the scalar core while the area increases by 8 times. The power consumption increases by 1.4012 time compared with the original scalar core.

Computer Engineering Capstone Project (CO4347) Page 9 Page 10 Faculty of Computer Science and Engineering Contents 1 Project Introduction 21 1.3 Aims and Objectives .3 Project Execution Step. 25 2 Theoretical Background and CVA5 Overview 27 2.1 Deep learning Introduction .2 Convolutional Neural Network .2 Neural Network Model Quantization .1 Quantization of Neral Network Model .2 Operation for Quantization .3 RISC-V Instruction Set Architecture .1 RISC-V Instruction Set .3 The need for Vector Instruction in Accelerating AI .4 The need for RISC-V SoC on FPGA .5 Single Instruction Single Data vs Single Instruction Multiple Data .4 On choosing CVA5 core for implementation .5 CVA5 Core General Architecture .1 A Minimal RISC-V Vector Processor for Embedded Systems .2 RISC-V vector processor for acceleration of machine learning algo- rithms .2 Vector Arithmetic Unit .1 A Minimal RISC-V Vector Processor for Embedded Systems .3 Vector Register File .1 A Minimal RISC-V Vector Processor for Embedded Systems. 51 4 Vector Instructions Specification 53 4.1 Vector Control/Status Instructions. 53 Computer Engineering Capstone Project (CO4347) Page 11 4.2 Vector Arithmetic and Data transfer Instructions .3 Vector Load/Store Instruction Specification.

57 5 Vector processing unit design and integration into CVA5 59 5.1 Overall CVA5 vector supporting architecture .2 Pre-issue vector instruction processing .1 Vector Renamer Architecture .2 Vector Register File Architecture .3 Vector processing at Execution Stage .1 Vector ALU Unit .2 Vector Multiplier Unit .3 Vector Compare Unit .4 Vector Load/Store Unit .5 Vector CSRs Unit .4 Vector processing at Writeback Stage .5 Design and Integration Conclusion .1 Project Hardware Design .2 Project Software Design. 99 7 Result and Evaluation 109 7.2 Implementation of CVA5-Vector Core .3 Implementation of CVA5-SoC and CVA5-Vector-SoC .1 Implementation of CVA5-SoC .2 Implementation of CVA5-Vector-SoC .4 Implementation of CVA5-Vector-SoC on Zedboard .1 Convolution Layer Testing .2 Max Pooling Layer Testing .3 Fully-connected Layer Testing .4 Full CNN Model Testing .1 Overall work summary .2 Bottle neck and potential improvement. 130 Page 12 Faculty of Computer Science and Engineering List of Figures 1.1 Semico Research Prediction [15] .1 A CNN is composed of an input layer, an output layer, and many hidden layers in between .2 Overview of training and inference in deep learning.1 RISC-V Foundation Official Logo [11] .2 Comparison of Single Instruction Single Data (SISD) and Single Instruc- tion Multiple Data (SIMD).1 CVA5 Processor Pipeline Details and Components.1 CVA5 Pipeline Decoupling [3] .2 CVA5 simplified structural view[3] .3 CVA5 Pipeline Stages [3] .4 Store queue forwarding illustration .5 Register File block diagram .6 Renamer block diagram .1 A Minimal RISC-V Vector Processor for Embedded Systems Architecture .2 RISC-V Vector Processor for acceleration of machine learning algorithms Architecture .1 A Minimal RISC-V Vector Processor for Embedded Systems Vector ALUs Unit .1 Illustration of VLEN and SEW in use.2 Illustration of LMUL in use.1 Vector supporting CVA5 architecture .1 Vector renamer block diagram .

Nội dung được bảo vệ bản quyền — Tải xuống đầy đủ