Repository navigation
Conversation
Summary: Input-side quant absorption (`absorb_into_inputs`) absorbs a dequantize -> quantize pair into the input qparams of the fused op that reads it, but only when the quantize has one reader. A model input read by several ops keeps the pair, which then becomes a requantize: with `--image-input`, XLSR's uint8 pixels feed its five parallel first-layer convs, so a uint8 -> int8 requantize (same scale, zero point 0 -> -128, exact) runs before them, while UNet's single first conv reads uint8 directly. `_try_absorb_input_fan_out` absorbs the pair into every reader, or into none: each reader must be a fused op that reads the quantize only through input slots, has per-tensor qparams, can represent its composed qparams, and keeps a zero point of 0 if it is in `symmetric_quant_input_ops`. Each reader composes its own qparams, as a single reader does. A reader behind a passthrough still does not qualify, since the chain itself would fork. The single-reader path is unchanged; the symmetric check is now made per reader, so `_try_absorb_input` takes the op set instead of a flag. It stays behind the `absorb_into_inputs` opt-in. Differential Revision: D134566322
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/25740
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 26a25fd with merge base 3469d36 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@DrJessop has exported this pull request. If you are a Meta employee, you can view the originating Diff in D134566322. |
This PR needs a
|
Summary:
Input-side quant absorption (
absorb_into_inputs) absorbs a dequantize -> quantize pair into the input qparams of the fused op that reads it, but only when the quantize has one reader. A model input read by several ops keeps the pair, which then becomes a requantize: with--image-input, XLSR's uint8 pixels feed its five parallel first-layer convs, so a uint8 -> int8 requantize (same scale, zero point 0 -> -128, exact) runs before them, while UNet's single first conv reads uint8 directly._try_absorb_input_fan_outabsorbs the pair into every reader, or into none: each reader must be a fused op that reads the quantize only through input slots, has per-tensor qparams, can represent its composed qparams, and keeps a zero point of 0 if it is insymmetric_quant_input_ops. Each reader composes its own qparams, as a single reader does. A reader behind a passthrough still does not qualify, since the chain itself would fork. The single-reader path is unchanged; the symmetric check is now made per reader, so_try_absorb_inputtakes the op set instead of a flag.It stays behind the
absorb_into_inputsopt-in.Differential Revision: D134566322