Is there significant performance issues when running PyTorch for Linux on Windows with Docker and WSL compared to running a native Linux version?


We have a containerized PyTorch that runs neural networks.

When we run this on Linux PC it is quite fast.

But when we switch to Windows PC that runs HyperV, that runs WSL, that runs Docker, that runs Ubuntu, that runs PyTorch, it is quite slower. Maybe 4 to 10 time slower.

There are several potential sources for this. Do you know if there are known overhead when running PyTorch with this type of configuration?

Of course this seems something quite stupid to do but there are complex constraints due to the rest of the project.


I don’t know what might be causing the slowdown, but you could profile your workload (e.g. via Nsight Systems) and check which part of the code slows down and where the bottleneck might be.