Open CentofantiEze opened 1 year ago
The goal is to decrease the training time by taking advantage of available GPU. The following Performance Tuning Guide will be followed.
To do:
Dataloader(..., num_workers=N)
N
num_workers
Dataloader(..., pin_memory=True)
optimizer.zero_grad(set_to_none=True)
torch.jit.script
Adding workers to the dataloader helps if the data is fetched and processed when we are getting each dataset item. If the dataset already processed and allocated, we don't need workers.
Training Performance Tuning
The goal is to decrease the training time by taking advantage of available GPU. The following Performance Tuning Guide will be followed.
To do:
Dataloader(..., num_workers=N)
. Look for a reasonable value ofN
.num_workers
).Dataloader(..., pin_memory=True)
.optimizer.zero_grad(set_to_none=True)
.torch.jit.script
).