Skip to content

Commit cb694d7

Browse files
committed
[Doc][Polish] gemm optimize by 2d thread tile, fix type : No space between Chinese and alphabet
1 parent 96b5068 commit cb694d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/11_gemm_optimize/01_tiled2d/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
在介绍二维 Thread Tile 之前,我们先来回顾一下一维 Thread Tile 的优化方法。在初级系列中,我们使用了一维线程块来优化矩阵乘法的性能,我们将矩阵乘法的计算任务分配给了一维线程块,每个线程块负责计算一个小的矩阵块。这样做的好处是可以充分利用共享内存,减少全局内存的访问次数,从而提高矩阵乘法的性能。
88

9-
还记得一维 Thread Tile中的例子吗?如果输入的 A 和 B 都是 8x8 的矩阵:
9+
还记得一维 Thread Tile 中的例子吗?如果输入的 A 和 B 都是 8x8 的矩阵:
1010

1111
1. 如果我们一次读取 1 行 A 和 1 列 B,当每一个线程只计算一个结果的时候,我们需要从 A 中读取 8 个数据,从 B 中读取 8 个数据,从 C 中读取 1 个数据,然后写一次 C。这样的话,每个线程需要读取 16 个数据,写一次数据。一共需要 64 个线程,共 64x17 = 1088 次 IO。
1212
2. 如果我们一次读取 4 行 A 和 1 列 B,那么每一个线程计算 4 个结果,次数需要从 A 中读取 4x8 个数据,从 B 中读取 8 个数据,从 C 中读取 4 个数据,然后写 4 次 C。一共需要 64/4=16 个线程,共 16x48 = 768 次 IO。

0 commit comments

Comments
 (0)