You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set "gradient_clipping" in deepspeed does not work, look into the source code in deepspeed.runtime.engine.DeepSpeedEngine,in line 2101
def _take_model_step(self, lr_kwargs, block_eigenvalue={}):
if self.gradient_clipping() > 0.0:
if not (self.fp16_enabled() or self.bfloat16_enabled() or self.amp_enabled() or self.zero_optimization()):
self.clip_fp32_gradients()
elif self.amp_enabled():
# AMP's recommended way of doing clipping
# https://nvidia.github.io/apex/advanced.html#gradient-clipping
master_params = amp.master_params(self.optimizer)
clip_grad_norm_(parameters=master_params, max_norm=self.gradient_clipping(), mpu=self.mpu)
self.optimizer.step()
thus gradient clipping do nothing at all!!!
The text was updated successfully, but these errors were encountered:
chengmengli06
changed the title
[REQUEST]Please add clip_grad_norm for zero_optimization mode
[Bug] clip_grad_norm for zero_optimization mode is not working
Nov 20, 2024
chengmengli06
changed the title
[Bug] clip_grad_norm for zero_optimization mode is not working
[BUG] clip_grad_norm for zero_optimization mode is not working
Nov 20, 2024
@tjruwase another question is how log the pre-clip and after clip gradient norms to tensorboard? is there any interface to get the pre and after clip gradient norms?
set "gradient_clipping" in deepspeed does not work, look into the source code in deepspeed.runtime.engine.DeepSpeedEngine,in line 2101
thus gradient clipping do nothing at all!!!
The text was updated successfully, but these errors were encountered: