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

Avoid all-zeor attnetion mask used in testing #26469

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Avoid all-zeor attnetion mask used in testing #26469

merged 1 commit into from
Sep 29, 2023

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Sep 28, 2023

What does this PR do?

The method random_attention_mask used in testing makes sure the last token is non-zero. However, this property will be changed if a causal mask is applied.

This causes some issues in CI, see issue reported

pytorch/pytorch#110213

In general, a sequence with all zero as attention mask is bad. Let's avoid testing with such case.

(However, we probably need to do some processing in the modeling code - if torch decide this is undefined behavior and won't make change to have previous behavior).

@ydshieh ydshieh requested a review from LysandreJik September 28, 2023 13:44
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 28, 2023

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

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Thaks @ydshieh!

@ydshieh ydshieh merged commit 3911774 into main Sep 29, 2023
@ydshieh ydshieh deleted the debug_flacon branch September 29, 2023 09:06
blbadger pushed a commit to blbadger/transformers that referenced this pull request Nov 8, 2023
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 18, 2023
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
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.

3 participants