code: def _rms_norm_testing_helper(
      rows: int, channels: int, do_residual: bool, dtype: DtypeEnum
  ) -> None:
      device = get_accelerator().current_device_name()
      t_dtype = dtype.value
  
      vals = torch.randn((rows, channels), dtype=t_dtype, device=device)
      gamma = torch.randn((channels), dtype=t_dtype, device=device)
      epsilon = 1e-5
  
      if do_residual:
          residual_in = torch.randn(
              (rows, channels), dtype=t_dtype, device=device
          )
          ds_residual = residual_in.clone()
  
          ref_residual, ref_output = reference_rms_pre_norm(
              vals, residual_in, gamma, epsilon
          )
  
          kernel = CUDARMSPreNorm(channels, t_dtype, epsilon=epsilon)
          ds_out = torch.empty_like(ds_residual)
  
          kernel(ds_residual, ds_out, residual_in, vals, gamma)
  
          assert allclose(ds_out, ref_output)
          assert allclose(ds_residual, ref_residual)
      else:
          ref_output = reference_rms_norm(vals, gamma, epsilon)
  
          kernel = CUDARMSNorm(channels, t_dtype, epsilon=epsilon)
          ds_out = torch.empty_like(vals)
  
          kernel(ds_out, vals, gamma)
  
          assert allclose(ds_out, ref_output)
  
file_path: deepspeed/tests/unit/inference/v2/kernels/core_ops/test_rms_norm.py
imports: import pytest
  import torch
  from deepspeed.accelerator import get_accelerator
  from deepspeed.inference.v2.inference_utils import DtypeEnum
  from deepspeed.inference.v2.kernels.core_ops import CUDARMSNorm, CUDARMSPreNorm
  from ....v2.inference_test_utils import get_dtypes, allclose
label_desc: Use image node_id 3 for calling a global function with example usage: _rms_norm_testing_helper(rows, channels, do_residual, dtype) without return types