Skip to content

Conversation

@SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Dec 30, 2025

Stack from ghstack (oldest at bottom):

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an are_node_inputs_supported_fn callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.

Differential Revision: D89935219

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.

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

[ghstack-poisoned]
SS-JIA pushed a commit that referenced this pull request Dec 30, 2025
Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.

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

ghstack-source-id: 331442243
Pull Request resolved: #16420
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 30, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16420

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 2 New Failures, 1 Unrelated Failure

As of commit 45f8fa9 with merge base c730feb (image):

NEW FAILURES - The following jobs have failed:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 30, 2025
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

…rs only"

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.

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

[ghstack-poisoned]
SS-JIA pushed a commit that referenced this pull request Dec 30, 2025
Pull Request resolved: #16420

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.
ghstack-source-id: 331443282
@exported-using-ghexport

Differential Revision: [D89935219](https://our.internmc.facebook.com/intern/diff/D89935219/)
…rs only"

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.

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

[ghstack-poisoned]
SS-JIA pushed a commit that referenced this pull request Jan 5, 2026
Pull Request resolved: #16420

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.
ghstack-source-id: 331888750
@exported-using-ghexport

Differential Revision: [D89935219](https://our.internmc.facebook.com/intern/diff/D89935219/)
…rs only"

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.

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

[ghstack-poisoned]
SS-JIA pushed a commit that referenced this pull request Jan 5, 2026
Pull Request resolved: #16420

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.
ghstack-source-id: 331914753
@exported-using-ghexport

Differential Revision: [D89935219](https://our.internmc.facebook.com/intern/diff/D89935219/)
…rs only"

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.

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

[ghstack-poisoned]
SS-JIA pushed a commit that referenced this pull request Jan 5, 2026
Pull Request resolved: #16420

Batch normalization is typically used with 4D tensors (batch, channels, height, width) in convolutional neural networks. This change adds input validation to ensure batch norm is only lowered to the Vulkan backend when the input tensor is 4-dimensional. For other input shapes, the operator will fall back to other backends.

The implementation follows the same pattern as the convolution operator, using an `are_node_inputs_supported_fn` callback to validate input shapes during graph partitioning. This prevents potential issues with batch norm on unsupported tensor shapes and makes the operator requirements explicit.
ghstack-source-id: 331920708
@exported-using-ghexport

Differential Revision: [D89935219](https://our.internmc.facebook.com/intern/diff/D89935219/)
@SS-JIA
Copy link
Contributor Author

SS-JIA commented Jan 5, 2026

Addressed comments cc: @mergennachin

  • Applied suggested code changes
  • Added test case

sample_inputs,
)

def test_vulkan_backend_batch_norm_after_linear(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a positive case or negative case?

why not add both tests?

@meta-codesync meta-codesync bot merged commit 91cd545 into gh/SS-JIA/391/base Jan 5, 2026
161 of 166 checks passed
@meta-codesync meta-codesync bot deleted the gh/SS-JIA/391/head branch January 5, 2026 21:11
@meta-codesync meta-codesync bot temporarily deployed to cherry-pick-bot January 5, 2026 21:11 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants