code: def _layer_norm_backward_dw_db_partial(
      dy_ptr,
      x_ptr,
      x_invstd_ptr,
      x_mean_ptr,
      dw_partial_buf_ptr,
      db_partial_buf_ptr,
      M: tl.constexpr,
      N: tl.constexpr,
      BUF_N_STRIDE: tl.constexpr,
      N_BLOCK: tl.constexpr,
      M_PARTIAL_REDUCE: tl.constexpr,
  ):
      m_idx = (
          tl.program_id(0) * M_PARTIAL_REDUCE
          + tl.arange(0, M_PARTIAL_REDUCE)
      )[:, None]
      m_mask = m_idx < M
      n_idx = tl.program_id(1) * N_BLOCK + tl.arange(0, N_BLOCK)
      n_mask = n_idx < N
      idx = N * m_idx + n_idx[None, :]
      mask = m_mask & n_mask[None, :]
      x = tl.load(x_ptr + idx, mask, other=0).to(tl.float32)
      x_mean = tl.load(x_mean_ptr + m_idx, m_mask, other=0).to(
          tl.float32
      )
      x_invstd = tl.load(x_invstd_ptr + m_idx, m_mask, other=0).to(
          tl.float32
      )
      x_hat = (x - x_mean) * x_invstd
      dy = tl.load(dy_ptr + idx, mask, other=0).to(tl.float32)
      dw_partial = tl.sum(dy * x_hat, axis=0)
      db_partial = tl.sum(dy, axis=0)
      tl.store(
          dw_partial_buf_ptr + BUF_N_STRIDE * n_idx + tl.program_id(0),
          dw_partial,
          n_mask,
      )
      tl.store(
          db_partial_buf_ptr + BUF_N_STRIDE * n_idx + tl.program_id(0),
          db_partial,
          n_mask,
      )
  
file_path: apex/apex/contrib/openfold_triton/_layer_norm_backward_kernels.py
imports: import torch
  import triton
  import triton.language
  from triton import Config
label_desc: Use image node_id 2 for calling a global function with example usage: _layer_norm_backward_dw_db_partial(dy_ptr, x_ptr, x_invstd_ptr, x_mean_ptr, dw_partial_buf_ptr, db_partial_buf_ptr, M, N, BUF_N_STRIDE, N_BLOCK, M_PARTIAL_REDUCE) without return types