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

use _make_causal_mask in clip/vit models #23942

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

kashif
Copy link
Contributor

@kashif kashif commented Jun 1, 2023

What does this PR do?

Uses the _make_causal_mask helper to build the causal attention mask which works for bfloat16 dtype.

the current _build_causal_attention_mask uses the torch.triu_ which is not supported in pytorch release fixed recently in main: pytorch/pytorch#101414

should fix huggingface/diffusers#3453

@kashif kashif changed the title use _make_causal_mask in clip based models use _make_causal_mask in clip/vit models Jun 1, 2023
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 1, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also have a second look @amyeroberts please?
Thanks!

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for fixing!

@sgugger sgugger merged commit c62b01d into huggingface:main Jun 1, 2023
17 of 19 checks passed
@kashif kashif deleted the causal-mask-bfloat16 branch June 1, 2023 20:11
gojiteji pushed a commit to gojiteji/transformers that referenced this pull request Jun 5, 2023
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
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 this pull request may close these issues.

train_text_to_image.py | RuntimeError: "triu_tril_cuda_template" not implemented for 'BFloat16'
4 participants