As PyTorch 1.13 has been released and it only supports CUDA 11.6 and 11.7, the above installed the CPU version of PyTorch 1.13. Thus I had to install again PyTorch 1.12.1 for compatibility with CUDA 11.3:
I tried ResNet50 for 16 epochs and expected the training to complete in about 15 minutes, as reported.
(ffcv) python train_imagenet.py --config-file rn50_configs/rn50_16_epochs.yaml \
> --data.train_dataset=$HOME/data/imagenet_ffcv/jpg50/train_500_0.50_90.ffcv \
> --data.val_dataset=$HOME/data/imagenet_ffcv/jpg50/val_500_0.50_90.ffcv \
> --data.num_workers=8 --data.in_memory=1 \
> --logging.folder=$HOME/experiments/ffcv
┌ Arguments defined────────┬─────────────────────────────────────────────────────────────────────────────────┐
│ Parameter │ Value │
├──────────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ model.arch │ resnet50 │
│ model.pretrained │ 0 │
│ resolution.min_res │ 160 │
│ resolution.max_res │ 192 │
│ resolution.end_ramp │ 13 │
│ resolution.start_ramp │ 11 │
│ data.train_dataset │ /home/data/imagenet_ffcv/jpg50/train_500_0.50_90.ffcv │
│ data.val_dataset │ /home/data/imagenet_ffcv/jpg50/val_500_0.50_90.ffcv │
│ data.num_workers │ 8 │
│ data.in_memory │ 1 │
│ lr.step_ratio │ 0.1 │
│ lr.step_length │ 30 │
│ lr.lr_schedule_type │ cyclic │
│ lr.lr │ 1.7 │
│ lr.lr_peak_epoch │ 2 │
│ logging.folder │ /home/experiments/ffcv │
│ logging.log_level │ 1 │
│ validation.batch_size │ 512 │
│ validation.resolution │ 256 │
│ validation.lr_tta │ 1 │
│ training.eval_only │ 0 │
│ training.batch_size │ 512 │
│ training.optimizer │ sgd │
│ training.momentum │ 0.9 │
│ training.weight_decay │ 0.0001 │
│ training.epochs │ 16 │
│ training.label_smoothing │ 0.1 │
│ training.distributed │ 1 │
│ training.use_blurpool │ 1 │
│ dist.world_size │ 8 │
│ dist.address │ localhost │
│ dist.port │ 12355 │
└──────────────────────────┴─────────────────────────────────────────────────────────────────────────────────┘
Warning: no ordering seed was specified with distributed=True. Setting seed to 0 to match PyTorch distributed sampler.Warning: no ordering seed was specified with distributed=True. Setting seed to 0 to match PyTorch distributed sampler.Warning: no ordering seed was specified with distributed=True. Setting seed to 0 to match PyTorch distributed sampler.Warning: no ordering seed was specified with distributed=True. Setting seed to 0 to match PyTorch distributed sampler.Warning: no ordering seed was specified with distributed=True. Setting seed to 0 to match PyTorch distributed sampler.
Warning: no ordering seed was specified with distributed=True. Setting seed to 0 to match PyTorch distributed sampler.
Warning: no ordering seed was specified with distributed=True. Setting seed to 0 to match PyTorch distributed sampler.
Warning: no ordering seed was specified with distributed=True. Setting seed to 0 to match PyTorch distributed sampler.
/home/.conda/envs/ffcv/lib/python3.9/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
/home/.conda/envs/ffcv/lib/python3.9/site-packages/torchmetrics/utilities/prints.py:36: UserWarning: Torchmetrics v0.9 introduced a new argument class property called
`full_state_update` that has
not been set for this class (MeanScalarMetric). The property determines if `update` by
default needs access to the full metric state. If this is not the case, significant speedups can be
achieved and we recommend setting this to `False`.
We provide an checking function
`from torchmetrics.utilities import check_forward_full_state_property`
that can be used to check if the `full_state_update=True` (old and potential slower behaviour,
default for now) or if `full_state_update=False` can be used safely.
=> Logging in /home/experiments/ffcv/69f9f7b3-1f39-48b6-be91-2242639ef094
ep=0, iter=311, shape=(512, 3, 160, 160), lrs=['0.847', '0.847']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [28:08<00:00, 5.41s/it]
ep=0, iter=311, shape=(512, 3, 160, 160), lrs=['0.847', '0.847']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [28:08<00:00, 5.41s/it]
ep=0, iter=311, shape=(512, 3, 160, 160), lrs=['0.847', '0.847']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [28:08<00:00, 5.41s/it]
ep=0, iter=311, shape=(512, 3, 160, 160), lrs=['0.847', '0.847']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [28:08<00:00, 5.41s/it]
ep=0, iter=311, shape=(512, 3, 160, 160), lrs=['0.847', '0.847']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [28:08<00:00, 5.41s/it]
ep=0, iter=311, shape=(512, 3, 160, 160), lrs=['0.847', '0.847']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [28:08<00:00, 4.53s/it]
ep=0, iter=311, shape=(512, 3, 160, 160), lrs=['0.847', '0.847']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [28:08<00:00, 5.41s/it]
ep=0, iter=311, shape=(512, 3, 160, 160), lrs=['0.847', '0.847']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [28:08<00:00, 5.41s/it]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00, 1.31s/it]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00, 1.31s/it]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00, 1.26it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00, 1.31s/it]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00, 1.31s/it]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00, 1.31s/it]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00, 1.31s/it]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00, 1.31s/it]
=> Log: {'current_lr': 0.8473609134615385, 'top_1': 0.06341999769210815, 'top_5': 0.17452000081539154, 'val_time': 17.07068157196045, 'train_loss': None, 'epoch': 0}
ep=1, iter=311, shape=(512, 3, 160, 160), lrs=['1.697', '1.697']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [06:18<00:00, 1.21s/it]
ep=1, iter=311, shape=(512, 3, 160, 160), lrs=['1.697', '1.697']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [06:18<00:00, 1.21s/it]
ep=1, iter=311, shape=(512, 3, 160, 160), lrs=['1.697', '1.697']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [06:18<00:00, 1.21s/it]
ep=1, iter=311, shape=(512, 3, 160, 160), lrs=['1.697', '1.697']: 100%|███████████████████████████████████████████████████████████████████████████████████████▋| 311/312 [06:18<00:01, 1.50s/it]
ep=1, iter=311, shape=(512, 3, 160, 160), lrs=['1.697', '1.697']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [06:18<00:00, 1.21s/it]
ep=1, iter=311, shape=(512, 3, 160, 160), lrs=['1.697', '1.697']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [06:18<00:00, 1.21s/it]
ep=1, iter=311, shape=(512, 3, 160, 160), lrs=['1.697', '1.697']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [06:18<00:00, 1.21s/it]
ep=1, iter=311, shape=(512, 3, 160, 160), lrs=['1.697', '1.697']: 100%|████████████████████████████████████████████████████████████████████████████████████████| 312/312 [06:18<00:00, 1.21s/it]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:12<00:00, 1.03it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:12<00:00, 1.03it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:12<00:00, 1.02it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:12<00:00, 1.02it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:12<00:00, 1.02it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:12<00:00, 1.02it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:12<00:00, 1.02it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:12<00:00, 1.01it/s]
=> Log: {'current_lr': 1.6972759134615385, 'top_1': 0.14985999464988708, 'top_5': 0.35117998719215393, 'val_time': 12.889710664749146, 'train_loss': None, 'epoch': 1}
As you can see, epoch 0 already took 28 minutes to complete (the subsequent epochs took more than 6 minutes but this is still too high). I checked GPU utilization using nvidia-smi: all GPUs were used (and under-used, obviously):
My server has 8 GPU Nvidia A100 (SXM4 80 Go) and 512 GB of RAM, which is comparable to what was used in your experiments.
What should I check to see what went wrong? Could you please try reproducing the above on your side? I guess this would take only a few minutes (the write_imagenet step takes a lot of time but you already have the files so this step can be skipped).
Hello,
Unfortunately I have been unable to reproduce reported results despite a lot of efforts.
Installation
As PyTorch 1.13 has been released and it only supports CUDA 11.6 and 11.7, the above installed the CPU version of PyTorch 1.13. Thus I had to install again PyTorch 1.12.1 for compatibility with CUDA 11.3:
And installation of dependencies:
Create dataset
Results:
Training
I tried ResNet50 for 16 epochs and expected the training to complete in about 15 minutes, as reported.
As you can see, epoch 0 already took 28 minutes to complete (the subsequent epochs took more than 6 minutes but this is still too high). I checked GPU utilization using
nvidia-smi
: all GPUs were used (and under-used, obviously):My server has 8 GPU Nvidia A100 (SXM4 80 Go) and 512 GB of RAM, which is comparable to what was used in your experiments.
What should I check to see what went wrong? Could you please try reproducing the above on your side? I guess this would take only a few minutes (the
write_imagenet
step takes a lot of time but you already have the files so this step can be skipped).Thank you very much in advance for your response!