code: def res_add_bias_ref(
      hidden_state,
      residual,
      attn_output,
      attn_bias,
      final_bias,
      mp_size=1,
      pre_attn_norm=True,
  ):
      if pre_attn_norm:
          hidden_state += (
              residual + final_bias + attn_output + attn_bias
          ) / mp_size
      else:
          hidden_state += residual + final_bias
      return hidden_state
  
file_path: DeepSpeed/tests/unit/ops/transformer/inference/test_residual_add.py
imports: import pytest
  import torch
  import deepspeed
  from deepspeed.accelerator import get_accelerator
  from deepspeed.ops.op_builder import InferenceBuilder
  from .inference_test_utils import get_dtypes
label_desc: Use image node_id 4 for calling a global function with example usage: res_add_bias_ref(hidden_state, residual, attn_output, attn_bias, final_bias, mp_size, pre_attn_norm) and returns: hidden_state