Skip to content

Commit

Permalink
update ascend
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzomi12 committed Jun 20, 2024
1 parent 7a3ce1f commit 9d4dab7
Show file tree
Hide file tree
Showing 54 changed files with 133 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

# 昇腾 AI 处理器

## 昇腾 AI 处理器
本节将会介绍华为昇腾 AI 处理器的架构与卷积加速原理。昇腾 AI 处理器是华为基于达芬奇架构专为人工智能领域设计的处理器,它支持云边端一体化的全栈全场景解决方案,具有高能效比和强大的3D Cube矩阵计算单元,支持多种计算模式和混合精度计算。

昇腾 AI 处理器的架构包括了AI Core、AI CPU、多层级片上缓存/缓冲区和数字视觉预处理模块DVPP,这些组件通过CHI协议的环形总线实现数据共享和一致性。此外,本节还将探讨卷积加速原理,即昇腾AI处理器如何通过软硬件优化实现高效的卷积计算加速,包括矩阵计算单元和数据缓冲区的高效组合以及灵活的数据通路设计,以满足不同深度神经网络的计算要求。

### 基本介绍
## 昇腾 AI 处理器

参考文献:《昇腾 AI 处理器架构与编程——深入理解 CANN 技术原理与应用》——梁晓峣,2019

Expand All @@ -20,12 +22,12 @@

达芬奇架构指令集采用了 CISC 指令且具有高度灵活性,可以应对日新月异、变化多端的新算法和新模型。高效的运算密集型 CISC 指令含有特殊专用指令,专门为神经网络打造,助力人工智能领域新模型的研发,同时帮助开发者更快速的实现新业务的部署,实现在线升级,促进行业发展。昇腾 AI 处理器在全业务流程加速方面,采用场景化视角,系统性设计,内置多种硬件加速器。昇腾 AI 处理器拥有丰富的 IO 接口,支持灵活可扩展和多种形态下的加速卡设计组合,很好应对云端、终端的算力和能效挑战,可以为各场景的应用强劲赋能。

### 昇腾芯片

![昇腾 AI 处理器逻辑图](images/ascendarch01.png)
## AI 处理器架构

昇腾 AI 处理器本质上是一个片上系统(System on Chip,SoC),主要可以应用在和图像、视频、语音、文字处理相关的应用场景。上图是早期昇腾其处理器的逻辑架构,其主要的架构组成部件包括特制的计算单元、大容量的存储单元和相应的控制单元。该处理器大致可以划为:芯片系统控制 CPU(Control CPU),AI 计算引擎(包括 AI Core 和 AI CPU),多层级的片上系统缓存(Cache)或缓冲区(Buffer),数字视觉预处理模块(Digital Vision Pre-Processing,DVPP)等。芯片可以采用 LPDDR4 高速主存控制器接口,价格较低。目前主流 SoC 芯片的主存一般由 DDR(Double Data Rate)或 HBM(High Bandwidth Memory)构成,用来存放大量的数据。HBM 相对于 DDR 存储带宽较高,是行业的发展方向。其它通用的外设接口模块包括 USB、磁盘、网卡、GPIO、I2C 和电源管理接口等。

![昇腾 AI 处理器逻辑图](images/ascendarch01.png)

当该处理器作为计算服务器的加速卡使用时,会通过 PCIe 总线接口和服务器其它单元实现数据互换。以上所有这些模块通过基于 CHI 协议的片上环形总线相连,实现模块间的数据连接通路并保证数据的共享和一致性。

昇腾 AI 处理器集成了多个 ARM 架构的 CPU 核心,每个核心都有独立的 L1 和 L2 缓存,所有核心共享一个片上 L3 缓存。集成的 CPU 核心按照功能可以划分为专用于控制芯片整体运行的主控 CPU 和专用于承担非矩阵类复杂计算的 AI CPU。两类任务占用的 CPU 核数可由软件根据系统实际运行情况动态分配。
Expand Down Expand Up @@ -60,4 +62,10 @@ AI Core 通过矩阵相乘完成了网络的卷积计算,之后向量执行单

同时针对深度神经网络的结构多样性,AI Core 采用了灵活的数据通路,使得数据在片上缓冲区、核外存储系统、存储转换单元以及计算单元之间可以快速流动和切换,从而满足不同结构的深度神经网络的计算要求,使得 AI Core 对各种类型的计算具有一定的通用性。

## 小结与思考
## 小结与思考

- 昇腾AI处理器的创新:华为推出的昇腾AI处理器基于达芬奇架构,专为AI领域设计,提供云边端一体化的全栈全场景解决方案,以高能效比和强大的3D Cube矩阵计算单元为特点,支持多种计算模式和混合精度计算。

- 昇腾AI处理器架构:昇腾AI处理器是一个SoC,集成了特制的计算单元、存储单元和控制单元,包括AI Core、AI CPU、多层级片上缓存/缓冲区和数字视觉预处理模块DVPP,通过CHI协议的环形总线实现模块间的数据共享和一致性。

