Skip to content

[BUG] Compile warning/error - -Werror=unused-but-set-variable unused curr_stride in cute/layout.hpp via flash attention. #2253

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

Open
Skylion007 opened this issue Apr 19, 2025 · 1 comment
Labels
? - Needs Triage bug Something isn't working

Comments

@Skylion007
Copy link

Describe the bug
A clear and concise description of what the bug is.

Compile Warning with unused variable in cute layout.h with constexpr if else.

Steps/Code to reproduce bug
Follow this guide http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports to craft a minimal bug report. This helps us reproduce the issue you're having and resolve the issue more quickly.

Compile flash attention via CUTLASS like in PyTorch. Generates a warning relating to this line:

auto curr_stride = get<curr_i>(lhs_stride);
Either move the getter into the if else statement below (which make lhstride maybe unused) or add [[maybe unused]] to that accessor as well.

Full logs from the build here:

2025-04-19T03:36:32.7810494Z /var/lib/jenkins/workspace/aten/src/ATen/../../../third_party/cutlass/include/cute/layout.hpp:1066:6: error: variable ‘curr_stride’ set but not used [-Werror=unused-but-set-variable]

https://hud.pytorch.org/pr/pytorch/pytorch/151253#40809563092

Expected behavior
No compiler warning with the PyTorch build script and no crash since warnings are treated as errors here.

Environment details (please complete the following information):

  • Environment location: [Bare-metal, Docker, Cloud(specify cloud provider)]

Additional context
Add any other context about the problem here.

@Skylion007 Skylion007 added ? - Needs Triage bug Something isn't working labels Apr 19, 2025
@Skylion007 Skylion007 changed the title [BUG] Compile warning - unused curr_stride in cute/layout.hpp via flash attention. [BUG] Compile warning/error - -Werror=unused-but-set-variable unused curr_stride in cute/layout.hpp via flash attention. Apr 19, 2025
@hwu36
Copy link
Collaborator

hwu36 commented Apr 30, 2025

it should be fixed in 3.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - Needs Triage bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants