class_docstr: Scatter input samples from [batch x sequences] to contiguous alone experts.
  If `world_size` is greater than 1, the samples will first be locally
  scattered, and then exchanged across workers.
class_docstr_tok: ["Scatter","input","samples","from","[","batch","x","sequences","]","to","contiguous","alone","experts",".","If","`","world_size","`","is","greater","than","1",",","the","samples","will","first","be","locally","scattered",",","and","then","exchanged","across","workers","."]
code: def forward(
      ctx,
      inp,
      pos,
      local_expert_count,
      global_expert_count,
      fwd_batch_size,
      world_size,
  ):
      local_input_buf = _local_scatter(inp, pos)
      if world_size > 1:
          global_input_buf = fmoe_cuda.global_scatter(
              local_input_buf,
              local_expert_count,
              global_expert_count,
              fwd_batch_size,
              world_size,
          )
      else:
          global_input_buf = local_input_buf
      ctx.moe_args = inp.shape[0], pos.shape[0], world_size
      variables = (pos, local_expert_count, global_expert_count)
      ctx.save_for_backward(*variables)
      return global_input_buf
  
imports: import torch
  from torch.autograd import Function
  import fmoe_cuda
  from .utils import get_torch_default_comm
label_desc: Use image node_id 1 for calling the MOEScatter obj's underlying member method code with example usage: obj.forward(ctx, inp, pos, local_expert_count, global_expert_count, fwd_batch_size, world_size) and returns: global_input_buf