-
Notifications
You must be signed in to change notification settings - Fork 254
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
Add TPU testing #591
Add TPU testing #591
Conversation
42c5673
to
6d751c5
Compare
6d751c5
to
629fe48
Compare
This will allow us to share a single tpu strategy (which it sounds like it is expensive to set up), without needing to consolidate all our TPU testing code to a single file, which could get unwieldy.
Thanks for this! I think my main piece of feedback is that we should avoid consolidating all the TPU test out of tree with the models themselves. We should keep this testing right with the rest of the model testing, so we can keep it from getting stale (and make sure people adding new models add TPU tests). From talking with you it sound like the main difficulty is that connecting to a TPU is slow and expensive, but I think we can work around this with pytest fixtures, which will allow you to do session level setup in a modular way. This is slightly awkward given that our actual tests unittest not pytest (see this doc). But think I was able to get it working. I pushed a commit to this branch switching to tests directly in the model code using a session level tpu strategy. Take a look, modify as needed! |
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. should we add tpu testing for other models, or leave that as a follow up?
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.
I like how the tests are now integrated with pytest flags! Would it add anything to do a couple of batches of model.fit
for TPU compat?
@jbischof Yes! I will make a followup PR to enrich our TPU testing's coverage. |
No description provided.