Heya I’ve been doing some googling and it looks like the first execution of a torchscript model includes a heavy warmup period. In my case, its almost 5 minutes.
This is pretty painful and I’m wondering if I can directly save the optimized model in the first place so I don’t have to go through this warmup period each time.
Sorry to hear that. Unfortunately, we can’t save the warmed-up model today due to a number of optimizations relying on in-memory data structures that can’t be serialized. We have some longer-term infrastructural work planned to improve compile times but it hasn’t landed yet.
Two things that would help us improve the situation:
We recently made a number of improvements to compilation and optimization time, can you try the nightly or the 1.7 RC and see if you get improvements (try running the model a few times).
If possible, can you provide the .pt file for the model that is taking a really long time to warm up, as well as some example inputs? It will help us understand what sort of models are causing long compilation times.