bert-multi-gpu icon indicating copy to clipboard operation
bert-multi-gpu copied to clipboard

Query regarding calculation of iteration_steps and role of global_batch_size.

Open Q-Udita opened this issue 6 years ago • 2 comments

I have 100000 observations(num_train_examples ), train_batch_size = 4, num_gpu_cores = 8, I want to train with num_train_epochs = 1, Could you please suggest do I need to go for situation -1 iteration_steps = 100000/32 or situation -2 iteration_steps = 100000/4

If I go with situation-2 what is the role of global_batch_size ?

Q-Udita avatar Sep 03 '20 14:09 Q-Udita

I have 100000 observations(num_train_examples ), train_batch_size = 4, num_gpu_cores = 8, I want to train with num_train_epochs = 1, Could you please suggest do I need to go for situation -1 iteration_steps = 100000/32 or situation -2 iteration_steps = 100000/4

If I go with situation-2 what is the role of global_batch_size ?

Assume that fixed num_train_epochs = 1 and train_batch_size = 4. If use multi-gpu and num_gpu_cores = 8 (situation 1), then global_batch_size = 32 and iteration step = 100000/4. If num_gpu_cores = 1 only (situation 2), then global_batch_size = 4 and iteration step = 100000/4 also. Now, you can see the difference that situation 1 could provide larger effective batch_size in training (32 vs. 4) with same iteration step and it is more stable.

shishishu avatar Sep 06 '20 13:09 shishishu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 07 '20 05:10 stale[bot]