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

[Tests common] Fix flaky test #6593

Merged

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Aug 19, 2020

The test test_model_outputs_equivalence fails quite often at the moment because of a problem with nan - nan. This should solve the issue.

Also added more explicit error message in case test error occurs.

Flaky error happens here for example: https://app.circleci.com/pipelines/github/huggingface/transformers/10798/workflows/44e689b2-f4b3-49be-88b3-a5b214eac6c5/jobs/75173

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.

OK for the temp fix. It might warrant some deeper investigation though.

@codecov
Copy link

codecov bot commented Aug 19, 2020

Codecov Report

Merging #6593 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6593      +/-   ##
==========================================
+ Coverage   79.42%   79.43%   +0.01%     
==========================================
  Files         156      156              
  Lines       28127    28127              
==========================================
+ Hits        22339    22343       +4     
+ Misses       5788     5784       -4     
Impacted Files Coverage Δ
src/transformers/modeling_tf_albert.py 21.47% <0.00%> (-69.44%) ⬇️
src/transformers/tokenization_roberta.py 76.71% <0.00%> (-21.92%) ⬇️
src/transformers/tokenization_utils_base.py 86.58% <0.00%> (-7.19%) ⬇️
src/transformers/tokenization_transfo_xl.py 38.73% <0.00%> (-3.76%) ⬇️
src/transformers/tokenization_utils_fast.py 92.14% <0.00%> (-2.15%) ⬇️
src/transformers/tokenization_openai.py 82.57% <0.00%> (-1.52%) ⬇️
src/transformers/tokenization_bert.py 91.07% <0.00%> (-0.45%) ⬇️
src/transformers/tokenization_utils.py 90.00% <0.00%> (-0.41%) ⬇️
src/transformers/file_utils.py 82.44% <0.00%> (+0.25%) ⬆️
src/transformers/modeling_tf_utils.py 87.29% <0.00%> (+0.97%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab42d74...d243891. Read the comment docs.

@sshleifer
Copy link
Contributor

Long term, I would rather fill nan with a sentinel value like -11.27 (my negative birthday, dont forget!) and check equality but I am also fine with the temp fix.

@patrickvonplaten
Copy link
Contributor Author

Ok pinging @LysandreJik here that we should take a look next week. Will note it down as well.

@patrickvonplaten patrickvonplaten merged commit 8bcceac into huggingface:master Aug 19, 2020
Zigur pushed a commit to Zigur/transformers that referenced this pull request Oct 26, 2020
fabiocapsouza pushed a commit to fabiocapsouza/transformers that referenced this pull request Nov 15, 2020
fabiocapsouza added a commit to fabiocapsouza/transformers that referenced this pull request Nov 15, 2020
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