Skip to content

Commit

Permalink
[ET-VK] Minor improvements to conv2d pw and dw bounds check.
Browse files Browse the repository at this point in the history
Pull Request resolved: #7815

This diff contains minor improvements to the conv2d pw and dw bounds check in the Vulkan backend for Executorch.
ghstack-source-id: 263238731
@exported-using-ghexport

Differential Revision: [D68400689](https://our.internmc.facebook.com/intern/diff/D68400689/)

---------

Co-authored-by: Vivek Trivedi <[email protected]>
  • Loading branch information
pytorchbot and trivedivivek authored Jan 27, 2025
1 parent ea9058e commit 0076965
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backends/vulkan/runtime/graph/ops/glsl/conv2d_dw.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main() {
div_by_x % out_limits.y,
div_by_x / out_limits.y);

if (any(greaterThanEqual(pos, out_limits))) {
if (pos.z >= out_limits.z) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void main() {
pos.y *= BATCH_SIZE_Y;

// do not process if top pixel does not fit within the output range
if (any(greaterThanEqual(pos, out_limits))) {
if (pos.z >= out_limits.z) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void main() {
div_by_x % out_limits.y,
div_by_x / out_limits.y);

if (any(greaterThanEqual(pos, out_limits))) {
if (pos.z >= out_limits.z) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void main() {

// If the top left position is out of bounds, then this invocation will have
// no work to do.
if (any(greaterThanEqual(ivec3(pos[0], gpos.z), out_limits.xyz))) {
if (gpos.z >= out_limits.z) {
return;
}

Expand Down

0 comments on commit 0076965

Please sign in to comment.