code: def test_layer_norm_residual_store_pre_ln_res(
      batch, seq_len, channels, dtype
  ):
      vals = torch.randn(
          (batch, seq_len, channels),
          dtype=dtype,
          device=get_accelerator().current_device_name(),
      )
      residual = torch.randn(
          (batch, seq_len, channels),
          dtype=dtype,
          device=get_accelerator().current_device_name(),
      )
      bias = torch.randn(
          (channels),
          dtype=dtype,
          device=get_accelerator().current_device_name(),
      )
      gamma = torch.randn(
          (channels),
          dtype=dtype,
          device=get_accelerator().current_device_name(),
      )
      beta = torch.rand(
          (channels),
          dtype=dtype,
          device=get_accelerator().current_device_name(),
      )
      epsilon = 1e-5
  
      # Need to run the reference first since there's an in-place component to ours
      (
          ref_norm_output,
          norm_res_output,
      ) = residual_store_ref_implementation(
          vals, bias, residual, gamma, beta, epsilon, channels, dtype
      )
  
      ds_norm_output, ds_res_output = residual_store_ds_implementation(
          vals, bias, residual, gamma, beta, epsilon
      )
  
      assert allclose(ds_res_output, norm_res_output)
      assert allclose(ds_norm_output, ref_norm_output)
  
file_path: deepspeed/tests/unit/ops/transformer/inference/test_layer_norm.py
imports: import deepspeed
  import torch
  import pytest
  from deepspeed.accelerator import get_accelerator
  from deepspeed.ops.op_builder import InferenceBuilder
  from .inference_test_utils import allclose, get_dtypes, assert_almost_equal
label_desc: Use image node_id 11 for calling a global function with example usage: test_layer_norm_residual_store_pre_ln_res(batch, seq_len, channels, dtype) without return types