out of gpu memory at the end closed to converge...
I used transformer in Chinese to English translation task.. all the time it was running normally.. but after about 300000 iters, it always ran out of gpu memory when running several iters. my configuration was all the same.. except this, all is perfect.. Does anybody has some ideas?
the machine is 4 * K80.. and tensor2tensor version is 1.4.1.. my training configuration is like below:
@registry.register_hparams def translate_any_c2e_hparams(): hparams = transformer.transformer_big_single_gpu() hparams.optimizer_adam_beta2 = 0.999 hparams.batch_size = 2000 hparams.learning_rate_warmup_steps = 2000 hparams.learning_rate = 0.05 return hparams
I think this is a duplicate of #581
I think there's difference that, when after 300,000 iterators training, it will crash soon (maybe no more than 20,000 iterators) once I restart it. But it was running normally before 300,000 iterators, like 7 days, and during this process anytime you restart it, it would run normally until 300,000 iterators.. Is there any special operation when training process close to converge ?
I agree 300k steps (7 days) is quite a long time before OOM crash, but I still think this is exactly the same issue as #581.
So far my longest time before OOM was two and half days training (150k steps, with batch_size=2300 and 4 GPUs, thus after 150k2.3k4=1.38 gigatokens). I restarted the training from the last checkpoint and it crashed after 11k steps (282 minutes). I restarted again (from a checkpoint saved 42 before the crash) and it crashed again after 11k steps (282 minutes). I think this is caused by a particular datapoint (mischievous batch) in the training data or a sequence of mischievous batches. I don't think the OOM depends on whether the training is "close to converged", but maybe there is a relationship to the training time (the initial 150k steps is more than one epoch, so the mischievous batch has been processed for the first time without any OOM). My wild guess is that this may be related to the LazyAdam, which does not allocate momentum weights for tokens which were not seen so far.
After the third crash, I decreased the batch size to 2250 and resumed training, and it crashed after 311 minutes. Then I decreased the batch size to 2200, resumed and it finally trained without any OOM.
I experienced both cases @annisamansa and @martinpopel mentioned: (1) OOM shortly or 2.5 days of training ans (2) OOM after a week. Setting hparams.symbol_modality_num_shards = 1 helped me with OOMs where training actually works but then unexpectedly crashes.
Closing in favor of #581