You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In matrix multiplication tutorial, there's a modulo operation involved in offs_am and offs_bn calculation involved to account for when matrix dimensions M and N are not multiples of block size as described here.
I am unable to understand how modulo operation will help here as the offsets would point to start of the matrix for the extra program instances. For e.g with M = 7, N = 8, and block_size = 2, it would launch 16(4x4) program instances.
offs_am would then become (0,1), (2,3), (4,5), (6,0) along the m dimension. The last (6,0) would be due to modulo operation and offset would point to start of the matrix(incorrectly?). Also, the description states that in such case where block size is not multiple of M, we can pad the data with some useless values, which will not contribute to the results. However I do not see any padding later in the kernel.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In matrix multiplication tutorial, there's a modulo operation involved in offs_am and offs_bn calculation involved to account for when matrix dimensions M and N are not multiples of block size as described here.
I am unable to understand how modulo operation will help here as the offsets would point to start of the matrix for the extra program instances. For e.g with M = 7, N = 8, and block_size = 2, it would launch 16(4x4) program instances.
offs_am would then become (0,1), (2,3), (4,5), (6,0) along the m dimension. The last (6,0) would be due to modulo operation and offset would point to start of the matrix(incorrectly?). Also, the description states that in such case where block size is not multiple of M, we can pad the data with some useless values, which will not contribute to the results. However I do not see any padding later in the kernel.
Could some one help me understand this? Thanks
Beta Was this translation helpful? Give feedback.
All reactions