cutlass
cutlass copied to clipboard
[QST] In cute, when should we use int<> and when should not?
What is your question?
// ((_3,2),(2,_5,_2)):((4,1),(_2,13,100))
Tensor A = make_tensor(ptr, make_shape (make_shape (Int<3>{},2), make_shape ( 2,Int<5>{},Int<2>{})),
make_stride(make_stride( 4,1), make_stride(Int<2>{}, 13, 100)));
// ((2,_5,_2)):((_2,13,100))
Tensor B = A(2,_);
// ((_3,_2)):((4,1))
Tensor C = A(_,5);
// (_3,2):(4,1)
Tensor D = A(make_coord(_,_),5);
// (2,2,_2):(1,_2,100)
Tensor E = A(make_coord(2,_),make_coord(_,3,_));
It seems that using int<> will be "static and benefitial for compiler's optimization? But when should I use it?
Typically you don't know the size of the input tensors, (M, N, K) are dynamic. Other things static.
@ziyuhuang123 General advice is to use Int<X>
or _X
constexpr when possible (e.g. gemm tilesize, etc). For dynamic values (gemm problem size as @YichengDWu pointed out), u should use string literal.
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.