The CUDA Graph is empty

temp = x[b // 2:].clone()
mask = mask.permute(0, 3, 1, 2)
x[b // 2:][mask[b // 2:]] = x[:b // 2][mask[:b // 2]]
x[:b // 2][mask[:b // 2]] = temp[mask[b // 2:]]

type of x is float and type of mask is bool
When I add the code to the forward function of the model, it will display

‘UserWarning: The CUDA Graph is empty.’ This usually means that the graph was attacked to be captured on wrong device or stream The error ‘Triggered internally at…/ten/src/Aten/cuda/CUDAGraph. cpp: 224.’

After removing this code, it will not appear, and this error will not occur without using ‘torch. compile’.
Why did this situation occur? Is it because boolean indexes cannot appear in the forward when using compile?

Are you using nightlies by any chance? Also cc @eellison

The version is stable(2.1.2). I solved this by adding ‘torch.compiler.disable’. :smile: