Closed oukohou closed 4 years ago
Hi @oukohou
The first time is different from the rest of the measurements because of CUDA START time. You should warm up the GPU clock for at least a couple seconds. So skip the initial few measurements and then start measuring time. You can read more about it: https://pytorch.org/docs/stable/bottleneck.html
Also, CUDA code will be operating in an asynchronous manner, so its better to add torch.cuda.synchronize()
.
Thanks, let me know for further questions.
@ShivamDuggal4 Well, that's really great help, THANKS!
my test code of time costs is as following:
and the outputs is :
my config is as :
and the results is even accurate, why the time differs so greatly? And the first time runs faster 10 times then the later?
Environments:
GTX1080, python 3.5, Ubuntu16.04