class_docstr: Custom multipack implementation w flash attention 2
class_docstr_tok: ["Custom","multipack","implementation","w","flash","attention","2"]
code: def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)
      self._flash_attn_uses_top_left_mask = True
  
file_path: axolotl/src/axolotl/monkeypatch/mixtral/modeling_mixtral.py
imports: import logging
  import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from einops import rearrange
  from flash_attn import flash_attn_varlen_qkvpacked_func
  from transformers import Cache, DynamicCache
  from transformers.modeling_attn_mask_utils import _prepare_4d_causal_attention_mask
  from transformers.modeling_outputs import MoeModelOutputWithPast
  from transformers.models.mixtral.modeling_mixtral import MixtralFlashAttention2, apply_rotary_pos_emb, repeat_kv
  from axolotl.monkeypatch.utils import get_cu_seqlens_from_pos_ids
label_desc: Use image node_id 1 to create a new MixtralMultipackFlashAttention2 object from inherited base classes: MixtralFlashAttention2 with example: obj = MixtralMultipackFlashAttention2()