cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[BUG] right_inverse with 1d layout results "#2700-D: attempt to access expired storage" on constexpr return value.

Open cloudhan opened this issue 2 years ago • 8 comments

Describe the bug

Steps/Code to reproduce bug

#include "cute/tensor.hpp"
using namespace cute;
__global__ void kernel() {
  constexpr auto weird = right_inverse(make_layout(_2{}, _1{}));
  print(weird);
}

int main() {
  kernel<<<1, 1>>>();
  cudaDeviceSynchronize();
}

compile the code cause

error: expression must have a constant value
include/cute/layout.hpp(1143): note #2700-D: attempt to access expired storage
include/cute/algorithm/tuple_algorithms.hpp(114): note #2693-D: called from:
include/cute/algorithm/tuple_algorithms.hpp(248): note #2693-D: called from:
include/cute/layout.hpp(1143): note #2693-D: called from:

remove the constexpr however, the program compiles smoothly and prints _2:_1

Expected behavior It compiles.

Environment details (please complete the following information): reproduced with cuda 11.8 and 12.1

Additional context

a75b4ac483166189a45290783cb0a18af5ff0ea5

cloudhan avatar Dec 28 '23 08:12 cloudhan

@thakkarV

hwu36 avatar Jan 04 '24 18:01 hwu36

@ccecka @mhoemmen

thakkarV avatar Jan 04 '24 18:01 thakkarV

Weird one, but I think I know where this is coming from. I'll include a fix in the next CuTe review

ccecka avatar Jan 04 '24 18: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 03 '24 19:02 github-actions[bot]

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.

github-actions[bot] avatar May 03 '24 19:05 github-actions[bot]

I do get a lot of warnings with MSVC about CuTe functions returning temporary storage. I suspect MSVC doesn't follow the reference forwarding rules of other compilers

mhoemmen avatar May 03 '24 21:05 mhoemmen

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 Jun 02 '24 22:06 github-actions[bot]

Commenting so the friendly bot doesn't auto-close this issue.

mhoemmen avatar Jun 03 '24 16:06 mhoemmen

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 Jul 10 '24 21:07 github-actions[bot]