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 __init__(
      self,
      config: DSLinearConfig,
      implementation_config: Dict[str, Any],
  ) -> None:
      super().__init__(config, implementation_config)
  
      self._linear_impl = BlasLibLinear(self._config.input_dtype)
  
      if is_gated(config.activation):
          self._is_gated = True
          self._act_fn = CUDAGatedActivation(
              config.out_channels,
              config.output_dtype,
              config.activation,
          )
          self._double_buffer = torch.empty(
              (config.max_tokens, config.out_channels * 2),
              dtype=config.output_dtype,
              device=get_accelerator().current_device(),
          )
      else:
          self._is_gated = False
          self._act_fn = CUDABiasActivation(
              config.out_channels,
              config.output_dtype,
              config.activation,
          )
  
      self._output = torch.empty(
          (config.max_tokens, config.out_channels),
          dtype=config.output_dtype,
          device=get_accelerator().current_device(),
      )
  
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 3 to create a new BlasFPLinear object from inherited base classes: DSLinearBase with example: obj = BlasFPLinear(config, implementation_config)