Closed tfogal closed 3 weeks ago
Thank you for the report, @tfogal
If args is empty, this will give an empty list: https://github.com/Lightning-AI/lightning-thunder/blob/50f587d6ff6c17a8f8392c57a0e6a73b0fe298fb/thunder/transforms/cudagraph.py#L36 and so unpacking fails.
We should handle empty args by special casing it and setting the for lhs items to empty tuples.
I'll send a PR.
The other trouble we'll run into is that the autograd passes delete the marks of static inputs. This needs fixing and is on our list, but it is quite a refactor. #1138
@tfogal with #1324 fixing the immediate issue, I would close this or assign it back to you for update. Sorry for taking long.
🐛 Bug
Inside the
CUDAGraphTransform
to_arg_descriptor
code,zip(*map(extract_descriptor, args))
is not getting the values it expects and this leads to a tuple unpacking issue.To Reproduce
Run the NeVA model (#343) model and apply the graph transform:
use_cuda_graph
just takes a counter of the graph we're seeing, and it returns true if it is graph 37 (at least for this bug).Code sample
TomF to edit this in later
Expected behavior
Transform the program to use a graph[s]. Or throw a reasonable error about why that's not possible.
Environment
Using thunder
4550f6bf231885cb6745fd8d705357c32ad0f2d0
.Additional context
We're not yet sure launch latency is on the critical path for NeVA; I am just experimenting to see. The impact a graph would have on launch latency could help confirm this.