soumith / imagenet-multiGPU.torch

an imagenet example in torch.
BSD 2-Clause "Simplified" License
401 stars 158 forks source link

When do we need to use cutorch.synchronize #36

Closed eriche2016 closed 8 years ago

eriche2016 commented 8 years ago

@soumith , I noticed that there are many place to use cutorch.synchronize function in the file train.lua, I want to know is it necessary to use cutorch.synchronize in these place, because in DataParallelTable module, there is already cutorch,synchronize to consider synchronize stuff ex, the updateOutput method. can you give me some tips about this ? much appreciate it..

soumith commented 8 years ago

those synchronize calls are in places so that I can report accurate time measurements, and not for any technical purpose. In general you dont need to synchronize explicitly anywhere in cutorch.