Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cloudhan opened this issue Dec 28, 2023 · 20 comments

Comments

@cloudhan
Copy link

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

a75b4ac

@cloudhan cloudhan added ? - Needs Triage bug Something isn't working labels Dec 28, 2023
@hwu36
Copy link
Collaborator

hwu36 commented Jan 4, 2024

@thakkarV

@thakkarV
Copy link
Collaborator

thakkarV commented Jan 4, 2024

@ccecka @mhoemmen

@ccecka
Copy link

ccecka commented Jan 4, 2024

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

Copy link

github-actions bot commented Feb 3, 2024

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.

Copy link

github-actions bot commented May 3, 2024

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.

@mhoemmen
Copy link
Contributor

mhoemmen commented May 3, 2024

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

Copy link

github-actions bot commented Jun 2, 2024

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.

@mhoemmen
Copy link
Contributor

mhoemmen commented Jun 3, 2024

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

Copy link

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.

@cloudhan
Copy link
Author

cloudhan commented Sep 6, 2024

comment to avoid auto-close

@mhoemmen
Copy link
Contributor

mhoemmen commented Sep 9, 2024

@ccecka has this been fixed?

@ccecka
Copy link

ccecka commented Sep 9, 2024

Doesn't appear to be, no.

Copy link

github-actions bot commented Dec 8, 2024

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.

@leimao
Copy link
Contributor

leimao commented Dec 28, 2024

@ccecka Still no fix? I got a problem probably relevant to this when I tried to make make_tiled_copy as a constexpr function.

root@5bfb1ac7e7b2:/mnt# gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@5bfb1ac7e7b2:/mnt# nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131
Build cuda_12.4.r12.4/compiler.34097967_0

@thakkarV
Copy link
Collaborator

question, are you using the build flags generated by the CUTLASS CMake?

@leimao
Copy link
Contributor

leimao commented Dec 28, 2024

question, are you using the build flags generated by the CUTLASS CMake?

Thanks @thakkarV. I am new to this. Could you please point me to those build flags?

I was simply adding constexprs to the functions in this file and I was using my own CMake script for building. I might have missed something critical.

@leimao
Copy link
Contributor

leimao commented Dec 28, 2024

More specifically, was there any problem to make this make_tiled_copy function constexpr?

@thakkarV
Copy link
Collaborator

thakkarV commented Dec 28, 2024

we dont support custom cmake configs. please use the one that is in our repo.

@leimao
Copy link
Contributor

leimao commented Dec 28, 2024

we dont support custom cmake configs. please use the one that is in our repo.

But... Eventually the user will write their own scripts for building the program, right? Could you please point me to the key CMake files where those build flags were set?

@thakkarV
Copy link
Collaborator

No, that's not the case. if you are importing CUTLASS through your own project, then you can https://stackoverflow.com/questions/56561591/link-one-project-to-another-cmake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants