简体   繁体   English

张量核的第三维(如 4x4x4)从何而来?

[英]Where does the third dimension (as in 4x4x4) of tensor cores come from?

As I understand, the Nvidia tensor cores multiplies two 4x4 matrices and adds the result to a third matrix.据我了解,Nvidia 张量核心将两个 4x4 矩阵相乘并将结果添加到第三个矩阵。 Multiplying two 4x4 matrices produces a 4x4 matrix, and adding two 4x4 matrices produces a 4x4 matrix.两个 4x4 矩阵相乘产生一个 4x4 矩阵,两个 4x4 矩阵相加产生一个 4x4 矩阵。 Still "Each Tensor Core provides a 4x4x4 matrix processing array".仍然“每个 Tensor Core 提供一个 4x4x4 矩阵处理阵列”。

There are 4x multiplication-accumulate operations that are needed for each row*col.每行*列需要 4 次乘法累加运算。 I thought maybe the last x4 comes from intermediate result before the accumulation, but I don't think it quite fits with the description on Nvidias pages.我想也许最后的 x4 来自积累之前的中间结果,但我认为它与 Nvidias 页面上的描述不太吻合。

"The FP16 multiply results in a full precision result that is accumulated in FP32 operations with the other products in a given dot product for a 4x4x4 matrix multiply, as Figure 9 shows." “FP16 乘法产生全精度结果,该结果在 FP32 运算中与给定点积中的其他乘积累积,用于 4x4x4 矩阵乘法,如图 9 所示。” https://developer.nvidia.com/blog/cuda-9-features-revealed/ https://developer.nvidia.com/blog/cuda-9-features-revealed/

4x4x4 matrix multiply? 4x4x4矩阵乘法? I thought matrices was 2dimensions by definition.我认为矩阵根据定义是二维的。

Can someone please explain where the last x4 comes from?有人可以解释一下最后一个 x4 是从哪里来的吗?

立方体本身代表了生成完整的 4x4 乘积矩阵所需的 64 个元素乘积”cvw.cac.cornell.edu/GPUarch/tensor_cores。构成最后一个 x4 的是累积之前的中间乘积。

4x4x4 is just the notation for multiplication of one 4x4 matrix with another 4x4 matrix. 4x4x4 只是一个 4x4 矩阵与另一个 4x4 矩阵相乘的符号。

If you were to multiply a 4x8 matrix with a 8x4 matrix, you would have 4x8x4.如果要将 4x8 矩阵与 8x4 矩阵相乘,则将得到 4x8x4。 So if A is NxK and B is KxM, then it can be referred to as a NxKxM matrix multiply.所以如果A是NxK,B是KxM,那么可以称为NxKxM矩阵乘法。

I just briefly looked up and found this paper, where they use this exact notation (eg in Section 4.6 on page 36): https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/153863/eth-6705-01.pdf我只是简单地查找并找到了这篇论文,他们在其中使用了这个确切的符号(例如,在第 36 页的第 4.6 节中): https ://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/153863/ eth-6705-01.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM