mirror of
https://github.com/openmlsys/openmlsys-zh.git
synced 2026-11-29 15:35:46 +08:00
update pics in acce_programming (#165)
Co-authored-by: anyrenwei <zhangrenwei1@huawei.com>
This commit is contained in:
@@ -29,25 +29,33 @@
|
||||
|
||||
- **TVM/Ansor**
|
||||
|
||||

|
||||
TVM是陈天奇博士等人开发的开源深度学习编译框架,提供了端到端的编译优化(图优化/算子优化)能力,在工业界应用较广。在架构上,主要包括relay和tir两层。通过relay导入推理模型,进行算子融合等图层优化,通过tir生成融合算子。在算子编译方面,TVM采用了计算和调度分离的技术,为不同的算子提供了不同的模板,同时支持自定义模板,优化特定算子类型调度。为了更进一步优化算子性能,TVM支持对算子进行自动tuning,来生成较优的切分参数。此外,为了简化用户开发模板的工作,TVM在0.8版本后提供了自动调度能力Ansor,通过搜索的方式,为目标算子生成调度及切分参数。
|
||||
|
||||

|
||||
:width:`800px`
|
||||
:label:`tvm`
|
||||
|
||||
TVM是陈天奇博士等人开发的开源深度学习编译框架,提供了端到端的编译优化(图优化/算子优化)能力,在工业界应用较广。在架构上,主要包括relay和tir两层。通过relay导入推理模型,进行算子融合等图层优化,通过tir生成融合算子。在算子编译方面,TVM采用了计算和调度分离的技术,为不同的算子提供了不同的模板,同时支持自定义模板,优化特定算子类型调度。为了更进一步优化算子性能,TVM支持对算子进行自动tuning,来生成较优的切分参数。此外,为了简化用户开发模板的工作,TVM在0.8版本后提供了自动调度能力Ansor,通过搜索的方式,为目标算子生成调度及切分参数。
|
||||
|
||||
|
||||
- **MLIR**
|
||||
前面的章节介绍过,Google开发的MLIR并不是一个单一的算子编译器,而是一套编译器基础设施,提供了工具链的组合与复用能力。基于MLIR,DSA加速器厂商可以快速的搭建其定制化算子编译器。如Google论文 :cite:`vasilache2022composable`中所述,当前的算子编译器大多提供了一整套自顶向下的编译优化pass,包括调度优化、切分优化、窥孔优化、后端优化、指令生成等,彼此之间大多无法复用,导致新的场景中通常又得从头开发。而在MLIR中,将功能相近的IR优化pass封装为方言(Dialect),并且提供了多个代码生成相关的基础方言,如vector、memref、tensor、scf、affine、linalg等。硬件厂商可以基于这些Dialect,快速构建一整套lower优化及codegen流程。如下图所示,利用scf、affine、linalg等方言,对结构化的计算IR完成循环并行优化、切分、向量化等,最后基于LLVM完成指令映射。
|
||||
|
||||
前面的章节介绍过,Google开发的MLIR并不是一个单一的算子编译器,而是一套编译器基础设施,提供了工具链的组合与复用能力。基于MLIR,DSA加速器厂商可以快速的搭建其定制化算子编译器。如Google论文 :cite:`vasilache2022composable`中所述,当前的算子编译器大多提供了一整套自顶向下的编译优化pass,包括调度优化、切分优化、窥孔优化、后端优化、指令生成等,彼此之间大多无法复用,导致新的场景中通常又得从头开发。而在MLIR中,将功能相近的IR优化pass封装为方言(Dialect),并且提供了多个代码生成相关的基础方言,如vector、memref、tensor、scf、affine、linalg等。硬件厂商可以基于这些Dialect,快速构建一整套lower优化及codegen流程。如 :numref:`MLIR_Lowing`所示,利用scf、affine、linalg等方言,对结构化的计算IR完成循环并行优化、切分、向量化等,最后基于LLVM完成指令映射。
|
||||
|
||||

|
||||
:width:`800px`
|
||||
:label:`MLIR_Lowing`
|
||||
|
||||
|
||||
|
||||
- **华为TBE/AKG**
|
||||
|
||||
TBE(Tensor Boost Engine)是华为的Ascend芯片及其CANN软件栈基于TVM 开发的一套算子编译优化工具,用于对Ascend芯片进行调度优化、指令映射、及后端pass优化等。不仅提供了一个优化过的神经网络标准算子库,同时还提供了算子开发能力及融合能力。通过TBE提供的API和自定义算子编程开发界面可以完成相应神经网络算子的开发,帮助用户较容易的去使能硬件加速器上的AI_CORE 相关指令,以实现高性能的神经网络计算。为了简化算子开发流程,TBE还实现了一个Auto Schedule工具,开放了自定义算子编程DSL,用于自动完成复杂算子的调度生成。此外,TBE还实现了端到端的动态shape算子编译能力。
|
||||
|
||||

|
||||

|
||||
:width:`800px`
|
||||
:label:`tbe`
|
||||
|
||||
AKG则是MindSpore社区的开源算子编译工具。与上述介绍的算子编译器不同,AKG基于Polyhedral多面体编译技术 :cite:`bastoul2004code`,支持在CPU/GPU/Ascend多硬件上自动生成满足并行性与数据局部性的调度。Polyhedral编译技术的核心思想是将程序中循环的迭代空间映射为高维空间多面体,通过分析语句读写依赖关系,将循环调度优化问题转换为整数规划求解问题。
|
||||
AKG的编译流程如下图所示,主要包含程序规范化、自动调度优化、指令生成、后端优化几个模块。AKG同样基于TVM实现,支持TVM compute/Hybrid DSL编写的算子表示,以及MindSpore图算融合模块优化后的融合子图。通过IR规范化,将DSL/子图IR转换为polyhedral编译的调度树。在polyhedral模块中,利用其提供的调度算法,实现循环的自动融合、自动重排等变换,为融合算子自动生成满足并行性、数据局部性的初始调度。为了能够快速适配不同的硬件后端,我们在poly模块内将优化pass识别为硬件无关的通用优化与硬件相关的特定优化,编译时按照硬件特征拼接组合,实现异构硬件后端的快速适配。
|
||||
AKG的编译流程如 :numref:`akg`所示,主要包含程序规范化、自动调度优化、指令生成、后端优化几个模块。AKG同样基于TVM实现,支持TVM compute/Hybrid DSL编写的算子表示,以及MindSpore图算融合模块优化后的融合子图。通过IR规范化,将DSL/子图IR转换为polyhedral编译的调度树。在polyhedral模块中,利用其提供的调度算法,实现循环的自动融合、自动重排等变换,为融合算子自动生成满足并行性、数据局部性的初始调度。为了能够快速适配不同的硬件后端,我们在poly模块内将优化pass识别为硬件无关的通用优化与硬件相关的特定优化,编译时按照硬件特征拼接组合,实现异构硬件后端的快速适配。
|
||||
|
||||

|
||||
:width:`800px`
|
||||
@@ -67,6 +75,7 @@
|
||||
#### 编程接口使能加速器
|
||||
|
||||
- **算子库层级**
|
||||
|
||||
在上述不同层级的编程方式中,直接调用算子加速库使能加速器无疑是最快捷高效的方式。NVIDIA提供了cuBLAS/cuDNN两类算子计算库,cuBLAS提供了使能Tensor Core单元的接口,用以加速矩阵乘法(GEMM)运算,cuDNN提供了对应接口加速卷积(CONV)运算等。
|
||||
以 :numref:`accelerator-programable-title`小节的GEMM运算为例,与常规CUDA调用cuBLAS算子库相似,通过cuBLAS加速库使能Tensor Core步骤包括:
|
||||
1. 创建cuBLAS对象句柄且设置对应数学计算模式
|
||||
@@ -112,6 +121,7 @@ cudaDestroy(handle);
|
||||
该方式由于能够隐藏体系结构细节,易用性较好,且一般官方提供的算子库吞吐量较高。但与此同时,这种算子颗粒度的库也存在一些问题,如不足以应对复杂多变的网络模型导致的算子长尾问题(虽然常规形式算子占据绝大多数样本,但仍有源源不断的新增算子,因其出现机会较少,算子库未对其进行有效优化。),以及错失了较多神经网络框架优化(如算子融合)的机会。
|
||||
|
||||
- **编程原语层级**
|
||||
|
||||
第二种加速器编程方式为编程原语使能加速器,如通过在Device端调用CUDA WMMA (Warp Matrix Multiply Accumulate) API接口。以线程束(即Warp,是调度的基本单位)为操纵对象,使能多个Tensor Core单元。该方式在CUDA 9.0中被公开,程序员可通过添加API头文件的引用和命名空间定义来使用上述API接口。基于软硬件协同设计的基本思想,该层级编程API的设计多与架构绑定,如WMMA操纵的总是$16\times16$大小的矩阵块,并且操作一次跨两个TensorCore进行处理,本质是与TensorCore如何集成进SM中强相关的。针对Float16输入数据类型,NVIDIA官方提供了三种不同矩阵规模的WMMA乘累加计算接口,分别为$16\times16\times16$,$32\times8\times16$,$8\times32\times16$。
|
||||
该API接口操纵的基本单位为Fragment,是一种指明了矩阵含义(乘法器/累加器)、矩阵形状($WMMA\_M, WMMA\_N, WMMA\_K$)、数据类型(Half/ Float)、排布方式($row\_major/ col\_major$)等信息的模板类型,包括如下:
|
||||
|
||||
|
||||
317
img/ch06/MLIR-Lowing.svg
Executable file
317
img/ch06/MLIR-Lowing.svg
Executable file
@@ -0,0 +1,317 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
version="1.1"
|
||||
id="svg9"
|
||||
xml:space="preserve"
|
||||
width="1076.6566"
|
||||
height="282.29837"
|
||||
viewBox="0 0 1076.6566 282.29837"
|
||||
sodipodi:docname="MLIR-Lowing.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs13"><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath25"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path23" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath41"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path39" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath61"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path59" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath79"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path77" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath99"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path97" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath189"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path187" /></clipPath></defs><sodipodi:namedview
|
||||
id="namedview11"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="0.821875"
|
||||
inkscape:cx="588.89734"
|
||||
inkscape:cy="153.91635"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1001"
|
||||
inkscape:window-x="-9"
|
||||
inkscape:window-y="-9"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g15" /><g
|
||||
id="g15"
|
||||
inkscape:groupmode="layer"
|
||||
inkscape:label="MLSYS图书配图"
|
||||
transform="matrix(1.3333333,0,0,-1.3333333,-51.363199,514.55999)"><g
|
||||
id="g19"><g
|
||||
id="g21"
|
||||
clip-path="url(#clipPath25)"><g
|
||||
id="g27"
|
||||
transform="translate(98.64,378.7198)"><path
|
||||
d="m 0,0 c 0,3.711 3.009,6.72 6.72,6.72 h 87 c 3.711,0 6.72,-3.009 6.72,-6.72 v -26.88 c 0,-3.711 -3.009,-6.72 -6.72,-6.72 h -87 C 3.009,-33.6 0,-30.591 0,-26.88 Z"
|
||||
style="fill:#b4c7e7;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path29" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,110.6881,360.6019)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.04px;font-family:Calibri;-inkscape-font-specification:Calibri-Bold;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text33"><tspan
|
||||
x="0 6.600204 11.51982 16.560181 24.12072 30.000671 34.920288 42.480827 47.400444 54.480816 61.920612 64.686493 68.405685"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan31">Structured IR</tspan></text><g
|
||||
id="g35"><g
|
||||
id="g37"
|
||||
clip-path="url(#clipPath41)"><g
|
||||
id="g43"
|
||||
transform="translate(347.64,378.7199)"><path
|
||||
d="M 0,0 C 0,3.711 3.009,6.72 6.72,6.72 H 119.4 c 3.711,0 6.72,-3.009 6.72,-6.72 v -26.88 c 0,-3.711 -3.009,-6.72 -6.72,-6.72 H 6.72 C 3.009,-33.6 0,-30.591 0,-26.88 Z"
|
||||
style="fill:#b4c7e7;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path45" /></g><g
|
||||
id="g47"
|
||||
transform="translate(347.64,378.7199)"><path
|
||||
d="M 0,0 C 0,3.711 3.009,6.72 6.72,6.72 H 119.4 c 3.711,0 6.72,-3.009 6.72,-6.72 v -26.88 c 0,-3.711 -3.009,-6.72 -6.72,-6.72 H 6.72 C 3.009,-33.6 0,-30.591 0,-26.88 Z"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path49" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,356.8255,360.602)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.04px;font-family:Calibri;-inkscape-font-specification:Calibri-Bold;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text53"><tspan
|
||||
x="0 6.9596281 10.441548 13.923468 21.002436 28.443636 31.202496 37.8027 42.722317 47.762676 55.323215 61.203167 66.122787 73.683327 78.602943 85.683311 93.242447 96.008331 99.728928"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan51">Tiled Structured IR</tspan></text><g
|
||||
id="g55"><g
|
||||
id="g57"
|
||||
clip-path="url(#clipPath61)"><g
|
||||
id="g63"
|
||||
transform="translate(655.08,378.7199)"><path
|
||||
d="M 0,0 C 0,3.711 3.009,6.72 6.72,6.72 H 119.4 c 3.711,0 6.72,-3.009 6.72,-6.72 v -26.88 c 0,-3.711 -3.009,-6.72 -6.72,-6.72 H 6.72 C 3.009,-33.6 0,-30.591 0,-26.88 Z"
|
||||
style="fill:#b4c7e7;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path65" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,671.9785,368.997)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.04px;font-family:Calibri;-inkscape-font-specification:Calibri-Bold;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text71"><tspan
|
||||
x="0 6.96384 10.444356 13.923468 20.999628 28.439425 31.205303 38.764439 45.840599 51.723358 56.523636 64.082771 69.123131 72.602242 77.88269 84.842316 92.395836"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan67">Tiled Vectorized </tspan><tspan
|
||||
x="8.04492 14.645124 19.564739 24.605101 32.165642 38.045593 42.965206 50.525749 55.445366 62.525738 69.96553 72.731415 76.450607"
|
||||
y="16.80588"
|
||||
sodipodi:role="line"
|
||||
id="tspan69">Structured IR</tspan></text><g
|
||||
id="g73"><g
|
||||
id="g75"
|
||||
clip-path="url(#clipPath79)"><g
|
||||
id="g81"
|
||||
transform="translate(235.68,231.8399)"><path
|
||||
d="M 0,0 C 0,3.711 3.009,6.72 6.72,6.72 H 119.4 c 3.711,0 6.72,-3.009 6.72,-6.72 v -26.88 c 0,-3.711 -3.009,-6.72 -6.72,-6.72 H 6.72 C 3.009,-33.6 0,-30.591 0,-26.88 Z"
|
||||
style="fill:#b4c7e7;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path83" /></g><g
|
||||
id="g85"
|
||||
transform="translate(235.68,231.8399)"><path
|
||||
d="M 0,0 C 0,3.711 3.009,6.72 6.72,6.72 H 119.4 c 3.711,0 6.72,-3.009 6.72,-6.72 v -26.88 c 0,-3.711 -3.009,-6.72 -6.72,-6.72 H 6.72 C 3.009,-33.6 0,-30.591 0,-26.88 Z"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path87" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,253.3397,213.7398)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.04px;font-family:Calibri;-inkscape-font-specification:Calibri-Bold;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text91"><tspan
|
||||
x="0 5.879952 13.439088 20.999628 28.439425 34.079292 37.083851 44.04348 47.16317 54.723709 61.79987 67.682625 72.482903 80.043442 84.963058"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan89">Loops + Vectors</tspan></text><g
|
||||
id="g93"><g
|
||||
id="g95"
|
||||
clip-path="url(#clipPath99)"><g
|
||||
id="g101"
|
||||
transform="translate(545.76,231.8399)"><path
|
||||
d="M 0,0 C 0,3.711 3.009,6.72 6.72,6.72 H 119.4 c 3.711,0 6.72,-3.009 6.72,-6.72 v -26.88 c 0,-3.711 -3.009,-6.72 -6.72,-6.72 H 6.72 C 3.009,-33.6 0,-30.591 0,-26.88 Z"
|
||||
style="fill:#b4c7e7;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path103" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,556.0552,213.7398)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.04px;font-family:Calibri;-inkscape-font-specification:Calibri-Bold;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text107"><tspan
|
||||
x="0 8.8802996 16.439436 21.957155 26.876772 29.881332 39.00312 47.525398 53.408161 59.29092 66.367081 69.846191 76.922356 81.601883 88.442169 93.121704 100.68224"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan105">Host /Accelerator</tspan></text><path
|
||||
d="m 235.68,385.44 h 69.24 v -40.32 h -69.24 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path109" /><path
|
||||
d="m 235.68,385.44 h 69.24 v -40.32 h -69.24 z"
|
||||
style="fill:none;stroke:#4472c4;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path111" /><text
|
||||
transform="matrix(1,0,0,-1,259.9256,368.047)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12px;font-family:Arial;-inkscape-font-specification:Arial-BoldMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text117"><tspan
|
||||
x="0 7.0799999 10.44 13.8"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan113">Tile</tspan><tspan
|
||||
x="-3.72 3.5999999 10.92 17.639999"
|
||||
y="14.4"
|
||||
sodipodi:role="line"
|
||||
id="tspan115">Fuse</tspan></text><g
|
||||
id="g119"
|
||||
transform="translate(199.08,365.2799)"><path
|
||||
d="M 0,0 H 31.537"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path121" /></g><g
|
||||
id="g123"
|
||||
transform="translate(229.6167,362.2797)"><path
|
||||
d="M 0,0 6,3 0,6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path125" /></g><g
|
||||
id="g127"
|
||||
transform="translate(304.92,365.28)"><path
|
||||
d="M 0,0 H 37.758"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path129" /></g><g
|
||||
id="g131"
|
||||
transform="translate(341.6783,368.2802)"><path
|
||||
d="M 0,0 6,-3 0,-6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path133" /></g><path
|
||||
d="m 539.64,385.44 h 69.24 v -40.32 h -69.24 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#4472c4;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path135" /><text
|
||||
transform="matrix(1,0,0,-1,548.1714,360.847)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12px;font-family:Arial;-inkscape-font-specification:Arial-BoldMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text139"><tspan
|
||||
x="0 6.48 13.2 19.92 23.879999 31.200001 35.880001 39.240002 45.240002"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan137">vectorize</tspan></text><path
|
||||
d="m 98.64,238.56 h 69.24 V 198.24 H 98.64 Z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#4472c4;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path141" /><text
|
||||
transform="matrix(1,0,0,-1,107.5698,213.9848)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12px;font-family:Arial;-inkscape-font-specification:Arial-BoldMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text145"><tspan
|
||||
x="0 8.6400003 15.96 19.92 23.879999 30.6 35.279999 38.639999 44.639999"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan143">Bufferize</tspan></text><path
|
||||
d="m 422.04,238.56 h 69.24 v -40.32 h -69.24 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#4472c4;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path147" /><text
|
||||
transform="matrix(1,0,0,-1,438.8395,221.1848)"
|
||||
style="font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12px;font-family:Arial;-inkscape-font-specification:Arial-BoldMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text153"><tspan
|
||||
x="0 8.2799997 15 21.360001 28.68"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan149">Async</tspan><tspan
|
||||
x="-7.6799998 0.95999998 4.3200002 11.04 18.360001 25.08 29.040001 35.759998"
|
||||
y="14.4"
|
||||
sodipodi:role="line"
|
||||
id="tspan151">Dispatch</tspan></text><text
|
||||
transform="matrix(1,0,0,-1,718.4329,213.7421)"
|
||||
style="font-variant:normal;font-weight:300;font-stretch:normal;font-size:14.04px;font-family:'Footlight MT Light';-inkscape-font-specification:FootlightMTLight;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text157"><tspan
|
||||
x="0 7.320456 14.157936 17.639856 25.200396 29.040337 36.840961 43.439758 49.081032 55.681236 59.163155 68.036438 71.518356 78.2379 85.197525 91.317566 97.558342 105.35757 109.439 113.27893 120.11641"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan155">To Binary & Execution</tspan></text><g
|
||||
id="g159"
|
||||
transform="translate(473.76,365.2799)"><path
|
||||
d="M 0,0 H 60.847"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path161" /></g><g
|
||||
id="g163"
|
||||
transform="translate(533.6069,362.2797)"><path
|
||||
d="M 0,0 6,3 0,6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path165" /></g><g
|
||||
id="g167"
|
||||
transform="translate(671.88,218.3999)"><path
|
||||
d="M 0,0 H 34.33"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path169" /></g><g
|
||||
id="g171"
|
||||
transform="translate(705.21,215.3997)"><path
|
||||
d="M 0,0 6,3 0,6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path173" /></g><g
|
||||
id="g175"
|
||||
transform="translate(608.88,365.28)"><path
|
||||
d="M 0,0 H 41.268"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path177" /></g><g
|
||||
id="g179"
|
||||
transform="translate(649.148,368.2802)"><path
|
||||
d="M 0,0 6,-3 0,-6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path181" /></g><g
|
||||
id="g183"><g
|
||||
id="g185"
|
||||
clip-path="url(#clipPath189)"><g
|
||||
id="g191"
|
||||
transform="translate(781.2254,365.28)"><path
|
||||
d="m 0,0 c 30.467,0 60.934,-18.358 60.934,-36.716 0,-18.358 -200.784,-36.715 -401.568,-36.715 -200.785,0 -401.569,-18.358 -401.569,-36.716 0,-17.33 26.564,-34.659 54.615,-36.546"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path193" /></g><g
|
||||
id="g195"
|
||||
transform="translate(92.5417,215.6229)"><path
|
||||
d="M 0,0 6.098,2.795 0.203,5.997 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path197" /></g></g></g><g
|
||||
id="g199"
|
||||
transform="translate(167.88,218.4)"><path
|
||||
d="M 0,0 H 62.748"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path201" /></g><g
|
||||
id="g203"
|
||||
transform="translate(229.6284,221.4002)"><path
|
||||
d="M 0,0 6,-3 0,-6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path205" /></g><g
|
||||
id="g207"
|
||||
transform="translate(361.8,218.4)"><path
|
||||
d="M 0,0 H 55.241"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path209" /></g><g
|
||||
id="g211"
|
||||
transform="translate(416.0408,221.4002)"><path
|
||||
d="M 0,0 6,-3 0,-6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path213" /></g><g
|
||||
id="g215"
|
||||
transform="translate(491.28,218.3999)"><path
|
||||
d="M 0,0 H 49.557"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path217" /></g><g
|
||||
id="g219"
|
||||
transform="translate(539.8367,215.3997)"><path
|
||||
d="M 0,0 6,3 0,6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path221" /></g><text
|
||||
transform="matrix(1,0,0,-1,209.5216,328.1949)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.56px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text227"><tspan
|
||||
x="0 5.8819199 8.2822084 14.164128 20.046047 22.446337 28.328257 31.207968 37.687584 43.569504 49.451424 54.73037 60.612289 64.091805 66.96096 74.040382 79.320381 84.722878 92.400002 94.797119 100.67799 103.0751 108.95491 114.23491 316.19809 322.6777 328.5596 334.44153 339.72049 345.60239 349.08298 351.96268 359.04318 364.92508 370.20508 373.08481 378.96671 382.44623 385.08624 392.76654 395.16681 401.04874 403.44797 409.3299 414.60989"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan223">Linalg/Tensor/ScfDialectTensor/Vector Dialect</tspan><tspan
|
||||
x="-126.10752 -119.0281 -113.14618 -107.86617 -104.98647 -99.104546 -95.625023 -92.748482 -83.983681 -78.103874 -69.223969 -65.744446 -59.863583 -54.352322 -46.675201 -44.27808 -38.397217 -36.000095 -30.120289 -24.840288 147.00575 152.88768 158.76961 165.85008 174.6096 177.48932 185.64902 192.72951 200.40979 203.04979 210.72902 213.12932 219.01123 221.41151 227.29344 232.57344"
|
||||
y="153.86977"
|
||||
sodipodi:role="line"
|
||||
id="tspan225">Vector/MemrefDialectLLVM/GPU Dialect</tspan></text></g></svg>
|
||||
|
After Width: | Height: | Size: 19 KiB |
430
img/ch06/TBE.svg
Executable file
430
img/ch06/TBE.svg
Executable file
@@ -0,0 +1,430 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
version="1.1"
|
||||
id="svg498"
|
||||
xml:space="preserve"
|
||||
width="738.88"
|
||||
height="485.27985"
|
||||
viewBox="0 0 738.88 485.27985"
|
||||
sodipodi:docname="TBE.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs502"><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath526"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path524" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath542"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path540" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath564"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path562" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath580"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path578" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath596"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path594" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath614"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path612" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath630"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path628" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath694"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path692" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath710"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path708" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath728"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path726" /></clipPath><clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath746"><path
|
||||
d="M 0,0 H 960 V 540 H 0 Z"
|
||||
id="path744" /></clipPath></defs><sodipodi:namedview
|
||||
id="namedview500"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:zoom="0.93203125"
|
||||
inkscape:cx="9.6563286"
|
||||
inkscape:cy="261.25733"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1001"
|
||||
inkscape:window-x="-9"
|
||||
inkscape:window-y="-9"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g504" /><g
|
||||
id="g504"
|
||||
inkscape:groupmode="layer"
|
||||
inkscape:label="MLSYS图书配图"
|
||||
transform="matrix(1.3333333,0,0,-1.3333333,-279.35999,621.75985)"><path
|
||||
d="M 360.12,166.56 H 599.88 V 102.84 H 360.12 Z"
|
||||
style="fill:#f2f2f2;fill-opacity:1;fill-rule:evenodd;stroke:#7f7f7f;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:3.84, 2.88;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path508" /><text
|
||||
transform="matrix(1,0,0,-1,367.3101,153.1982)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.96px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text512"><tspan
|
||||
x="0 7.2000842 12.717924 18.235764 20.99568 23.156004 31.675789"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan510">Runtime</tspan></text><path
|
||||
d="M 360.12,312.36 H 599.88 V 184.92 H 360.12 Z"
|
||||
style="fill:#f2f2f2;fill-opacity:1;fill-rule:evenodd;stroke:#7f7f7f;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:3.84, 2.88;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path514" /><text
|
||||
transform="matrix(1,0,0,-1,367.3101,299.0229)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.96px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text518"><tspan
|
||||
x="0 7.2000842 12.717924 21.237707 26.755548 32.273388 35.034302 40.552139 43.072021 48.589859 54.1077 59.625542 61.785866 67.303703 72.821541"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan516">Compute engines</tspan></text><g
|
||||
id="g520"><g
|
||||
id="g522"
|
||||
clip-path="url(#clipPath526)"><g
|
||||
id="g528"
|
||||
transform="translate(330.24,461.5399)"><path
|
||||
d="m 0,0 c 0,2.64 2.14,4.78 4.78,4.78 h 79.96 c 2.64,0 4.78,-2.14 4.78,-4.78 v -19.12 c 0,-2.64 -2.14,-4.78 -4.78,-4.78 H 4.78 C 2.14,-23.9 0,-21.76 0,-19.12 Z"
|
||||
style="fill:#c1e4e8;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path530" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,347.2015,447.869)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Calibri;-inkscape-font-specification:Calibri;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text534"><tspan
|
||||
x="0 4.8000002 10.8 17.16 21.84 28.200001 32.400002 37.919998 40.68 47.040001"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan532">TensorFlow</tspan></text><g
|
||||
id="g536"><g
|
||||
id="g538"
|
||||
clip-path="url(#clipPath542)"><g
|
||||
id="g544"
|
||||
transform="translate(548.28,461.5399)"><path
|
||||
d="m 0,0 c 0,2.64 2.14,4.78 4.78,4.78 h 80.08 c 2.64,0 4.78,-2.14 4.78,-4.78 v -19.12 c 0,-2.64 -2.14,-4.78 -4.78,-4.78 H 4.78 C 2.14,-23.9 0,-21.76 0,-19.12 Z"
|
||||
style="fill:#c1e4e8;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path546" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,566.0157,447.869)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Calibri;-inkscape-font-specification:Calibri;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text550"><tspan
|
||||
x="0 10.32 13.08 19.440001 25.799999 31.32 37.560001 43.919998 48"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan548">MindSpore</tspan></text><path
|
||||
d="m 340.32,414.48 h 69.24 v -23.76 h -69.24 z"
|
||||
style="fill:#f2f2f2;fill-opacity:1;fill-rule:evenodd;stroke:#d0cece;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path552" /><text
|
||||
transform="matrix(1,0,0,-1,348.6939,398.7079)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.56px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text556"><tspan
|
||||
x="0 6.4796162 12.960288 15.600288 22.679712 28.561632 34.44355 40.325474 43.206242 49.088161"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan554">TF Adapter</tspan></text><g
|
||||
id="g558"><g
|
||||
id="g560"
|
||||
clip-path="url(#clipPath564)"><g
|
||||
id="g566"
|
||||
transform="translate(419.76,357.74)"><path
|
||||
d="m 0,0 c 0,2.64 2.14,4.78 4.78,4.78 h 106.6 c 2.64,0 4.78,-2.14 4.78,-4.78 v -19.12 c 0,-2.64 -2.14,-4.78 -4.78,-4.78 H 4.78 C 2.14,-23.9 0,-21.76 0,-19.12 Z"
|
||||
style="fill:#c1e4e8;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path568" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,434.6969,344.0524)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Calibri;-inkscape-font-specification:Calibri;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text572"><tspan
|
||||
x="0 7.5599999 11.52 17.280001 23.639999 30 32.52 38.400002 44.759998 50.3988 53.158798 59.518799 65.518799 69.118797 76.678802 82.5588"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan570">Graph Engine(GE)</tspan></text><g
|
||||
id="g574"><g
|
||||
id="g576"
|
||||
clip-path="url(#clipPath580)"><g
|
||||
id="g582"
|
||||
transform="translate(419.4,284.06)"><path
|
||||
d="m 0,0 c 0,2.64 2.14,4.78 4.78,4.78 h 106.48 c 2.64,0 4.78,-2.14 4.78,-4.78 v -19.12 c 0,-2.64 -2.14,-4.78 -4.78,-4.78 H 4.78 C 2.14,-23.9 0,-21.76 0,-19.12 Z"
|
||||
style="fill:#c1e4e8;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path584" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,434.2875,270.413)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Calibri;-inkscape-font-specification:Calibri;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text588"><tspan
|
||||
x="0 5.52 11.88 16.559999 19.32 25.68 32.040001 34.68 40.560001 46.9188 52.5588 55.318802 61.678799 67.678802 71.278801 76.798798 82.678802"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan586">Fusion Engine(FE)</tspan></text><g
|
||||
id="g590"><g
|
||||
id="g592"
|
||||
clip-path="url(#clipPath596)"><g
|
||||
id="g598"
|
||||
transform="translate(419.4,226.7)"><path
|
||||
d="m 0,0 c 0,2.64 2.14,4.78 4.78,4.78 h 106.48 c 2.64,0 4.78,-2.14 4.78,-4.78 v -19.12 c 0,-2.64 -2.14,-4.78 -4.78,-4.78 H 4.78 C 2.14,-23.9 0,-21.76 0,-19.12 Z"
|
||||
style="fill:#c1e4e8;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path600" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,428.0501,220.2757)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Calibri;-inkscape-font-specification:Calibri;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text606"><tspan
|
||||
x="0 4.8000002 10.8 17.16 21.84 28.200001 32.400002 35.040001 41.52 47.880001 54.2388 58.799999 62.880001 65.639999 71.519997 77.879997 83.519997 86.279999 92.639999"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan602">Tensor Boost Engine</tspan><tspan
|
||||
x="36.599998 40.200001 46.080002 52.560001 58.439999"
|
||||
y="14.4"
|
||||
sodipodi:role="line"
|
||||
id="tspan604">(TBE)</tspan></text><g
|
||||
id="g608"><g
|
||||
id="g610"
|
||||
clip-path="url(#clipPath614)"><g
|
||||
id="g616"
|
||||
transform="translate(376.56,141.0199)"><path
|
||||
d="m 0,0 c 0,2.64 2.14,4.78 4.78,4.78 h 90.16 c 2.64,0 4.78,-2.14 4.78,-4.78 v -19.12 c 0,-2.64 -2.14,-4.78 -4.78,-4.78 H 4.78 C 2.14,-23.9 0,-21.76 0,-19.12 Z"
|
||||
style="fill:#c1e4e8;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path618" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,387.9841,127.3696)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Calibri;-inkscape-font-specification:Calibri;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text622"><tspan
|
||||
x="0 7.4400001 13.44 18.84 21.6 26.639999 32.639999 35.279999 41.759998 48.118801 54.358799 58.438801 61.198799 70.798798"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan620">Device Runtime</tspan></text><g
|
||||
id="g624"><g
|
||||
id="g626"
|
||||
clip-path="url(#clipPath630)"><g
|
||||
id="g632"
|
||||
transform="translate(488.28,141.0199)"><path
|
||||
d="M 0,0 C 0,2.64 2.14,4.78 4.78,4.78 H 94.82 C 97.46,4.78 99.6,2.64 99.6,0 v -19.12 c 0,-2.64 -2.14,-4.78 -4.78,-4.78 H 4.78 C 2.14,-23.9 0,-21.76 0,-19.12 Z"
|
||||
style="fill:#c1e4e8;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path634" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,504.6834,127.3696)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;font-family:Calibri;-inkscape-font-specification:Calibri;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text638"><tspan
|
||||
x="0 7.4400001 13.8 18.360001 22.440001 25.200001 31.68 38.040001 44.279999 48.360001 51.119999 60.7188"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan636">Host Runtime</tspan></text><g
|
||||
id="g640"
|
||||
transform="translate(375.0001,437.64)"><path
|
||||
d="M 0,0 V -18.114"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path642" /></g><g
|
||||
id="g644"
|
||||
transform="translate(371.9998,420.5255)"><path
|
||||
d="M 0,0 3,-6 6,0 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path646" /></g><g
|
||||
id="g648"
|
||||
transform="translate(375,390.72)"><path
|
||||
d="m 0,0 v -14.124 h 102.84 v -9.125"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path650" /></g><g
|
||||
id="g652"
|
||||
transform="translate(474.8402,368.471)"><path
|
||||
d="M 0,0 3,-6 6,0 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path654" /></g><g
|
||||
id="g656"
|
||||
transform="translate(593.0913,437.64)"><path
|
||||
d="m 0,0 v -61.354 h -115.251 v -8.794"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path658" /></g><g
|
||||
id="g660"
|
||||
transform="translate(480.8402,368.492)"><path
|
||||
d="M 0,0 -3,-6 -6,0 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path662" /></g><g
|
||||
id="g664"
|
||||
transform="translate(477.8394,333.84)"><path
|
||||
d="m 0,0 v -10.979 h -135.72 v -188.17 h 13.001"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path666" /></g><g
|
||||
id="g668"
|
||||
transform="translate(354.1198,137.6909)"><path
|
||||
d="M 0,0 6,-2.999 0.001,-6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path670" /></g><g
|
||||
id="g672"
|
||||
transform="translate(477.8868,333.84)"><path
|
||||
d="M 0,0 -0.362,-39.971"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path674" /></g><g
|
||||
id="g676"
|
||||
transform="translate(474.5341,294.896)"><path
|
||||
d="M 0,0 2.946,-6.027 6,-0.054 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path678" /></g><g
|
||||
id="g680"
|
||||
transform="translate(477.48,260.16)"><path
|
||||
d="M 0,0 V -23.669"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path682" /></g><g
|
||||
id="g684"
|
||||
transform="translate(480.4803,237.4912)"><path
|
||||
d="M 0,0 -3,-6 -6,0 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path686" /></g><g
|
||||
id="g688"><g
|
||||
id="g690"
|
||||
clip-path="url(#clipPath694)"><g
|
||||
id="g696"
|
||||
transform="translate(210,368.64)"><path
|
||||
d="m 0,0 h 95.04 v -32.912 c -47.52,0 -47.52,-12.54 -95.04,-5.415 z"
|
||||
style="fill:#fff095;fill-opacity:1;fill-rule:evenodd;stroke:#f2f2f2;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path698" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,217.1511,348.3034)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.56px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text702"><tspan
|
||||
x="0 8.1597118 14.041632 19.923552 23.404127 29.286049 32.16576 38.04768 41.528255 44.411137 50.293056 52.693344 58.575264 64.457184 67.921921 70.319038"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan700">Operator plug-in</tspan></text><g
|
||||
id="g704"><g
|
||||
id="g706"
|
||||
clip-path="url(#clipPath710)"><g
|
||||
id="g712"
|
||||
transform="translate(657.96,368.64)"><path
|
||||
d="M 0,0 H 104.04 V -32.912 C 52.02,-32.912 52.02,-45.452 0,-38.327 Z"
|
||||
style="fill:#fff095;fill-opacity:1;fill-rule:evenodd;stroke:#f2f2f2;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path714" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,665.1224,354.6034)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.56px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text720"><tspan
|
||||
x="0 8.1597118 14.041632 19.923552 23.404127 29.286049 32.16576 38.04768 41.528255 44.411137 50.293056 53.772575 59.654495 62.535263 68.417183 71.296898 76.456512 82.338432 88.220352"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan716">Operator prototype </tspan><tspan
|
||||
x="0 2.4002881 4.79952 10.680384 14.159904 20.040768 23.520288"
|
||||
y="12.59808"
|
||||
sodipodi:role="line"
|
||||
id="tspan718">library</tspan></text><g
|
||||
id="g722"><g
|
||||
id="g724"
|
||||
clip-path="url(#clipPath728)"><g
|
||||
id="g730"
|
||||
transform="translate(659.16,295.44)"><path
|
||||
d="M 0,0 H 104.04 V -32.912 C 52.02,-32.912 52.02,-45.452 0,-38.327 Z"
|
||||
style="fill:#fff095;fill-opacity:1;fill-rule:evenodd;stroke:#f2f2f2;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path732" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,666.3699,281.3838)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.56px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text738"><tspan
|
||||
x="0 8.1597118 14.041632 19.923552 23.404127 29.286049 32.16576 38.04768 41.528255 44.411137 46.810368 52.692287 55.691326 61.57325"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan734">Operator info </tspan><tspan
|
||||
x="0 2.4002881 4.79952 10.680384 14.159904 20.040768 23.520288"
|
||||
y="12.59808"
|
||||
sodipodi:role="line"
|
||||
id="tspan736">library</tspan></text><g
|
||||
id="g740"><g
|
||||
id="g742"
|
||||
clip-path="url(#clipPath746)"><g
|
||||
id="g748"
|
||||
transform="translate(657.96,237.72)"><path
|
||||
d="M 0,0 H 104.04 V -33.008 C 52.02,-33.008 52.02,-45.585 0,-38.439 Z"
|
||||
style="fill:#fff095;fill-opacity:1;fill-rule:evenodd;stroke:#f2f2f2;stroke-width:0.96;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path750" /></g></g></g><text
|
||||
transform="matrix(1,0,0,-1,665.1224,223.6266)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.56px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#1d1d1a;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text756"><tspan
|
||||
x="0 8.1597118 14.041632 19.923552 23.404127 29.286049 32.16576 38.04768 41.528255"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan752">Operator </tspan><tspan
|
||||
x="0 2.4002881 11.280192 17.162111 19.561344 25.443264 34.324223 40.206142 46.088062 48.967777 54.849697 57.729408 60.129696 66.01162"
|
||||
y="12.59808"
|
||||
sodipodi:role="line"
|
||||
id="tspan754">implementation</tspan></text><g
|
||||
id="g758"
|
||||
transform="translate(305.04,348.12)"><path
|
||||
d="M 0,0 H 109.757"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path760" /></g><g
|
||||
id="g762"
|
||||
transform="translate(413.7967,351.1202)"><path
|
||||
d="M 0,0 6,-3 0,-6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path764" /></g><g
|
||||
id="g766"
|
||||
transform="translate(535.92,348.12)"><path
|
||||
d="M 0,0 H 117.06"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path768" /></g><g
|
||||
id="g770"
|
||||
transform="translate(651.9805,351.1202)"><path
|
||||
d="M 0,0 6,-3 0,-6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path772" /></g><g
|
||||
id="g774"
|
||||
transform="translate(535.44,274.4805)"><path
|
||||
d="M 0,0 118.182,71.063"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path776" /></g><g
|
||||
id="g778"
|
||||
transform="translate(654.3115,342.4569)"><path
|
||||
d="M 0,0 3.596,5.663 -3.092,5.142 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path780" /></g><g
|
||||
id="g782"
|
||||
transform="translate(535.44,274.5002)"><path
|
||||
d="M 0,0 118.715,0.403"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path784" /></g><g
|
||||
id="g786"
|
||||
transform="translate(653.1652,271.8994)"><path
|
||||
d="M 0,0 5.99,3.021 -0.021,6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path788" /></g><g
|
||||
id="g790"
|
||||
transform="translate(535.44,217.2)"><path
|
||||
d="M 0,0 H 117.467"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:8;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path792" /></g><g
|
||||
id="g794"
|
||||
transform="translate(651.9075,220.2002)"><path
|
||||
d="M 0,0 6,-3 0,-6 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
id="path796" /></g><text
|
||||
transform="matrix(1,0,0,-1,589.6619,351.8455)"
|
||||
style="font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.56px;font-family:Arial;-inkscape-font-specification:ArialMT;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="text808"><tspan
|
||||
x="0 5.8819199 11.76384 17.64576"
|
||||
y="0"
|
||||
sodipodi:role="line"
|
||||
id="tspan798">Load</tspan><tspan
|
||||
x="-15.30144 -9.4195204 -3.5376 2.3443201"
|
||||
y="67.626244"
|
||||
sodipodi:role="line"
|
||||
id="tspan800">Load</tspan><tspan
|
||||
x="-13.64352 -6.564096 -0.68323201 1.713888 4.1110082"
|
||||
y="149.87808"
|
||||
sodipodi:role="line"
|
||||
id="tspan802">Build</tspan><tspan
|
||||
x="-268.38239 -262.50049 -256.61856 -250.73663 -244.85472 -241.97185 -236.08992 -233.69069 -227.80876 -221.92685 -218.46529 -216.06499 -210.18307 -207.42374 -204.42365 -198.54173 -195.06116"
|
||||
y="-0.021120001"
|
||||
sodipodi:role="line"
|
||||
id="tspan804">Load plug-in for </tspan><tspan
|
||||
x="-268.38239 -262.50049 -256.61856 -250.73663 -247.25606 -241.37415 -238.49443 -232.61252 -229.13194 -226.24905 -217.36916 -211.48723 -205.60532 -199.72339 -197.3231 -191.44118"
|
||||
y="12.57696"
|
||||
sodipodi:role="line"
|
||||
id="tspan806">operator mapping</tspan></text></g></svg>
|
||||
|
After Width: | Height: | Size: 24 KiB |
461
img/ch06/TVM.svg
461
img/ch06/TVM.svg
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 506 KiB After Width: | Height: | Size: 22 KiB |
BIN
img/ch06/tbe.png
BIN
img/ch06/tbe.png
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Reference in New Issue
Block a user