Reported by a user (@kenza-bouzid) here:
When using num_workers>1 and pin_memory=True, training time increases exponentially over epochs


I had profiled/timed all intermediate steps, and found out that GridPatch was the guilty one

So I timed all intermediate step in the tranform



It turned out that the operation that was taking too long was a memory allocation by np.array
|
patched_image = np.array(patches[0]) |
I eventually fixed it by setting pin_memory=False,
which I explain by cuda memory allocation being more expensive as it has to be allocated from the pinned memory
Note that I am dealing with particularly large slides ~50kx50k
Any thoughts on this?
Reported by a user (@kenza-bouzid) here:
When using num_workers>1 and pin_memory=True, training time increases exponentially over epochs



I had profiled/timed all intermediate steps, and found out that GridPatch was the guilty one
So I timed all intermediate step in the tranform
It turned out that the operation that was taking too long was a memory allocation by np.array
MONAI/monai/transforms/spatial/array.py
Line 3279 in a2ec375
I eventually fixed it by setting pin_memory=False,
which I explain by cuda memory allocation being more expensive as it has to be allocated from the pinned memory
Note that I am dealing with particularly large slides ~50kx50k
Any thoughts on this?