cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST] Cosize and Complement

Open jeromeku opened this issue 2 years ago • 3 comments

Can someone walkthrough how cosize and complement are derived through a few simple examples?

For example, when I run the complement.cpp CuTe unit test with CUTLASS_TRACE_DEBUG_LEVEL=1, the following is printed, where layout and its cosize are in parentheses to the left of the arrow and the complement right of the arrow:

cute_test.cpp:82  -------------------------------
cute_test.cpp:83  COMPLEMENT
cute_test.cpp:84  -------------------------------
cute_test.cpp:43  complement( _1:_0, _1)  =>  _1:_0
cute_test.cpp:43  complement( _1:_0, _2)  =>  _2:_1
cute_test.cpp:43  complement( _1:_1, _1)  =>  _1:_0
cute_test.cpp:43  complement( _1:_1, _2)  =>  _2:_1
cute_test.cpp:43  complement( _1:_2, _1)  =>  _1:_0
cute_test.cpp:43  complement( _1:_2, _2)  =>  _2:_1
cute_test.cpp:43  complement( _1:_2, _8)  =>  _8:_1
cute_test.cpp:43  complement( _4:_0, _1)  =>  _1:_0
cute_test.cpp:43  complement( _4:_0, _2)  =>  _2:_1
cute_test.cpp:43  complement( _4:_0, _8)  =>  _8:_1
cute_test.cpp:43  complement( _4:_1, _1)  =>  _1:_0
cute_test.cpp:43  complement( _4:_1, _2)  =>  _1:_0
cute_test.cpp:43  complement( _4:_1, _8)  =>  _2:_4
cute_test.cpp:43  complement( _4:_2, _1)  =>  _2:_1
cute_test.cpp:43  complement( _4:_2, _7)  =>  _2:_1
cute_test.cpp:43  complement( _4:_2, _16)  =>  (_2,_2):(_1,_8)
cute_test.cpp:43  complement( _4:_4, _1)  =>  _4:_1
cute_test.cpp:43  complement( _4:_4, _13)  =>  _4:_1
cute_test.cpp:43  complement( _4:_4, _17)  =>  (_4,_2):(_1,_16)
cute_test.cpp:43  complement( (_2,_4):(_1,_2), _8)  =>  _1:_0
cute_test.cpp:43  complement( (_2,_3):(_1,_2), _6)  =>  _1:_0
cute_test.cpp:43  complement( (_2,_4):(_1,_4), _14)  =>  _2:_2
cute_test.cpp:43  complement( (_2,_4,_8):(_8,_1,_64), _460)  =>  (_2,_4):(_4,_16)
cute_test.cpp:43  complement( (_2,_4,_8):(_8,_1,_0), _12)  =>  _2:_4
cute_test.cpp:43  complement( (_2,_4,_8):(_8,_1,_0), _460)  =>  (_2,_29):(_4,_16)
cute_test.cpp:43  complement( ((_2,_2),(_2,_2)):((_1,_4),(_8,_32)), _46)  =>  (_2,_2):(_2,_16)
cute_test.cpp:43  complement( ((_2,_2),(_2,_2)):((_1,_32),(_8,_4)), _46)  =>  (_2,_2):(_2,_16)
cute_test.cpp:43  complement( (_4,_6):(_1,_6), _34)  =>  _1:_0
cute_test.cpp:43  complement( (_4,_2):(_1,_10), _14)  =>  _2:_4
cute_test.cpp:43  complement( (_4,_2):(_1,_16), _20)  =>  _4:_4
cute_test.cpp:211  -------------------------------
cute_test.cpp:212  Dynamic shapes/strides
cute_test.cpp:213  -------------------------------
cute_test.cpp:43  complement( 12:_1, 1)  =>  1:12
cute_test.cpp:43  complement( 12:_1, 12)  =>  1:12
cute_test.cpp:43  complement( 12:_1, 53)  =>  5:12
cute_test.cpp:43  complement( 12:_1, 128)  =>  11:12
cute_test.cpp:43  complement( 12:1, 1)  =>  (1,1):(_1,12)
cute_test.cpp:43  complement( 12:1, 12)  =>  (1,1):(_1,12)
cute_test.cpp:43  complement( 12:1, 53)  =>  (1,5):(_1,12)
cute_test.cpp:43  complement( 12:1, 128)  =>  (1,11):(_1,12)
cute_test.cpp:43  complement( 12:_2, 1)  =>  (_2,1):(_1,24)
cute_test.cpp:43  complement( 12:_2, 23)  =>  (_2,1):(_1,24)
cute_test.cpp:43  complement( 12:_2, 53)  =>  (_2,3):(_1,24)
cute_test.cpp:43  complement( 12:_2, 128)  =>  (_2,6):(_1,24)
cute_test.cpp:43  complement( 12:2, 1)  =>  (2,1):(_1,24)
cute_test.cpp:43  complement( 12:2, 23)  =>  (2,1):(_1,24)
cute_test.cpp:43  complement( 12:2, 53)  =>  (2,3):(_1,24)
cute_test.cpp:43  complement( 12:2, 128)  =>  (2,6):(_1,24)
cute_test.cpp:43  complement( (3,6):(_1,_3), 18)  =>  (1,1):(3,18)
cute_test.cpp:43  complement( (3,6):(_1,_9), 48)  =>  (3,1):(3,54)
cute_test.cpp:43  complement( (3,6):(_1,_10), 53)  =>  (3,1):(3,60)
cute_test.cpp:43  complement( ((2,2),(2,2)):((_1,_4),(_8,_32)), 46)  =>  (2,1,2,1):(2,8,16,64)

jeromeku avatar Jan 04 '24 18:01 jeromeku

@thakkarV

hwu36 avatar Jan 05 '24 21:01 hwu36

Please wait a few more days for the updated CuTe Documentation, thanks!

ccecka avatar Jan 05 '24 21:01 ccecka

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.

github-actions[bot] avatar Feb 04 '24 22:02 github-actions[bot]

Closing. Docs were updated with the 3.4

mnicely avatar Feb 22 '24 15:02 mnicely