Skip to content

[ExecuTorch][WebGPU] Op-test harness: int8-output golden support#21189

Merged
meta-codesync[bot] merged 2 commits into
gh/JCNTH/149/basefrom
gh/JCNTH/149/head
Jul 24, 2026
Merged

[ExecuTorch][WebGPU] Op-test harness: int8-output golden support#21189
meta-codesync[bot] merged 2 commits into
gh/JCNTH/149/basefrom
gh/JCNTH/149/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (quantize_per_tensor, and the wider q8ta family) cannot be goldened — a round-trip through dequantize folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: generate_op_tests.py detects an int8 output, writes the golden as raw int8 bytes, records "dtype": "int8" in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). driver_util parses the golden dtype (default "float32", so old manifests are unchanged) and adds load_int8_bin. op_test_driver.cpp branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the within_tol path.
@exported-using-ghexport

Differential Revision: D112257633

Differential Revision: D112257633

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 46 New Failures, 3 Unrelated Failures

As of commit 0de0fe2 with merge base 4a26c64 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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

@github-actions

Copy link
Copy Markdown

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.

This was referenced Jul 22, 2026
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

Differential Revision: [D112257633](https://our.internmc.facebook.com/intern/diff/D112257633/)
JCNTH added a commit that referenced this pull request Jul 24, 2026
Pull Request resolved: #21189

Problem: The op-test framework compares outputs as fp32 only, so an int8-output op (`quantize_per_tensor`, and the wider q8ta family) cannot be goldened — a round-trip through `dequantize` folds to identity under ET's QDQ-cancel and tests nothing.

Solution: Add an int8 golden path, keyed off the output tensor's dtype, alongside the existing fp32 path (which is byte-identical for every existing op). This mirrors the earlier multi-output framework extension.

Implementation: `generate_op_tests.py` detects an int8 output, writes the golden as raw int8 bytes, records `"dtype": "int8"` in the manifest, and skips the fp32 cast + dual-oracle gate (fp32/float64 goldens are untouched). `driver_util` parses the golden `dtype` (default `"float32"`, so old manifests are unchanged) and adds `load_int8_bin`. `op_test_driver.cpp` branches on the dtype: int8 goldens compare byte-exact (a discrete grid — any deviation is a real bug), fp32 goldens keep the `within_tol` path.
ghstack-source-id: 406366826
@exported-using-ghexport

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants