-
Notifications
You must be signed in to change notification settings - Fork 7k
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
ROIPool + Dispatcher + Autocast + Code Cleanup #2922
Conversation
- Remove primitive const declaration from method names. - Using references when possible.
Codecov Report
@@ Coverage Diff @@
## master #2922 +/- ##
=======================================
Coverage 73.41% 73.41%
=======================================
Files 99 99
Lines 8801 8801
Branches 1389 1389
=======================================
Hits 6461 6461
Misses 1915 1915
Partials 425 425 Continue to review full report at Codecov.
|
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.
Code looks great, thanks!
Can you add some tests for autocast as well?
We have an example of it for RoIAlign in
Lines 298 to 303 in 455cd57
@unittest.skipIf(not torch.cuda.is_available(), "CUDA unavailable") | |
def test_roi_align_autocast(self): | |
for x_dtype in (torch.float, torch.half): | |
for rois_dtype in (torch.float, torch.half): | |
with torch.cuda.amp.autocast(): | |
self._test_forward(torch.device("cuda"), contiguous=False, x_dtype=x_dtype, rois_dtype=rois_dtype) |
Discussed with @datumbox offline, in order to avoid conflicts with some currently ongoing PRs he will be sending the tests in a separate 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 a lot!
* Fixing types. * Dispatcher + Autocast. * + Autograd. * Formating. * Fixing return casting with autocast. * Clean up and refactor ROIPool implementation: - Remove primitive const declaration from method names. - Using references when possible. * Restore include headers. * New line at end of file.
* Fixing types. * Dispatcher + Autocast. * + Autograd. * Formating. * Fixing return casting with autocast. * Clean up and refactor ROIPool implementation: - Remove primitive const declaration from method names. - Using references when possible. * Restore include headers. * New line at end of file.
part of #2797 and #2796
Implements Dispatcher + Autocast for ROIPool.
I'm also doing some clean up on the original code such as: