Uh oh!
There was an error while loading. Please reload this page.
Arm backend: Remove silu decomposition pass - #17202
Merged
Merged
Conversation
Instead handle silu similar to other table op activations Signed-off-by: Adrian Lundell <adrian.lundell@arm.com> Change-Id: If3253ef6a3e76bd6fd5887b9d43874af0a897705
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17202
Note: Links to docs will display an error until the docs builds have been completed. ❌ 6 New FailuresAs of commit 0c9e364 with merge base 3b819a2 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
zingo
commented
Feb 4, 2026
Collaborator
Merged now, I will rebase to test. |
Uh oh!
There was an error while loading. Please reload this page.
vacu9708 added a commit
to vacu9708/executorch
that referenced
this pull request
Jul 28, 2026
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>
vacu9708 added a commit
to vacu9708/executorch
that referenced
this pull request
Jul 29, 2026
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 pushed a commit
that referenced
this pull request
Jul 31, 2026
### 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: | Quantizer | Mechanism | `silu.default` | `silu_.default` | | --- | --- | --- | --- | | Composable (`_TOSAQuantizerV2`, default since #19758) | `TOSAQuantizationConfig.<br>SHARED_OUTPUT_ACT_QSPEC_PATTERNS` | shared (bug) | shared (bug) | | Legacy (`_TOSAQuantizerV1`) | `quantization_annotator.py` op sets | own qspec | shared (bug) | ### Why quantization sharing is wrong for SiLU: <img width="512" height="492" alt="image" src="https://github.com/user-attachments/assets/ea71702f-bbe0-402a-b2b0-595b25e0d170" /> - **SiLU non-linearly compresses and warps its input range:** - Unlike ReLU, which maintains a 1:1 linear mapping ($y = x$) for non-negative inputs, SiLU is non-linear across its entire domain. - For negative inputs, its output never goes below -0.278, no matter how negative the input gets. So its output range is always narrower than its input's. Reusing the input scale misaligns the quantization bins with the actual output distribution, **wasting resolution.** - **Reusing the input's scale doesn't save any computation at runtime:** SiLU runs as a lookup table (`class TableOps`) whose entries are precomputed at compile time, not runtime. ### Changes | File | Change | Why | | --- | --- | --- | | `quantizer/quantization_config.py` | Remove `silu.default`/`silu_.default` from `SHARED_OUTPUT_ACT_QSPEC_PATTERNS` | The accuracy loss as described above. | | `quantizer/quantization_annotator.py` | Move `silu_.default` into `_one_to_one`, next to `silu.default` | The legacy annotator classified the two variants differently. #17202 put `silu.default` in `_one_to_one` (own qspec) but `silu_.default` in `_one_to_one_shared_input_or_input_act_qspec` (shared qspec). | | `test/ops/test_silu.py` | `Silu.forward` clones its input | Latent bug found while working on this change: SiLU(inplace=True) was mutating the test pipeline's shared input tensor which the pipeline reuses. It stayed invisible because the buggy (too large) output scale made the comparison helper(`compare_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.py` | Add `NonSharedQspecSilu` + `test_silu_does_not_share_input_qspec` | Check the emitted q/dq parameters, the same way the rest of `test_shared_qspecs.py` checks sharing. | ### Testing ```bash pytest backends/arm/test/misc/test_shared_qspecs.py # 17 passed pytest backends/arm/test/ops/test_silu.py -k "not vgf" # 34 passed, 32 xfailed ``` cc @kimishpatel@jerryzh168@digantdesai@freddan80@per@zingo@oscarandersson8218@mansnils@Sebastian-Larsson@robell@rascani Signed-off-by: Youngsik Yang <vacu9708@gmail.com>
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.
Instead handle silu similar to other table op activations
cc @freddan80@per@zingo@oscarandersson8218@digantdesai