code: def test_single_expert(
      n_tokens: int, in_neurons: int, out_neurons: int
  ) -> None:
      """
      Validate that the GEMM kernel produces identical results for a single GEMM instance.
      """
      device = get_accelerator().current_device()
  
      activations = (
          torch.rand(
              (n_tokens, in_neurons), device=device, dtype=torch.float16
          )
          - 0.5
      )
      weights = (
          torch.rand(
              (1, in_neurons, out_neurons),
              device=device,
              dtype=torch.float16,
          )
          - 0.5
      )
      biases = torch.randn(
          (1, out_neurons), device=device, dtype=torch.float16
      )
  
      weights_ref = weights.reshape(in_neurons, out_neurons)
      biases_ref = biases.reshape(out_neurons)
      ref_output = torch.matmul(activations, weights_ref) + biases_ref
  
      moe_gemm = MoEGEMM(DtypeEnum.fp16, ActivationType.IDENTITY)
      output = torch.empty(
          (n_tokens, out_neurons), device=device, dtype=torch.float16
      )
      cumsum_rows = torch.tensor(
          [n_tokens], dtype=torch.int64, device=device
      )
  
      moe_gemm(output, activations, weights, cumsum_rows, biases)
      assert allclose(output, ref_output, tolerances=(1e-2, 1e-2))
      get_accelerator().synchronize()
  
file_path: deepspeed/tests/unit/inference/v2/kernels/cutlass_ops/test_moe_gemm.py
imports: import pytest
  import torch
  from deepspeed.accelerator import get_accelerator
  from deepspeed.inference.v2.inference_utils import ActivationType, DtypeEnum
  from deepspeed.inference.v2.kernels.cutlass_ops import MoEGEMM
  from ....v2.inference_test_utils import allclose
label_desc: Use image node_id 1 for calling a global function with example usage: test_single_expert(n_tokens, in_neurons, out_neurons) without return types