Skip to content
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

ORPOTrainer fails with flash-attention2 #1477

Closed
alvarobartt opened this issue Mar 24, 2024 · 0 comments · Fixed by #1478
Closed

ORPOTrainer fails with flash-attention2 #1477

alvarobartt opened this issue Mar 24, 2024 · 0 comments · Fixed by #1478

Comments

@alvarobartt
Copy link
Member

Description

The ORPOTrainer fails when training using attn_implementation="flash_attention_2", since the cache is being used, and falls back to the default configuration i.e. padding_side="right" for the tokenizer in this case.

Bug in code

Missing use_cache=False to prevent the model from using the cache, to avoid issues with Flash Attention 2.

outputs = model(
concatenated_batch["concatenated_input_ids"],
attention_mask=concatenated_batch["concatenated_attention_mask"],
**model_kwargs,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant