-
Notifications
You must be signed in to change notification settings - Fork 31.5k
Fix a bunch of slow tests #8634
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
Conversation
sgugger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Just so I know, who is responsible for the big MODIFY in the test_modeling_tf_dpr file?
|
Good for me - thanks a lot for taking care of it! It would probably all save us a lot of time to find once and for all a good solution for the @sgugger - not sure where the |
|
@patrickvonplaten I tried but then test failed ;-) |
Hmm maybe @lhoestq has an idea |
|
The test_modeling_dpr was added recently in #8203 Also I'm ok with adding token_type_ids since it's a common additional input to models based on bert |
|
Hi guys, first of all I apologize if there's a problem at the I translated It's my first time to write this kind of test file here, so I apologize again if I made something wrong! |
| """ | ||
|
|
||
| pooler_output: tf.Tensor | ||
| pooler_output: tf.Tensor = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LysandreJik @sgugger - for some reason, these outputs need to be initialized with something or else our much-loved tests test_compile_tf_model and test_saved_model_with_... fail. Tbh, I don't know why this is - seems to be some weird tf graph problem with positional arguments...-> @sgugger is this fine for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I remember that now. Had to do the same for all tf ModelOutput. This is fine indeed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! :-)
| type_vocab_size=self.type_vocab_size, | ||
| is_decoder=False, | ||
| initializer_range=self.initializer_range, | ||
| # MODIFY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted all those #MODIFY statements at the cost of having to initialize the pooler_output = None as explained in the other comment
Absolutely no problem! I should have been more careful when reviewing your PR -> don't worry at all :-) If you run into similar problems with TF compilation/ TF graph tests when integrating TFRAG, you can just point it out to us. It's more important to have TFRag fully work in eager mode in the beginning and then we are more then happy to help you out if you encounter problems with graph mode / compilation |
|
Thanks again for your kind help @patrickvonplaten !! When submitting PR I will make sure to list everything to you guys :) |
|
Thanks for your reviews/comments/fixes! |
This PR fixes a bunch of slow tests.
DPR had a few issues, which this PR fixes. There was an issue where the
DPRReaderobject was not usingtoken_type_ids, but for some unknown reason the interaction with the underlyingTFBertMainLayerthat requires those crashed when using the oh-so-terrifyingtf.saved_model.save.I chose to add the
token_type_idsto that model, as imo an additional feature is not a bad idea, even if it wasn't in the original model. I can imagine a bunch of reasons why users might want to havetoken_type_idsin that model even though it doesn't exist now.All in all, after an hour of debugging I feel that this is the only way to have the slow
tf.saved_model.savetest passing on TFDPR. @patrickvonplaten @lhoestq please tell me what you think.