-
Notifications
You must be signed in to change notification settings - Fork 1.5k
GridPatch with pin_memory=True significant slow-down in following epochs #6082
Copy link
Copy link
Open
Labels
Description
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
| 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?
Reactions are currently unavailable


