-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot specify config and attn_implementation simultaneously #28038
Comments
hi @hiyouga import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM
model_id = "tiiuae/falcon-7b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
attn_implementation="flash_attention_2",
) It is also not recommended to enable FA2 through the config directly. However you can enable FA2 by passing |
Thanks for replying! |
Hi @xingniandage Could you open a new issue, including information about the running env and a minimal reproducer? |
|
System Info
transformers
version: 4.36.1Who can help?
@ArthurZucker @younesbelkada
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
What should I do if I want to specify both of them?
Besides, it cannot enable FA2 by modifying the model config with
config.attn_implementation=flash_attention_2
.However, it works if I pass a deprecated parameter
use_flash_attention_2
when theconfig
is also specified.The text was updated successfully, but these errors were encountered: