Skip to content

Conversation

Sebastian-Larsson
Copy link
Collaborator

@Sebastian-Larsson Sebastian-Larsson commented Oct 6, 2025

Previously, _QuantProperty.qspec had the type hint type[QuantizationSpecBase] | List[type[QuantizationSpecBase]], which implies that _QuantProperty.qspec should be a class object. However, in torchao the class QuantizationAnnotation has this property:

output_qspec: Optional[QuantizationSpecBase] = None

which is set to _QuantProperty.qspec through a series of function calls. output_qspec should, as the type hinting implies, be an instance of a class of QuantizationSpecBase, not a class object.

Therefore, change
type[QuantizationSpecBase] | List[type[QuantizationSpecBase]] to QuantizationSpecBase | List[QuantizationSpecBase]. This allows us to remove a bunch of mypy ignores.

cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai

Previously, _QuantProperty.qspec had the type hint
`type[QuantizationSpecBase] | List[type[QuantizationSpecBase]]`, which
implies that _QuantProperty.qspec should be a class object. However, in
torchao the class `QuantizationAnnotation` has this property:

`output_qspec: Optional[QuantizationSpecBase] = None`

which is set to _QuantProperty.qspec through a series of function calls.
`output_qspec` should, as the type hinting implies, be an instance of a
class of `QuantizationSpecBase`, not a class object.

Therefore, change
`type[QuantizationSpecBase] | List[type[QuantizationSpecBase]]` to
`QuantizationSpecBase | List[QuantizationSpecBase]`. This allows us to
remove a bunch of mypy ignores.

Change-Id: Idbb5ca4ba9ab17e8805b1e4d647e46e86f434b69
Signed-off-by: Sebastian Larsson <[email protected]>
@Sebastian-Larsson Sebastian-Larsson added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: arm Changes to the ARM backend delegate labels Oct 6, 2025
Copy link

pytorch-bot bot commented Oct 6, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14814

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 2 Unrelated Failures

As of commit b4d664e with merge base 3b16bc1 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was 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.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 6, 2025
@Sebastian-Larsson
Copy link
Collaborator Author

Unrelated CI failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant