class_docstr: FP16 Optimizer without weight fusion to support LAMB optimizer
  
  For usage example please see, TODO:  DeepSpeed V2 Tutorial
class_docstr_tok: ["FP16","Optimizer","without","weight","fusion","to","support","LAMB","optimizer","For","usage","example","please","see",",","TODO",":","DeepSpeed","V2","Tutorial"]
code: def _update_scale(self, skip):
      if self.dynamic_loss_scale:
          prev_scale = self.cur_scale
          if skip:
              self.cur_scale = max(
                  self.cur_scale / self.scale_factor,
                  self.min_loss_scale,
              )
              self.last_overflow_iter = self.cur_iter
              if self.verbose:
                  logger.info(
                      "Grad overflow on iteration: %s", self.cur_iter
                  )
                  logger.info(
                      f"Reducing dynamic loss scale from {prev_scale} to {self.cur_scale}"
                  )
          else:
              # Ensure self.scale_window updates since last overflow
              stable_interval = (
                  self.cur_iter - self.last_overflow_iter
              ) - 1
              if (stable_interval > 0) and (
                  stable_interval % self.scale_window == 0
              ):
                  self.cur_scale *= self.scale_factor
                  if self.verbose:
                      logger.info(
                          f"No Grad overflow for {self.scale_window} iterations"
                      )
                      logger.info(
                          f"Increasing dynamic loss scale from {prev_scale} to {self.cur_scale}"
                      )
      else:
          if skip:
              logger.info(
                  "Grad overflow on iteration %s", self.cur_iter
              )
              logger.info(
                  "Using static loss scale of %s", self.cur_scale
              )
      self.cur_iter += 1
      return
  
imports: from deepspeed.moe.utils import split_params_grads_into_shared_and_expert_params
  import torch
  from torch._utils import _flatten_dense_tensors
  from deepspeed.runtime import DeepSpeedOptimizer
  from deepspeed.runtime.utils import get_global_norm, CheckOverflow, get_weight_norm, required_torch_version
  from deepspeed.runtime.fp16.loss_scaler import INITIAL_LOSS_SCALE, SCALE_WINDOW, MIN_LOSS_SCALE
  from deepspeed.utils import logger
  from deepspeed.checkpoint.constants import OPTIMIZER_STATE_DICT
  from deepspeed.accelerator import get_accelerator
  from deepspeed import comm
label_desc: Use image node_id 10 for calling the FP16_UnfusedOptimizer obj's underlying member method code with example usage: obj._update_scale(skip) without return types