- 卷积加速原理:昇腾AI处理器针对卷积计算进行软硬件优化,利用AI Core的矩阵计算单元和数据缓冲区,缩短数据传输路径,降低延时,并通过灵活的数据通路满足不同深度神经网络的计算要求,实现高效能的卷积计算加速。
14 changes: 12 additions & 2 deletions 02Hardware/06Domestic/08AscendCube.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<!--Copyright © 适用于[License](https://github.com/chenzomi12/AISystem)版权许可-->

# 昇腾核心
# 昇腾 AI 核心单元

本节将深入介绍昇腾 AI 处理器的核心单元——AI Core,以及其背后的达芬奇架构。昇腾 AI 处理器是华为针对人工智能领域设计的专用处理器,其核心 AI Core 采用了特定域架构(Domain Specific Architecture,DSA),专门为深度学习算法中常见的计算模式进行优化。

通过本节内容的学习,读者将能够理解昇腾 AI 处理器的达芬奇架构如何通过其独特的设计,实现对深度学习算法的高效加速,以及如何通过优化数据通路和控制流程来提升整体的计算性能。

## 达芬奇架构

Expand Down Expand Up @@ -149,4 +153,10 @@ AI Core 中的存储系统为计算单元提供源源不断的数据,高效适

在控制单元中还存在一个系统控制模块。在 AI Core 运行之前,需要外部的任务调度器来控制和初始化 AI Core 的各种配置接口,如指令信息、参数信息以及任务块信息等。这里的任务块是指 AI Core 中的最小的计算任务粒度。在配置完成后,系统控制模块会控制任务块的执行进程,同时在任务块执行完成后,系统控制模块会进行中断处理和状态申报。如果在执行过程中出现了错误,系统控制模块将会把执行的错误状态报告给任务调度器,进而反馈当前 AI Core 的状态信息给整个昇腾 AI 系统。

## 小结与思考
## 小结与思考

- 昇腾AI处理器的AI Core 利用达芬奇架构,通过其专门的矩阵、向量和标量计算单元,实现对深度学习算法中各类计算模式的高效处理。

- AI Core的存储系统 采用分布式缓冲区设计,配合存储转换单元,优化数据流传输,减少功耗,并提高计算性能。

- 控制单元 在AI Core中扮演着指挥角色,通过预取指令、多流水线并行执行和事件同步模块,确保计算任务的顺利、高效执行。
Binary file added 02Hardware/06Domestic/08AscendCube.pptx
Binary file not shown.
5 changes: 5 additions & 0 deletions 02Hardware/06Domestic/09AscendCluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--Copyright © 适用于[License](https://github.com/chenzomi12/AISystem)版权许可-->

# 昇腾 AI 算力集群

## 小结与思考
5 changes: 5 additions & 0 deletions 02Hardware/06Domestic/10AscendArch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--Copyright © 适用于[License](https://github.com/chenzomi12/AISystem)版权许可-->

# 昇腾 AI 全栈架构

## 小结与思考
8 changes: 4 additions & 4 deletions 02Hardware/06Domestic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
| 国内 AI 芯片 | 04 寒武纪 AI 芯片第一股 | [文章](./04Cambricon.md), [PPT](./04CambriconProduct.pdf), [视频](https://www.bilibili.com/video/BV1Y8411m7Cd)|
| 国内 AI 芯片 | 05 寒武纪 AI 芯片架构剖析(上)| [PPT](./05CambriconArch.pdf), [视频](https://www.bilibili.com/video/BV1op4y157Qf)|
| 国内 AI 芯片 | 06 寒武纪 AI 芯片架构剖析(下)| [PPT](./06CambriconArch.pdf), [视频](https://www.bilibili.com/video/BV1TV411j7Yx)|
| 国内 AI 芯片 | 07 昇腾 AI 处理器 | [文章](), [PPT](), [视频]() |
| 国内 AI 芯片 | 08 昇腾 AI 核心单元 | [文章](), [PPT](), [视频]() |
| 国内 AI 芯片 | 09 昇腾 AI 算力集群 | [文章](), [PPT](), [视频]() |
| 国内 AI 芯片 | 10 昇腾 AI 全栈架构 | [文章](), [PPT](), [视频]() |
| 国内 AI 芯片 | 07 昇腾 AI 处理器 | [文章](./07AscendBase.md), [PPT](), [视频]() |
| 国内 AI 芯片 | 08 昇腾 AI 核心单元 | [文章](./08AscendCube.md), [PPT](), [视频]() |
| 国内 AI 芯片 | 09 昇腾 AI 算力集群 | [文章](./09AscendCluster.md), [PPT](), [视频]() |
| 国内 AI 芯片 | 10 昇腾 AI 全栈架构 | [文章](./10AscendArch.md), [PPT](), [视频]() |

## 备注

Expand Down
Binary file modified 02Hardware/06Domestic/images/ascendarch01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02Hardware/06Domestic/images/ascendarch14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 02Hardware/06Domestic/images/ascendarch17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 02Hardware/06Domestic/images/ascendarch18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Loading

0 comments on commit 9d4dab7

Please sign in to comment.