class_docstr: Linear DSModule based on BLAS library and standalone bias + activation kernel implementation.
class_docstr_tok: ["Linear","DSModule","based","on","BLAS","library","and","standalone","bias","+","activation","kernel","implementation","."]
code: def supports_config(config: DSLinearConfig) -> bool:
      if config.input_dtype != config.output_dtype:
          return False
  
      if (
          config.input_dtype != torch.float16
          and config.input_dtype != torch.bfloat16
      ):
          return False
  
      if is_gated(config.activation):
          try:
              _ = CUDAGatedActivation(
                  config.out_channels,
                  config.output_dtype,
                  config.activation,
              )
          except ValueError:
              return False
      else:
          try:
              _ = CUDABiasActivation(
                  config.out_channels,
                  config.output_dtype,
                  config.activation,
              )
          except ValueError:
              return False
  
      return True
  
file_path: DeepSpeed/deepspeed/inference/v2/modules/implementations/linear/blas_fp_linear.py
imports: from typing import Any, Dict, Optional
  import torch
  from deepspeed.accelerator import get_accelerator
  from ....allocator import empty_from
  from ....inference_utils import is_gated
  from ....kernels.core_ops import BlasLibLinear, CUDABiasActivation, CUDAGatedActivation
  from ...interfaces import DSLinearBase, DSLinearRegistry
  from ...configs import DSLinearConfig
  from ....inference_parameter import InferenceParameter
label_desc: Use image node_id 2 for calling the BlasFPLinear obj's underlying member method code with example usage: obj.supports_config(config) and returns: True, False, False, False, False