NVIDIA / cutlass

CUDA Templates for Linear Algebra Subroutines
Other
5.46k stars 924 forks source link

[BUG] Composition between `Tensor` and `Layout` as shown in `03_tensor.md` does not compile #1519

Open alexarmbr opened 5 months ago

alexarmbr commented 5 months ago

Describe the bug I tried to compile and run this code which I copied directly from 03_tensor.md

auto tv_layout = Layout<Shape <Shape <_2,_4>,Shape <_2, _2>>,
                        Stride<Stride<_8,_1>,Stride<_4,_16>>{};  // (8,4)

// Construct a 4x8 tensor with any layout
Tensor A = make_tensor<float>(Shape<_4,_8>{}, LayoutRight{});    // (4,8)
// Compose A with the tv_layout to transform its shape and order
Tensor tv = composition(A, tv_layout);  

it fails to compile because there is no implementation of composition which takes a Tensor and a Layout. Is the documentation wrong? or has this feature not been implemented yet

Steps/Code to reproduce bug try to build the above code

Expected behavior the code compiles

Environment details (please complete the following information): nvcr.io/nvidia/cuda:12.3.1-devel-ubuntu20.04 image

Additional context

ccecka commented 5 months ago

This was brought up here https://github.com/NVIDIA/cutlass/pull/1486

That function is useful for examples and documentation, but never actually needed in practice. :-)

It will be included in our next update.

In the meantime, you can use tensor.compose(tiler) to accomplish the same thing.

github-actions[bot] commented 4 months ago

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.