Lightning-AI / lightning-thunder

Make PyTorch models up to 40% faster! Thunder is a source to source compiler for PyTorch. It enables using different hardware executors at once; across one or thousands of GPUs.
Apache License 2.0
1.07k stars 60 forks source link

`saved_tensors_list` might contain `None`s #619

Open nikitaved opened 1 week ago

nikitaved commented 1 week ago
saved_tensors is implemented to store only tensors and nothing else is allowed by torch.autograd.Function's ctx.save_for_backward method.

_Originally posted by @IvanYashchuk in https://github.com/Lightning-AI/lightning-thunder/pull/607#discussion_r1643082936_

As per title. https://github.com/Lightning-AI/lightning-thunder/pull/616 shows that this assumption is not true, and fails in our notebooks.