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

Fix in-place to views condition #633

Closed crcrpar closed 1 week ago

crcrpar commented 1 week ago

What does this PR do?

Special case batch norm and avg/max-pool in the checker as they would not return a view as their output.

Add a test that make sure that thunder can execute torchvision.models.resnet18

t-vi commented 1 week ago

I looked at the numerical accuracy a bit more and does not seem to happen with eval mode, so maybe something with the training mode batch norm.