-
Notifications
You must be signed in to change notification settings - Fork 486
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
Re-land: Fix model initialization. #6296
Conversation
device = "cuda" | ||
else: | ||
device = str(self.benchmark_experiment.get_device()) | ||
|
||
return benchmark_cls( |
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.
Is it possible to force bnechmark_cls to only run once so that we don't have the problem next time? Perhaps https://stackoverflow.com/questions/4103773/efficient-way-of-having-a-function-only-execute-once-in-a-loop
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.
Sure. I will do it in a follow-up PR.
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.
Thanks for fixing it!
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.
Thanks for fixing this!
Re-land: #6182 #6076
Here are the issues found with the last try:
benchmark_cls
was being incorrectly instantiated twicebenchmark_experiment.get_device()
example_inputs
was being reset after being moved to XLAAs a solution, in this PR:
benchmark_cls
is instantiated once, with the specified acceleratorself.module
andself.example_inputs
are moved to XLA in theset_up
methodI have run the benchmarks mentioned in #6182 and confirmed no regression is present.
cc @miladm @JackCaoG