cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST] How to stop unroll in cute.copy in cute dsl?

Open monellz opened this issue 1 month ago • 1 comments

What is your question? cute.copy will always fully unroll its inner load/store. But in some case, the unrolling in cute.copy will case serious register spill. So I wonder how to stop unroll in cute.copy elegantly, instead of just manullay copy?

monellz avatar Dec 08 '25 14:12 monellz

What is your question? cute.copy will always fully unroll its inner load/store. But in some case, the unrolling in cute.copy will case serious register spill. So I wonder how to stop unroll in cute.copy elegantly, instead of just manullay copy?

@brandon-yujie-sun

fengxie avatar Dec 08 '25 16:12 fengxie

Thanks for the question. cute.copy today fully unrolls when the inner loop size is static. There are probably several options:

  1. to avoid serious register spill, you'd probably tweak the atom size for the copy
  2. you can also probably try out cute.copy_atom_call with your customized for loop with cutlass.range to control the unrolling behavior yourself.

Please let us know how this would help and we would discuss and plan more examples in future release for 2.

brandon-yujie-sun avatar Dec 15 '25 15:12 brandon-yujie-sun

cc @vickiw973

brandon-yujie-sun avatar Dec 15 '25 15:12 brandon-yujie-sun

Thanks a lot! The cute.copy_atom_call seems what I want and I will try it.

monellz avatar Dec 16 '25 01:12 monellz

@brandon-yujie-sun it might be useful to add unrolling control to API for copy & gemm?

fengxie avatar Dec 16 '25 05:12 fengxie

Yes, that's a good idea. Will follow up on that.

brandon-yujie-sun avatar Dec 16 '25 07:12 brandon-yujie-sun