class_docstr: Self attention implementation for dense, blocked self attention.
class_docstr_tok: ["Self","attention","implementation","for","dense",",","blocked","self","attention","."]
code: def supports_config(config: DSSelfAttentionConfig) -> bool:
      if config.input_dtype != config.output_dtype:
          return False
  
      if DtypeEnum(config.input_dtype) not in (
          DtypeEnum.fp16,
          DtypeEnum.bf16,
      ):
          return False
  
      if PositionalEmbeddingType(
          config.positional_embedding_type
      ) not in [
          PositionalEmbeddingType.none,
          PositionalEmbeddingType.rotate_half,
      ]:
          return False
  
      if MaskingType(config.masking_type) != MaskingType.causal:
          return False
  
      return True
  
file_path: deepspeed/deepspeed/inference/v2/modules/implementations/attention/dense_blocked_attention.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 DtypeEnum
  from ....kernels.ragged_ops import AtomBuilder, BlockedFlashAttn, BlockedRotaryEmbeddings, BlockedTrainedRotaryEmbeddings, get_q_block_size, get_kv_block_size, LinearBlockedKVCopy
  from ....ragged import RaggedBatchWrapper, split_kv
  from deepspeed.ops.op_builder import RaggedUtilsBuilder
  from ...interfaces import DSSelfAttentionBase, DSSelfAttentionRegistry
  from ...configs import DSSelfAttentionConfig, PositionalEmbeddingType, MaskingType
label_desc: Use image node_id 2 for calling the DSDenseBlockedAttention obj's underlying member method code with example usage: obj.supports_config(config) and returns: True, False, False, False, False