-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[vulkan] max_pool2d #41379
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
[vulkan] max_pool2d #41379
Conversation
[ghstack-poisoned]
[ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit f1083fc (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 25 times. |
[ghstack-poisoned]
Differential Revision: [D22754944](https://our.internmc.facebook.com/intern/diff/D22754944) [ghstack-poisoned]
Differential Revision: [D22754944](https://our.internmc.facebook.com/intern/diff/D22754944) [ghstack-poisoned]
Differential Revision: [D22754944](https://our.internmc.facebook.com/intern/diff/D22754944) [ghstack-poisoned]
Differential Revision: [D22754944](https://our.internmc.facebook.com/intern/diff/D22754944) [ghstack-poisoned]
Differential Revision: [D22754944](https://our.internmc.facebook.com/intern/diff/D22754944) [ghstack-poisoned]
Differential Revision: [D22754944](https://our.internmc.facebook.com/intern/diff/D22754944) [ghstack-poisoned]
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.
Suggestion: more rigorous const-correctness including shaders.
TORCH_CHECK( | ||
kernel_size.size() == 1 || kernel_size.size() == 2, | ||
"Vulkan max_pool2d: kernel_size must either be a single int, or a tuple of two ints") | ||
const int kH = safe_downcast<int, int64_t>(kernel_size[0]); |
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.
This usage is technically correct but template argument deduction can deduce the second template parameter (i.e. source type) passed as a function argument, so this will work as well:
const int kH = safe_downcast<int>(kernel_size[0]);
self.dim() == 4, "Vulkan max_pool2d is implemented for 4-dim input"); | ||
|
||
const auto& x = vtensor_from_vulkan(self); | ||
auto inputSize = self.sizes(); |
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 this const? If so auto does not imply const.
uConstBlock; | ||
|
||
#define UP_DIV(x, y) (((x) + (y)-1) / (y)) | ||
#define FLT_MAX 3.402823466e+38 |
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.
If these are used in other shaders please consider moving to a common location.
Differential Revision: [D22754944](https://our.internmc.facebook.com/intern/diff/D22754944) [ghstack-poisoned]
Differential Revision: [D22754944](https://our.internmc.facebook.com/intern/diff/D22754944) [ghstack-poisoned]
@IvanKobzarev merged this pull request in b852168. |
Stack from ghstack:
Differential Revision: D22754944