Arm backend: xfail test for FoldScalarMulIntoConv quantized-accuracy hazard (#21152)#21152
Arm backend: xfail test for FoldScalarMulIntoConv quantized-accuracy hazard (#21152)#211523l1 wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21152
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 3 New Failures, 13 Unrelated Failures, 3 Unclassified FailuresAs of commit e6ccc61 with merge base 430b73d ( NEW FAILURES - The following jobs have failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@3l1 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113310822. |
This PR needs a
|
…hazard (#21152) Summary: FoldScalarMulIntoConv #20838 rewrites conv(x) * scale to a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization: activation qparams are calibrated and frozen on the pre-fold conv output, which has a uniform range. Folding a per-channel scale into the weights moves the scaling inside the convolution, so the real conv output spans the scaled dynamic range while it is still requantized with the stale pre-fold scale. With a wide-dynamic-range scale this clips / loses precision and the quantized result diverges from the reference where the mul is kept as a separate, well-scaled op. The same requant shift degrades models that carry a quantized value across steps, where it compounds. Add ConvMulWideDynamicRangeScale and an xfail test on the bit-accurate TOSA INT reference documenting the hazard. It will start passing (flagging that the xfail should be removed) once the fold is made quantization-aware or is skipped for the affected models. Differential Revision: D113310822
994b837 to
b056b7d
Compare
…hazard (#21152) Summary: FoldScalarMulIntoConv #20838 rewrites conv(x) * scale to a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization: activation qparams are calibrated and frozen on the pre-fold conv output, which has a uniform range. Folding a per-channel scale into the weights moves the scaling inside the convolution, so the real conv output spans the scaled dynamic range while it is still requantized with the stale pre-fold scale. With a wide-dynamic-range scale this clips / loses precision and the quantized result diverges from the reference where the mul is kept as a separate, well-scaled op. The same requant shift degrades models that carry a quantized value across steps, where it compounds. Add ConvMulWideDynamicRangeScale and an xfail test on the bit-accurate TOSA INT reference documenting the hazard. It will start passing (flagging that the xfail should be removed) once the fold is made quantization-aware or is skipped for the affected models. Reviewed By: rascani Differential Revision: D113310822
b056b7d to
542e37c
Compare
…hazard (#21152) Summary: FoldScalarMulIntoConv #20838 rewrites conv(x) * scale to a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization: activation qparams are calibrated and frozen on the pre-fold conv output, which has a uniform range. Folding a per-channel scale into the weights moves the scaling inside the convolution, so the real conv output spans the scaled dynamic range while it is still requantized with the stale pre-fold scale. With a wide-dynamic-range scale this clips / loses precision and the quantized result diverges from the reference where the mul is kept as a separate, well-scaled op. The same requant shift degrades models that carry a quantized value across steps, where it compounds. Add ConvMulWideDynamicRangeScale and an xfail test on the bit-accurate TOSA INT reference documenting the hazard. It will start passing (flagging that the xfail should be removed) once the fold is made quantization-aware or is skipped for the affected models. Reviewed By: rascani Differential Revision: D113310822
…hazard (#21152) Summary: FoldScalarMulIntoConv #20838 rewrites conv(x) * scale to a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization: activation qparams are calibrated and frozen on the pre-fold conv output, which has a uniform range. Folding a per-channel scale into the weights moves the scaling inside the convolution, so the real conv output spans the scaled dynamic range while it is still requantized with the stale pre-fold scale. With a wide-dynamic-range scale this clips / loses precision and the quantized result diverges from the reference where the mul is kept as a separate, well-scaled op. The same requant shift degrades models that carry a quantized value across steps, where it compounds. Add ConvMulWideDynamicRangeScale and an xfail test on the bit-accurate TOSA INT reference documenting the hazard. It will start passing (flagging that the xfail should be removed) once the fold is made quantization-aware or is skipped for the affected models. Reviewed By: rascani Differential Revision: D113310822
542e37c to
bb0b0b3
Compare
dfcb3cb to
d938697
Compare
…hazard (#21152) Summary: FoldScalarMulIntoConv #20838 rewrites conv(x) * scale to a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization: activation qparams are calibrated and frozen on the pre-fold conv output, which has a uniform range. Folding a per-channel scale into the weights moves the scaling inside the convolution, so the real conv output spans the scaled dynamic range while it is still requantized with the stale pre-fold scale. With a wide-dynamic-range scale this clips / loses precision and the quantized result diverges from the reference where the mul is kept as a separate, well-scaled op. The same requant shift degrades models that carry a quantized value across steps, where it compounds. Add ConvMulWideDynamicRangeScale and an xfail test on the bit-accurate TOSA INT reference documenting the hazard. It will start passing (flagging that the xfail should be removed) once the fold is made quantization-aware or is skipped for the affected models. Reviewed By: rascani Differential Revision: D113310822
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
d938697 to
8a015aa
Compare
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
8a015aa to
8fe1b23
Compare
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
8fe1b23 to
3015e4b
Compare
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
3015e4b to
e6ccc61
Compare
…hazard (#21152) Summary: FoldScalarMulIntoConv (#20838) rewrites conv(x) * scale into a convolution with scaled weights. This is exact in floating point (already covered by the existing tests in this file), but it is not safe under quantization when the scaled conv output feeds a carried/stateful quantization boundary -- a value written back into a mutable buffer / input that persists across invocations (recurrent state). Activation qparams are calibrated and frozen on the pre-fold conv output; folding the scale into the weights moves the scaling inside the convolution, so the conv output is requantized with the stale pre-fold scale. That shifted requantization drifts the persisted quantized state and the error compounds over the sequence. Add StatefulConvMul (conv output * scale written into a mutable buffer) and an xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting the hazard: the fold currently fires and drops the mul across the buffer boundary. The test is marked xfail (strict); the state-aware guard in D113310883 makes it pass, and the xfail is removed there. Reviewed By: rascani Differential Revision: D113310822
|
Thanks Ill add some people that are in the office 🙂 |
Summary:
FoldScalarMulIntoConv (#20838) rewrites
conv(x) * scale into a convolution with scaled weights. This is exact in floating
point (already covered by the existing tests in this file), but it is not safe
under quantization when the scaled conv output feeds a carried/stateful
quantization boundary -- a value written back into a mutable buffer / input that
persists across invocations (recurrent state). Activation qparams are calibrated
and frozen on the pre-fold conv output; folding the scale into the weights moves
the scaling inside the convolution, so the conv output is requantized with the
stale pre-fold scale. That shifted requantization drifts the persisted quantized
state and the error compounds over the sequence.
Add StatefulConvMul (conv output * scale written into a mutable buffer) and an
xfail unit test (test_does_not_fold_when_output_feeds_stateful_buffer) documenting
the hazard: the fold currently fires and drops the mul across the buffer boundary.
The test is marked xfail (strict); the state-aware guard in D113310883 makes it
pass, and the xfail is removed there.
Reviewed By: rascani
Differential Revision: D113310822
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani