Skip to content

torchscript model tests have blind spots #3028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fmassa opened this issue Nov 19, 2020 · 0 comments · Fixed by #3033
Closed

torchscript model tests have blind spots #3028

fmassa opened this issue Nov 19, 2020 · 0 comments · Fixed by #3033

Comments

@fmassa
Copy link
Member

fmassa commented Nov 19, 2020

🐛 Bug

#3027 uncovered that some models in torchvision are not being tested on CI for torchscript compatibility.

I believe the main reason was that scripting a model in the past could take a significant amount of time, which could make the CI timeout, so only models added in

script_test_models = {
'deeplabv3_resnet50': {},
'deeplabv3_resnet101': {},
'mobilenet_v2': {},
'resnext50_32x4d': {},
'fcn_resnet50': {},
'fcn_resnet101': {},
'googlenet': {
'unwrapper': lambda x: x.logits
},
'densenet121': {},
'resnet18': {},
'alexnet': {},
'shufflenet_v2_x1_0': {},
'squeezenet1_0': {},
'vgg11': {},
'inception_v3': {
'unwrapper': lambda x: x.logits
},
'r3d_18': {},
"fasterrcnn_resnet50_fpn": {
'unwrapper': lambda x: x[1]
},
"maskrcnn_resnet50_fpn": {
'unwrapper': lambda x: x[1]
},
"keypointrcnn_resnet50_fpn": {
'unwrapper': lambda x: x[1]
},
"retinanet_resnet50_fpn": {
'unwrapper': lambda x: x[1]
}
}
seem to be tested for scriptability.

Today, operator fusion happens during the first forward pass of the model.
We should at least check that all models support being converted to torch.jit.script. At best, we should execute the scripted model and compare the outputs with the non-scripted model, but this might introduce a lot of overhead if compilation is slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant