code: def grad_overflow(pgs: list) -> bool:
      "Tests all fp16 parameters in pgs for gradient overflow"
      for pg in pgs:
          for p in pg:
              if p.grad is not None and test_overflow(p.grad.data):
                  return True
      return False
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from torch.cuda.amp import GradScaler, autocast
  from torch.cuda.amp.grad_scaler import OptState
  from ..fp16_utils import convert_network, model_grads_to_master_grads, master_params_to_model_params
  from torch.nn.utils import parameters_to_vector
label_desc: Use image node_id 8 for calling a global function with example usage: grad_overflow(pgs) and returns: False, True