When training the same model using my jupyter notebook and google colab (using the EXACT same notebook),
They are both running the same code, thus they are both using ‘cuda’ as device, for sure.
My local machine Total training time: 72.489 seconds |
Google Colab Total training time: 3.115 seconds
It’s a HUGE difference. Here are the ‘nvidia-smi’ outputs from my machine
enter image description here
and from google colab:
enter image description here
*I’ve reinstalled and updated the complete pytorch ecosystem, updated my drivers and CUDA driver.
Everything is running in the cuda on my machine, but somehow its just slow. CPU is actually faster than the GPU in my machine..
BATCH_SIZE = 32
NUM_WORKERS = os.cpu_count()
train_loader = DataLoader(train_data, batch_size=BATCH_SIZE, num_workers=NUM_WORKERS, shuffle=True)
train_loader = DataLoader(test_data, batch_size=BATCH_SIZE, num_workers=NUM_WORKERS)
train_loader, test_loader
Thats how my loaders are set.
batch, labels = next(iter(train_loader))
print(f'{batch.size() = }')
print(f'{labels.size() = }')
Loading a batch takes 2-3 seconds to load in my side. And its faster in google colab. May it be the bottleneck?
Is there anything I should do or is my GPU just THAT bad?
Thanks!