code: def _flash_attn_backward(
      dout,
      q,
      k,
      v,
      out,
      softmax_lse,
      dq,
      dk,
      dv,
      dropout_p,
      softmax_scale,
      causal,
      window_size,
      rng_state=None,
  ):
      maybe_contiguous = (
          lambda x: x.contiguous() if x.stride(-1) != 1 else x
      )
      # dq, dk, dv are allocated by us so they should already be contiguous
      dout, q, k, v, out = [
          maybe_contiguous(x) for x in (dout, q, k, v, out)
      ]
      (
          dq,
          dk,
          dv,
          softmax_d,
      ) = flash_attn_cuda.bwd(
          dout,
          q,
          k,
          v,
          out,
          softmax_lse,
          dq,
          dk,
          dv,
          dropout_p,
          softmax_scale,
          causal,
          window_size[0],
          window_size[1],
          None,
          rng_state,
      )
      return dq, dk, dv, softmax_d
  
imports: from typing import Optional, Union
  import torch
  import torch.nn
  import flash_attn_2_cuda
label_desc: Use image node_id 4 for calling a global function with example usage: _flash_attn_backward(dout, q, k, v, out, softmax_lse, dq, dk, dv, dropout_p, softmax_scale, causal, window_size, rng_state) and returns: dq,  dk,  dv,  softmax_d