Add INT16 support to permute operation for TOSA backend #15138
+10
−1
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.
Summary:
Summary
Add INT16 dtype support to the permute (transpose) operation in the ARM TOSA backend, following the same pattern as other int16-enabled operations like conv2d.
Problem
The
aten.permute_copy.default
operation only supported INT8, INT32, and FP32 dtypes. INT16 support was missing, which blocks int16 quantized models that use permutation operations (e.g., LSTM with int16 activations).Solution
tosa_spec.support_extension("int16")
Implementation Details
This ensures INT16 support is only enabled when:
TOSA Specification
According to TOSA spec, the TRANSPOSE operation (used by permute) supports INT16 when the int16 extension is enabled. This change aligns the implementation with the specification.
Impact
Files Changed
fbcode/executorch/backends/arm/operators/op_permute.py
xplat/executorch/backends/arm/operators/op_permute.py
(mirrored)Differential Revision: D84642353