Skip to content

XLMRoberta with Flash Attention 2 #27957

Description

@IvanPy96

System Info

  • transformers version: 4.36.0
  • Platform: Linux-4.19.0-22-amd64-x86_64-with-glibc2.31
  • Python version: 3.10.13
  • Huggingface_hub version: 0.19.4
  • Safetensors version: 0.4.0
  • Accelerate version: 0.24.1
  • Accelerate config: not found
  • PyTorch version (GPU?): 2.0.1+cu117 (True)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Who can help?

@ArthurZucker @younesbelkada

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained("my_model/", attn_implementation="flash_attention_2")

Expected behavior

Ability to use flash attention 2 for inference. Is it possible to add support of flash attention 2 for XLMRoberta model?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature requestRequest for a new featureGood Second IssueIssues that are more difficult to do than "Good First" issues - give it a try if you want!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions