-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Which component has the problem?
CuTe DSL
Bug Report
Describe the bug
If you run
ans = [cute.printf("if statement\n"), 1][1] if row_idx < self.seqlen_q else [cute.printf("else statement\n"), 1][1]
then you would see both executed
if statement
else statement
From @v0i0, this is due to https://github.com/NVIDIA/cutlass/blob/main/python/CuTeDSL/cutlass/base_dsl/ast_preprocessor.py#L1637, which transforms the if else into select so it computes both sides.
This can be a bit unexpected, since this differs from the usual behavior:
if A:
XXX
else:
YYY
Steps/Code to reproduce bug
Include this code.
ans = [cute.printf("if statement\n"), 1][1] if row_idx < self.seqlen_q else [cute.printf("else statement\n"), 1][1]
Expected behavior
Same behavior as normal if else blocks.
Environment details (please complete the following information):
Linux, python 3.12, GB200, nvidia-cutlass-dsl 4.3.3
Additional context
NA
Reactions are currently unavailable