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 assertAlmostEqual in BloomEmbeddingTest.test_logits #19200

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Sep 26, 2022

What does this PR do?

BloomEmbeddingTest.test_logits currently uses assertEqual to compare 2 floats. We should instead use assertAlmostEqual.

Currently we don't see this test failing. However, with different PyTorch versions, we might get test failure - this happens for Past CI (PyTroch 1.10), where we got

AssertionError: 1.9311904907226562e-05 != 1.9431114196777344e-05

@ydshieh ydshieh changed the title Use assertAlmostEqual Use assertAlmostEqual in BloomEmbeddingTest.test_logits Sep 26, 2022
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 26, 2022

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.

Thanks for fixing!

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

LGTM ! Thank you very much for taking care of the test consistency!

@ydshieh ydshieh merged commit ea75e9f into main Sep 26, 2022
@ydshieh ydshieh deleted the avoid_assertequal_in_bloom_test branch September 26, 2022 12:56
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.

4 participants