class_docstr: Block-Sparse MatMul class; this class handles three types of matrix-multiplication:
     - sparse = dense X dense
     - dense = sparse X dense
     - dense = dense X sparse
  
  For more details about sparsity config, please see `Generative Modeling with Sparse Transformers`: https://arxiv.org/abs/1904.10509
class_docstr_tok: ["Block-Sparse","MatMul","class",";","this","class","handles","three","types","of","matrix-multiplication",":","-","sparse","=","dense","X","dense","-","dense","=","sparse","X","dense","-","dense","=","dense","X","sparse","For","more","details","about","sparsity","config",",","please","see","`","Generative","Modeling","with","Sparse","Transformers","`",":","https",":","\/\/arxiv.org\/abs\/1904.10509"]
docstr: Generates the sparsity layout/s used in block-sparse matmul
          
docstr_tok: ["Generates","the","sparsity","layout\/s","used","in","block-sparse","matmul"]
code: def make_lut(self, dtype, device):
      """Generates the sparsity layout/s used in block-sparse matmul"""
      key = (dtype, device)
      if key in self.lut_cache:
          return self.lut_cache[key]
      # C look-up table
      layout, block = self.layout, self.block
      step = 16
      if self.mode == "sdd":
          (
              c_lut,
              c_num_locks,
              c_width,
              c_packs,
          ) = _sparse_matmul.make_sdd_lut(layout, block, dtype, device)
      elif self.mode == "dsd":
          (
              c_lut,
              c_num_locks,
              c_width,
              c_packs,
          ) = _sparse_matmul.make_dxx_lut(
              layout, block, step, not self.trans_a, device
          )
      elif self.mode == "dds":
          (
              c_lut,
              c_num_locks,
              c_width,
              c_packs,
          ) = _sparse_matmul.make_dxx_lut(
              layout, block, step, self.trans_b, device
          )
      # DA look-up table
      if self.mode == "sdd":
          (
              da_lut,
              da_num_locks,
              da_width,
              da_packs,
          ) = _sparse_matmul.make_dxx_lut(
              layout, block, step, True, device
          )
      elif self.mode == "dsd":
          (
              da_lut,
              da_num_locks,
              da_width,
              da_packs,
          ) = _sparse_matmul.make_sdd_lut(layout, block, dtype, device)
      elif self.mode == "dds":
          (
              da_lut,
              da_num_locks,
              da_width,
              da_packs,
          ) = _sparse_matmul.make_dxx_lut(
              layout, block, step, not self.trans_b, device
          )
      # DB look-up table
      if self.mode == "sdd":
          (
              db_lut,
              db_num_locks,
              db_width,
              db_packs,
          ) = _sparse_matmul.make_dxx_lut(
              layout, block, step, False, device
          )
      elif self.mode == "dsd":
          (
              db_lut,
              db_num_locks,
              db_width,
              db_packs,
          ) = _sparse_matmul.make_dxx_lut(
              layout, block, step, self.trans_a, device
          )
      elif self.mode == "dds":
          (
              db_lut,
              db_num_locks,
              db_width,
              db_packs,
          ) = _sparse_matmul.make_sdd_lut(layout, block, dtype, device)
      self.lut_cache[key] = (
          c_lut,
          c_num_locks,
          c_width,
          c_packs,
          da_lut,
          da_num_locks,
          da_width,
          da_packs,
          db_lut,
          db_num_locks,
          db_width,
          db_packs,
      )
      return self.lut_cache[key]
  
imports: import importlib
  import torch
  import triton
  import triton.language
  import triton._C.libtriton
  from deepspeed.accelerator import get_accelerator
label_desc: Use image node_id 1 for calling the MatMul obj's underlying member method code with example usage: obj.make_lut(dtype, device) and returns: self, self