code: def rescale_linear_bias(linear):
      """Rescale bias in nn.Linear layers to convert SP initialization to μP initialization.
  
      Warning: This method is NOT idempotent and should be called only once
      unless you know what you are doing.
      """
      if (
          hasattr(linear, "_has_rescaled_params")
          and linear._has_rescaled_params
      ):
          raise RuntimeError(
              "`rescale_linear_bias` has been called once before already. Unless you know what you are doing, usually you should not be calling `rescale_linear_bias` more than once.\n"
              "If you called `set_base_shapes` on a model loaded from a checkpoint, or just want to re-set the base shapes of an existing model, make sure to set the flag `rescale_params=False`.\n"
              "To bypass this error and *still rescale biases*, set `linear._has_rescaled_params=False` before this call."
          )
      if linear.bias is None:
          return
      fanin_mult = linear.weight.infshape[1].width_mult()
      linear.bias.data *= fanin_mult**0.5
      linear._has_rescaled_params = True
  
file_path: NeMo/nemo/collections/nlp/modules/common/megatron/mup/layer.py
imports: import torch
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.utils import parallel_lm_logits
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: rescale_linear_bias(linear) without return types