cutlass
cutlass copied to clipboard
[QST] What is the difference between make_shape and make_tile?
Thank you for your great work, for both cutlass and cute.
I'm following instructions to build my program. I use make_tensor to build rav as a pointer to specific register memory, and use local_tile to select a segment of its data. To make a this selection, I use make_shape function to define a space with a shape of [1, VPT], however i notice that make_tile(1, VPT) serves the same purpose. Could you explain the difference between using make_tile and make_shape here?
auto rav = cute::make_tensor(make_rmem_ptr(local_acc), make_shape(VEC_LEN, VPT), make_stride(VPT, 1));
auto ravT = cute::local_tile(rav, make_shape(1, VPT), make_coord(i, 0));
And there is another problem of shape declaration: I found i can always use constant statement like (1, VPT) to make shape declaration instead of (Int{1}, Int{VPT}), does this definition going to slow down the execution later?
@thakkarV
A tile is a tuple of layouts. If you divide with a shape, that is equivalent to dividing with a tile of trivial layouts (layouts who have the same shape, and left major compact strides). This is what make_tile()
does if the inputs to it are just integers or shapes, it promotes them to trivial layouts by mode. Therefore, In your case, make_tile()
is identical to using make shape.
As for make_shape(1, VPT)
being slower than make_shape(Int<1>{}, Int<VPT>{})
, yes, if you use dynamic integer types there, it can lead to inefficient code generation than using integral constants.
@ZhangZhiPku have you resolved your issue?
This issue has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d
if there is no activity in the next 60 days.
This issue has been labeled inactive-90d
due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.