I’m running into this rather odd behaviour.
As per the title: the first torch import and .to(device) is very slow (upwards of 2 minutes) when using an environment where pytorch was installed from the conda cache (i.e., it wasn’t downloaded).
This does not happen if conda has to download pytorch (e.g. when I’m using a new version that hadn’t been installed yet).
This seems to happen regardless of pytorch version or GPU type. I’m using AWS images (both my own and the AWS Deep Learning Base AMI). This happens for both.
In fact, AWS Deep Learning Base AMI already comes with the environments ready to activate, and the first import still takes a long time.
Any idea as to why freshly downloaded pytorch runs quickly at the first call, whereas cached/preinstalled pytorch doesn’t?