- 
                Notifications
    You must be signed in to change notification settings 
- Fork 31k
device agnostic models testing #27146
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
device agnostic models testing #27146
Conversation
| Thanks for opening this PR @statelesshz ! Let us know when you'd like a review | 
fa43b77    to
    28aef47      
    Compare
  
    28aef47    to
    9d37036      
    Compare
  
    9d37036    to
    e94cc76      
    Compare
  
    | Due to network issue, it's not easy to download the model weights on huggingface hub from my area, so I take   | 
| Marking this ready for review :-) @ydshieh and @amyeroberts | 
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.
Another great PR - thank you!
Happy to merge once @ydshieh gives his 👍
| model = self.all_generative_model_classes[0](config).eval().to(torch_device) | ||
| if torch_device == "cuda": | ||
| model.half() | ||
| model.half() | 
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.
So much cleaner 🤩
| @slow | ||
| @require_torch_gpu | ||
| @require_torch_accelerator | ||
| @require_torch_fp16 | 
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.
why fp16 here?
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.
Oops, the fp16 decorator was misused here. Thanks for pointing it out
| Nice to know bert works well on NPU! | 
| Thank you @statelesshz the king of NPU! | 
| The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. | 
* device agnostic models testing * add decorator `require_torch_fp16` * make style * apply review suggestion * Oops, the fp16 decorator was misused
What does this PR do?
Part of #25654 (comment)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.