code: def test_fmoe_dp(
      num_expert,
      top_k,
      batch_size,
      d_model,
      d_hidden,
      activation=torch.nn.functional.gelu,
  ):
      torch.manual_seed(42)
      torch.cuda.manual_seed(42)
  
      moe = MyMoE(
          num_expert, d_model, d_hidden, top_k, activation
      ).cuda()
      moe_dp = torch.nn.DataParallel(
          moe, device_ids=list(range(n_devices))
      )
  
      for i in range(5):
          output = moe_dp(torch.rand(batch_size, d_model).cuda())
  
file_path: thu-pacman-faster-moe/tests/test_dp.py
imports: import os
  import pytest
  import torch
  from fmoe.gates import NaiveGate
  from fmoe.layers import FMoE
  from fmoe.transformer import _Expert
label_desc: Use image node_id 1 for calling a global function with example usage: test_fmoe_dp(num_expert, top_k, batch_size, d_model, d_hidden, activation) without return types