Uh oh!
There was an error while loading. Please reload this page.
Arm backend: Give SiLU its own output quantization params - #21437
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21437
Note: Links to docs will display an error until the docs builds have been completed.
|
|
vacu9708
commented
Jul 29, 2026
ContributorAuthor
@pytorchbot label "release notes: arm" |
Issue: 1. SiLU's quantized output was forced to reuse its input's quantization scale, wasting resolution since SiLU's output range is always narrower than its input's. 2. The composable quantizer and `silu_.default` was separately misclassified in the legacy annotator since pytorch#17202. Fix: Give SiLU its own output qspec. Also fixes an unrelated latent bug that this change exposed. Signed-off-by: Youngsik Yang <vacu9708@gmail.com>
Erik-Lundell
approved these changes
Jul 31, 2026
Erik-Lundell
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, thanks for the thorough PR.
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SiLU's quantized output is forced to reuse its input's quantization scale, which wastes resolution for no benefit.
This commit gives SiLU its own output quantization spec.
Where this happens:
silu.defaultsilu_.default_TOSAQuantizerV2, default since #19758)TOSAQuantizationConfig.<br>SHARED_OUTPUT_ACT_QSPEC_PATTERNS_TOSAQuantizerV1)quantization_annotator.pyop setsWhy quantization sharing is wrong for SiLU:
class TableOps) whose entries are precomputed at compile time, not runtime.Changes
quantizer/quantization_config.pysilu.default/silu_.defaultfromSHARED_OUTPUT_ACT_QSPEC_PATTERNSquantizer/quantization_annotator.pysilu_.defaultinto_one_to_one, next tosilu.defaultsilu.defaultin_one_to_one(own qspec) butsilu_.defaultin_one_to_one_shared_input_or_input_act_qspec(shared qspec).test/ops/test_silu.pySilu.forwardclones its inputcompare_rel_frobenius_and_cosine_similarity()) treat every value as noise and skip the check entirely, so the test kept passing without validating anything.test/misc/test_shared_qspecs.pyNonSharedQspecSilu+test_silu_does_not_share_input_qspectest_shared_qspecs.pychecks sharing.Testing
cc @kimishpatel@jerryzh168@digantdesai@freddan80@per@zingo@oscarandersson8218@mansnils@Sebastian-Larsson@robell@rascani