Repository navigation
Make QuantAbsorption's input-side absorption opt-in - #24780
mcremon-meta wants to merge 1 commit into
Conversation
Summary: This should have been part of #24720, which added `QuantAbsorptionPass` with the other fused_quant graph passes. It was left out of that PR by mistake. By default, `QuantAbsorptionPass` now only runs the rewrite that is never less accurate. The docstring explains why the other two modes are opt-in. - Output side (unchanged, always on): the producer writes its output directly in the downstream quantize's qparams. The value still ends up on that grid, rounded once instead of twice, so each element is at least as close to the float result. It isn't bit-exact with the q/dq graph, though. - Input side (now opt-in, `absorb_into_inputs`): the consumer reads values on the dequantize's grid instead of the quantize's. Dropping the second rounding is more accurate on average, but not for every value. - Forked dequantize (already opt-in, `absorb_with_fork`): its float users see values on the quantize's grid instead of the producer's, which can be coarser. Only the docstring changes. With input-side absorption off, a pair that only the input side would remove is left to `ReplaceDequantQuantWithRequantize`, which turns it into a `fused_quant.requantize`. Differential Revision: D130466673
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24780
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 8647e29 with merge base e0015e1 ( BROKEN TRUNK - The following job 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. |
|
@mcremon-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D130466673. |
This PR needs a
|
Summary: This should have been part of #24720, which added `QuantAbsorptionPass` with the other fused_quant graph passes. It was left out of that PR by mistake. By default, `QuantAbsorptionPass` now only runs the rewrite that is never less accurate. The docstring explains why the other two modes are opt-in. - Output side (unchanged, always on): the producer writes its output directly in the downstream quantize's qparams. The value still ends up on that grid, rounded once instead of twice, so each element is at least as close to the float result. It isn't bit-exact with the q/dq graph, though. - Input side (now opt-in, `absorb_into_inputs`): the consumer reads values on the dequantize's grid instead of the quantize's. Dropping the second rounding is more accurate on average, but not for every value. - Forked dequantize (already opt-in, `absorb_with_fork`): its float users see values on the quantize's grid instead of the producer's, which can be coarser. Only the docstring changes. With input-side absorption off, a pair that only the input side would remove is left to `ReplaceDequantQuantWithRequantize`, which turns it into a `fused_quant.requantize`. Differential Revision: D130466673
Summary:
This should have been part of
#24720, which added
QuantAbsorptionPasswith the other fused_quant graph passes. It was left outof that PR by mistake.
By default,
QuantAbsorptionPassnow only runs the rewrite that is never lessaccurate. The docstring explains why the other two modes are opt-in.
in the downstream quantize's qparams. The value still ends up on that grid,
rounded once instead of twice, so each element is at least as close to the
float result. It isn't bit-exact with the q/dq graph, though.
absorb_into_inputs): the consumer reads values onthe dequantize's grid instead of the quantize's. Dropping the second rounding
is more accurate on average, but not for every value.
absorb_with_fork): its float users seevalues on the quantize's grid instead of the producer's, which can be
coarser. Only the docstring changes.
With input-side absorption off, a pair that only the input side would remove
is left to
ReplaceDequantQuantWithRequantize, which turns it into afused_quant.requantize.Differential Revision: D130466673