Hello,
We may answer you better with some code.
In the case of PyTorch, if you have enough memory, you could move the whole dataset tensor to the GPU device:
device = ...
dataset_tensor = dataset_tensor.to(device) # works for batches too, just need to loop over them

Then, start your training loop and obtain a lower training time. Anyway, the dataset batches still have to be loaded in the memory. Either way, the total execution time for the script may probably be a little lower only.