code: def forward(
      ctx,
      inp,
      models,
      pos_s,
      pos_g,
      local_expert_count,
      global_expert_count,
      stored_models,
      fwd_batch_size,
      out_batch_size,
      world_size,
  ):
      local_input_buf = _local_scatter(inp, pos_s)
  
      model_params = [
          [tuple(m.parameters()) for m in node] for node in models
      ]
      local_output_buf, gib, gmb, gob = fmoe_cuda.fused_forward(
          local_input_buf,
          model_params,
          local_expert_count,
          global_expert_count,
          stored_models,
          fwd_batch_size,
          world_size,
          False,
      )
  
      out = _local_gather(
          local_output_buf, pos_g, out_batch_size, maybe_overlap=False
      )
  
      variables = (
          pos_s,
          pos_g,
          local_expert_count,
          global_expert_count,
          gib,
          gmb,
          gob,
          stored_models,
          local_input_buf,
      )
  
      ctx.moe_args = (
          fwd_batch_size,
          inp.shape[0],
          world_size,
          model_params,
      )
      ctx.save_for_backward(*variables)
  
      return out
  
file_path: thu-pacman-faster-moe/fmoe/fused_functions.py
imports: import torch
  from torch.autograd import Function
  import fmoe_cuda
  from .utils import get_torch_default_comm
  from .functions import _local_scatter, _local_gather
label_desc: Use image node_id 1 for calling the MOEForward obj's underlying member method code with example usage: obj.forward(ctx, inp, models, pos_s, pos_g, local_expert_count, global_expert_count, stored_models, fwd_batch_size, out_batch_size, world_size) and returns: out