diff --git a/docs.html b/docs.html index daae044..f9f9f7d 100644 --- a/docs.html +++ b/docs.html @@ -108,7 +108,6 @@ 添加 Pass 构建方法 动态向量表示 - 卷积优化 增加算子支持 卷积向量化 diff --git a/docs.js b/docs.js index 4c76386..c8c210d 100644 --- a/docs.js +++ b/docs.js @@ -103,14 +103,6 @@ markdownUrl: "docs/compiler/DynamicVector.md", bodyOnly: true }, - "conv-opt": { - title: "卷积优化", - titleEn: "Convolution Optimization", - desc: "卷积优化工具 conv-opt:系数广播算法与所需 Vector/affine 操作概览。", - descEn: "Convolution optimization tool conv-opt: coefficients broadcasting algorithm and required Vector/affine ops.", - markdownUrl: "docs/compiler/conv-opt.md", - bodyOnly: true - }, "adding-operators": { title: "增加算子支持", titleEn: "Adding Operators", diff --git a/docs/compiler/conv-opt-CoefficientsBroadcasting.png b/docs/compiler/conv-opt-CoefficientsBroadcasting.png deleted file mode 100644 index b748c4d..0000000 Binary files a/docs/compiler/conv-opt-CoefficientsBroadcasting.png and /dev/null differ diff --git a/docs/compiler/conv-opt.en.md b/docs/compiler/conv-opt.en.md deleted file mode 100644 index 224f0dd..0000000 --- a/docs/compiler/conv-opt.en.md +++ /dev/null @@ -1,29 +0,0 @@ -# Convolution Optimization Tool - conv - opt - -## Covolution Optimization Algorithm - -### Coefficient Broadcasting Algorithm - -Coefficients broadcasting (CB) algorithm is a high-performance implementation of 2D convolution. -The algorithm has been implemented with the intrinsic programming model and evaluated on Intel’s advanced vector extensions. [[Ref]](https://ieeexplore.ieee.org/abstract/document/8324097) -However, the intrinsic programming model is specific to ISA extensions, -which means other targets cannot reuse the vectorization. -Thus, we explored implementing the CB algorithm using MLIR. -In this case, we can take advantage of the reusable and extensible features of MLIR and LLVM IR. - -Let’s first introduce the MLIR dialects and operations that are needed by the algorithm. - -- `affine.for`: executes loop body for specific times iterating from a lower bound to an upper bound by a stride. -- `affine.vector_load`:returns a vector from a specific slice of buffer (MLIR MemRef). -- `affine.vector_store`: writes a vector into a specific slice of buffer (MLIR MemRef). -- `vector.broadcast`: broadcasts a scalar or vector value to an n-D result vector. -- `vector.fma`: performs fused multiply-add (FMA) on the vector type. - -![Graph of the Coefficients Broadcasting Algorithm](/docs/compiler/conv-opt-CoefficientsBroadcasting.png) - -The figure shows the steps of the algorithm: -- Iterate over each kernel element and broadcast it to vector1. -- Load a slice of the input into the vector2 with the iteration index. -- Load a slice of the output into the vector3 with the outermost loop iteration index. -- Multiply and accumulate the vector1, vector2, and vector3. -- Store the result vector into the output buffer with the outermost loop iteration index. diff --git a/docs/compiler/conv-opt.md b/docs/compiler/conv-opt.md deleted file mode 100644 index 34639b6..0000000 --- a/docs/compiler/conv-opt.md +++ /dev/null @@ -1,29 +0,0 @@ -# 卷积优化工具 conv-opt - -## 卷积优化算法 - -### 系数广播(Coefficient Broadcasting)算法 - -系数广播(Coefficients Broadcasting, CB)算法是一种高性能的二维卷积实现方式。 -该算法最初基于 intrinsic 编程模型实现,并在 Intel 的高级向量扩展上进行了性能评估。[[参考]](https://ieeexplore.ieee.org/abstract/document/8324097) -然而,intrinsic 编程模型强烈依赖具体 ISA 扩展,这意味着其他目标架构难以复用同样的向量化实现。 - -因此,我们尝试基于 MLIR 实现 CB 算法, -从而充分利用 MLIR 与 LLVM IR 在可复用性与可扩展性方面的优势。 - -在介绍算法细节之前,先简要列出算法所依赖的一些 MLIR 方言与算子: - -- `affine.for`:带上下界与步长的循环结构,用于执行多重循环。 -- `affine.vector_load`:从缓冲区(MLIR `memref`)的指定切片中读取一个向量。 -- `affine.vector_store`:将一个向量写入缓冲区的指定切片。 -- `vector.broadcast`:将标量或向量广播为 n 维结果向量。 -- `vector.fma`:在向量类型上执行融合乘加(FMA)运算。 - -![Graph of the Coefficients Broadcasting Algorithm](/docs/compiler/conv-opt-CoefficientsBroadcasting.png) - -上图展示了系数广播算法的大致执行流程: -- 遍历卷积核中的每个元素,并将其广播到向量 `vector1`; -- 按当前迭代索引,从输入特征图中加载一段切片到 `vector2`; -- 按最外层循环索引,从输出特征图中加载一段切片到 `vector3`; -- 对 `vector1`、`vector2` 和 `vector3` 进行乘加累积; -- 将结果向量写回到输出缓冲区对应的位置。 diff --git a/i18n.js b/i18n.js index a8db1fd..8e65fb9 100644 --- a/i18n.js +++ b/i18n.js @@ -40,7 +40,6 @@ "doc.addPass": "添加 Pass", "doc.buildMethods": "构建方法", "doc.dynamicVector": "动态向量表示", - "doc.convOpt": "卷积优化", "doc.convolutionVectorization": "卷积向量化", "doc.addingOperators": "增加算子支持", "doc.operatorLang": "RuyiAI 算子编程语言", @@ -96,7 +95,6 @@ "doc.addPass": "Add Pass", "doc.buildMethods": "Build Methods", "doc.dynamicVector": "Dynamic Vector Representation", - "doc.convOpt": "Convolution Optimization", "doc.convolutionVectorization": "Convolution Vectorization", "doc.addingOperators": "Adding Operators", "doc.operatorLang": "RuyiAI Operator Language",