class_docstr: CUTLASS implementation of MoE GEMM.
code: def __init__(
      self, fp_dtype: DtypeEnum, act_fn: ActivationType, num_bits: int
  ) -> None:
      if not isinstance(fp_dtype, DtypeEnum):
          fp_dtype = DtypeEnum(fp_dtype)
  
      if fp_dtype not in MixedMoEGEMM.supported_dtypes:
          raise ValueError(
              "Unsupported data type: {}, supported_dtypes are {}".format(
                  fp_dtype, MixedMoEGEMM.supported_dtypes
              )
          )
  
      if act_fn not in MixedMoEGEMM.supported_act_fns:
          raise ValueError(
              "Unsupported activation function: {}, supported_act_fns are {}".format(
                  act_fn, MixedMoEGEMM.supported_act_fns
              )
          )
  
      if num_bits != 4 and num_bits != 8:
          raise ValueError(
              "Unsupported num_bits: {}, supported num_bits are 4 and 8".format(
                  num_bits
              )
          )
  
      inf_module = InferenceCutlassBuilder().load()
      self.num_bits = num_bits
      self.kernel = inf_module.moe_gemm
      self.act_fn = act_fn
  
file_path: DeepSpeed/deepspeed/inference/v2/kernels/cutlass_ops/moe_gemm/mixed_moe_gemm.py
imports: import torch
  from ...None import DSKernelBase
  from ....inference_utils import ActivationType, DtypeEnum
  from deepspeed.ops.op_builder import InferenceCutlassBuilder
  from typing import Optional
label_desc: Use image node_id 1 to create a new MixedMoEGEMM object from inherited base classes: DSKernelBase with example: obj = MixedMoEGEMM(fp_dtype, act_fn, num_bits)