Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QST] What is the difference between make_shape and make_tile? #1297

Closed
ZhangZhiPku opened this issue Jan 9, 2024 · 5 comments
Closed

[QST] What is the difference between make_shape and make_tile? #1297

ZhangZhiPku opened this issue Jan 9, 2024 · 5 comments

Comments

@ZhangZhiPku
Copy link

ZhangZhiPku commented Jan 9, 2024

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?

@hwu36
Copy link
Collaborator

hwu36 commented Jan 9, 2024

@thakkarV

@thakkarV
Copy link
Collaborator

thakkarV commented Jan 11, 2024

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.

@mnicely
Copy link
Collaborator

mnicely commented Feb 22, 2024

@ZhangZhiPku have you resolved your issue?

Copy link

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.

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants