Skip to content

Conversation

@sxu
Copy link
Contributor

@sxu sxu commented Nov 19, 2025

Summary: Introduce a FakeQuantizer subclass. It falls back to LPBQ observer's convert. _derived_bias_quant_spec also looks for it to correctly derive bias scale.

Open to suggestions on how to test. Naveen launched a QAT run and it seems to produce reasonable results.

Differential Revision: D87194388

Summary: Introduce a FakeQuantizer subclass. It falls back to LPBQ observer's `convert`. `_derived_bias_quant_spec` also looks for it to correctly derive bias scale.

Differential Revision: D87194388
@sxu sxu requested a review from cccclai as a code owner November 19, 2025 00:19
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 19, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 2 Unrelated Failures

As of commit eb2e9f9 with merge base 529a265 (image):

NEW FAILURE - The following job has failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Nov 19, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 19, 2025

@sxu has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87194388.

@sxu sxu added the release notes: none Do not include this in the release notes label Nov 19, 2025
@billmguo
Copy link
Contributor

@winskuo-quic can you review and approve this diff?

self.eps = eps

def forward(self, x: torch.Tensor) -> torch.Tensor:
if x.numel() == 0:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be simpler if calling torchao.quantization.quant_primitives._fake_quantize_affine directly?

@DannyYuyang-quic
Copy link
Contributor

I think for QAT testing we can use pseudo labels generated by the FP32 model, do a few mini training steps on the fake-quant model, and then compare outputs against the FP32 baseline (pseudo labels) within acceptable atol/rtol thresholds as usual.

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 release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants