Skip to content

Comments

[ET-VK] Add fused q8ta_relu unary operator for int8x4 tensors#17507

Merged
meta-codesync[bot] merged 3 commits intogh/SS-JIA/435/basefrom
gh/SS-JIA/435/head
Feb 20, 2026
Merged

[ET-VK] Add fused q8ta_relu unary operator for int8x4 tensors#17507
meta-codesync[bot] merged 3 commits intogh/SS-JIA/435/basefrom
gh/SS-JIA/435/head

Conversation

@SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Feb 17, 2026

Stack from ghstack (oldest at bottom):

This adds a fused quantized unary operator (ReLU) that operates directly on int8x4 packed buffer tensors, avoiding the overhead of separate dequantize-relu-requantize dispatches.

The implementation follows the same pattern as q8ta_binary: a single GLSL compute shader dequantizes int8x4 blocks to float, applies the unary operation, and requantizes back to int8x4 in one dispatch. The shader uses the OPERATOR macro for parameterization so additional unary ops can be added as YAML variants without new shader code.

Components added:

  • GLSL shader (q8ta_unary.glsl) and YAML config with relu variant
  • C++ operator implementation (Q8taUnary.cpp/h) registering et_vk.q8ta_relu.default
  • Export graph fusion pattern (quantized_unary.py) that detects dequant->relu->quant sequences and replaces them with the fused op
  • Custom op definition (q8ta_relu in custom_ops_lib.py) for the export pipeline
  • Test harness (TestQ8taUnary.cpp, test_q8ta_unary.cpp) with reference implementation and coverage across multiple shapes and quantized layouts

This diff was authored with Claude.

Differential Revision: D93511629

This adds a fused quantized unary operator (ReLU) that operates directly on int8x4 packed buffer tensors, avoiding the overhead of separate dequantize-relu-requantize dispatches.

The implementation follows the same pattern as q8ta_binary: a single GLSL compute shader dequantizes int8x4 blocks to float, applies the unary operation, and requantizes back to int8x4 in one dispatch. The shader uses the OPERATOR macro for parameterization so additional unary ops can be added as YAML variants without new shader code.

Components added:
- GLSL shader (q8ta_unary.glsl) and YAML config with relu variant
- C++ operator implementation (Q8taUnary.cpp/h) registering et_vk.q8ta_relu.default
- Export graph fusion pattern (quantized_unary.py) that detects dequant->relu->quant sequences and replaces them with the fused op
- Custom op definition (q8ta_relu in custom_ops_lib.py) for the export pipeline
- Test harness (TestQ8taUnary.cpp, test_q8ta_unary.cpp) with reference implementation and coverage across multiple shapes and quantized layouts

This diff was authored with Claude.

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

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 17, 2026

🔗 Helpful Links

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

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

❌ 4 New Failures, 1 Unrelated Failure

As of commit 9189369 with merge base 7b843e4 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@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.

ssjia and others added 2 commits February 18, 2026 13:02
…ors"

This adds a fused quantized unary operator (ReLU) that operates directly on int8x4 packed buffer tensors, avoiding the overhead of separate dequantize-relu-requantize dispatches.

The implementation follows the same pattern as q8ta_binary: a single GLSL compute shader dequantizes int8x4 blocks to float, applies the unary operation, and requantizes back to int8x4 in one dispatch. The shader uses the OPERATOR macro for parameterization so additional unary ops can be added as YAML variants without new shader code.

Components added:
- GLSL shader (q8ta_unary.glsl) and YAML config with relu variant
- C++ operator implementation (Q8taUnary.cpp/h) registering et_vk.q8ta_relu.default
- Export graph fusion pattern (quantized_unary.py) that detects dequant->relu->quant sequences and replaces them with the fused op
- Custom op definition (q8ta_relu in custom_ops_lib.py) for the export pipeline
- Test harness (TestQ8taUnary.cpp, test_q8ta_unary.cpp) with reference implementation and coverage across multiple shapes and quantized layouts

This diff was authored with Claude.

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

[ghstack-poisoned]
…ors"

This adds a fused quantized unary operator (ReLU) that operates directly on int8x4 packed buffer tensors, avoiding the overhead of separate dequantize-relu-requantize dispatches.

The implementation follows the same pattern as q8ta_binary: a single GLSL compute shader dequantizes int8x4 blocks to float, applies the unary operation, and requantizes back to int8x4 in one dispatch. The shader uses the OPERATOR macro for parameterization so additional unary ops can be added as YAML variants without new shader code.

Components added:
- GLSL shader (q8ta_unary.glsl) and YAML config with relu variant
- C++ operator implementation (Q8taUnary.cpp/h) registering et_vk.q8ta_relu.default
- Export graph fusion pattern (quantized_unary.py) that detects dequant->relu->quant sequences and replaces them with the fused op
- Custom op definition (q8ta_relu in custom_ops_lib.py) for the export pipeline
- Test harness (TestQ8taUnary.cpp, test_q8ta_unary.cpp) with reference implementation and coverage across multiple shapes and quantized layouts

This diff was authored with Claude.

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

[ghstack-poisoned]
@meta-codesync meta-codesync bot merged commit 7bf092c into gh/SS-JIA/435/base Feb 20, 2026
185 of 192 checks passed
@meta-codesync meta-codesync bot deleted the gh/SS-JIA/435/head branch February 20, 2026 01:13
SS-JIA pushed a commit that referenced this pull request Feb 20, 2026
Pull Request resolved: #17507

This adds a fused quantized unary operator (ReLU) that operates directly on int8x4 packed buffer tensors, avoiding the overhead of separate dequantize-relu-requantize dispatches.

The implementation follows the same pattern as q8ta_binary: a single GLSL compute shader dequantizes int8x4 blocks to float, applies the unary operation, and requantizes back to int8x4 in one dispatch. The shader uses the OPERATOR macro for parameterization so additional unary ops can be added as YAML variants without new shader code.

Components added:
- GLSL shader (q8ta_unary.glsl) and YAML config with relu variant
- C++ operator implementation (Q8taUnary.cpp/h) registering et_vk.q8ta_relu.default
- Export graph fusion pattern (quantized_unary.py) that detects dequant->relu->quant sequences and replaces them with the fused op
- Custom op definition (q8ta_relu in custom_ops_lib.py) for the export pipeline
- Test harness (TestQ8taUnary.cpp, test_q8ta_unary.cpp) with reference implementation and coverage across multiple shapes and quantized layouts

This diff was authored with Claude.
ghstack-source-id: 342806073
@exported-using-ghexport

Differential Revision: [D93511629](https://our.internmc.facebook.com/intern/diff/D93511629/)
SS-JIA pushed a commit that referenced this pull request Feb 20, 2026
Pull Request resolved: #17507

This adds a fused quantized unary operator (ReLU) that operates directly on int8x4 packed buffer tensors, avoiding the overhead of separate dequantize-relu-requantize dispatches.

The implementation follows the same pattern as q8ta_binary: a single GLSL compute shader dequantizes int8x4 blocks to float, applies the unary operation, and requantizes back to int8x4 in one dispatch. The shader uses the OPERATOR macro for parameterization so additional unary ops can be added as YAML variants without new shader code.

Components added:
- GLSL shader (q8ta_unary.glsl) and YAML config with relu variant
- C++ operator implementation (Q8taUnary.cpp/h) registering et_vk.q8ta_relu.default
- Export graph fusion pattern (quantized_unary.py) that detects dequant->relu->quant sequences and replaces them with the fused op
- Custom op definition (q8ta_relu in custom_ops_lib.py) for the export pipeline
- Test harness (TestQ8taUnary.cpp, test_q8ta_unary.cpp) with reference implementation and coverage across multiple shapes and quantized layouts

This diff was authored with Claude.
ghstack-source-id: 342806073
@exported-using-ghexport

Differential Revision: [D93511629](https://our.internmc.facebook.com/intern/diff/D93511629/)
SS-JIA pushed a commit that referenced this pull request Feb 20, 2026
Pull Request resolved: #17507

This adds a fused quantized unary operator (ReLU) that operates directly on int8x4 packed buffer tensors, avoiding the overhead of separate dequantize-relu-requantize dispatches.

The implementation follows the same pattern as q8ta_binary: a single GLSL compute shader dequantizes int8x4 blocks to float, applies the unary operation, and requantizes back to int8x4 in one dispatch. The shader uses the OPERATOR macro for parameterization so additional unary ops can be added as YAML variants without new shader code.

Components added:
- GLSL shader (q8ta_unary.glsl) and YAML config with relu variant
- C++ operator implementation (Q8taUnary.cpp/h) registering et_vk.q8ta_relu.default
- Export graph fusion pattern (quantized_unary.py) that detects dequant->relu->quant sequences and replaces them with the fused op
- Custom op definition (q8ta_relu in custom_ops_lib.py) for the export pipeline
- Test harness (TestQ8taUnary.cpp, test_q8ta_unary.cpp) with reference implementation and coverage across multiple shapes and quantized layouts

This diff was authored with Claude.
ghstack-source-id: 342806073
@exported-using-ghexport

Differential Revision: [D93511629](https://our.internmc.facebook.com/intern/diff/D93511629/)
SS-JIA pushed a commit that referenced this pull request Feb 20, 2026
Pull Request resolved: #17507

This adds a fused quantized unary operator (ReLU) that operates directly on int8x4 packed buffer tensors, avoiding the overhead of separate dequantize-relu-requantize dispatches.

The implementation follows the same pattern as q8ta_binary: a single GLSL compute shader dequantizes int8x4 blocks to float, applies the unary operation, and requantizes back to int8x4 in one dispatch. The shader uses the OPERATOR macro for parameterization so additional unary ops can be added as YAML variants without new shader code.

Components added:
- GLSL shader (q8ta_unary.glsl) and YAML config with relu variant
- C++ operator implementation (Q8taUnary.cpp/h) registering et_vk.q8ta_relu.default
- Export graph fusion pattern (quantized_unary.py) that detects dequant->relu->quant sequences and replaces them with the fused op
- Custom op definition (q8ta_relu in custom_ops_lib.py) for the export pipeline
- Test harness (TestQ8taUnary.cpp, test_q8ta_unary.cpp) with reference implementation and coverage across multiple shapes and quantized layouts

This diff was authored with Claude.
ghstack-source-id: 342806073
@exported-using-ghexport

Differential Revision: [D93511629](https://our.internmc.facebook.com/intern/diff/D93511629/)
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.

2 participants