Skip to content

fix test_compare_unprocessed_logit_scores#39053

Merged
ydshieh merged 1 commit into
mainfrom
fix_test_compare_unprocessed_logit_scores
Jun 26, 2025
Merged

fix test_compare_unprocessed_logit_scores#39053
ydshieh merged 1 commit into
mainfrom
fix_test_compare_unprocessed_logit_scores

Conversation

@ydshieh

@ydshieh ydshieh commented Jun 26, 2025

Copy link
Copy Markdown
Collaborator

What does this PR do?

With #39016, this test

tests/generation/test_utils.py::GenerationIntegrationTests::test_compare_unprocessed_logit_scores

is failing.

However, the difference is in the range of 1e-7

(Pdb) torch.amax(torch.abs(logits_fwd - logits_gen))
tensor(5.9605e-08, device='cuda:0')

The test was using assertListEqual which is not good for float numbers.

@ydshieh ydshieh requested a review from zucchini-nlp June 26, 2025 09:57
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@ydshieh ydshieh requested a review from vasqu June 26, 2025 16:02

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thx :)

@ydshieh ydshieh merged commit 23b7e73 into main Jun 26, 2025
21 checks passed
@ydshieh ydshieh deleted the fix_test_compare_unprocessed_logit_scores branch June 26, 2025 16:36
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
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