Arm backend: Add FP16 support to operators pt.2#17088
Conversation
Add FP16 support for operators: - conv2d - conv3d - cos - slice - pad Update op tests to cover the new datatype. Also correct the test name violations seen in test_conv2d.py. Signed-off-by: Martin Lindström <Martin.Lindstroem@arm.com> Change-Id: Ie02a8d7425443b0abb9561c0fbe73e2f41053adf
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17088
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 1 Unrelated FailureAs of commit dc4ae0e with merge base 6364277 ( NEW FAILURES - The following jobs have failed:
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. |
|
@pytorchbot label ciflow/trunk |
|
@pytorchbot label "partner: arm" |
|
@pytorchbot label "release notes: arm" |
There was a problem hiding this comment.
Pull request overview
This PR adds FP16 (half-precision floating-point) support to several ARM backend operators, bringing them in line with existing FP32 and BF16 support. The PR also includes test improvements to ensure proper coverage of the new data type.
Changes:
- Added FP16 as a supported data type for conv2d, conv3d, cos, slice, and pad operators
- Extended test suites to include FP16 test cases for all affected operators
- Corrected test function naming inconsistencies in test_conv2d.py (from
test_conv2d_*totest_convolution_2d_*)
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| backends/arm/operators/op_tosa_conv2d.py | Added FP16 to valid input dtypes and updated accumulation logic to use FP32 for FP16 inputs (matching BF16 behavior) |
| backends/arm/operators/op_slice.py | Added FP16 to the list of valid data types |
| backends/arm/operators/op_cos.py | Added FP16 to the list of valid data types |
| backends/arm/operators/op_constant_pad_nd.py | Added FP16 to the list of valid data types |
| backends/arm/test/ops/test_conv2d.py | Added FP16 test data suite, updated test parametrization, and corrected test function names to follow consistent naming convention |
| backends/arm/test/ops/test_conv3d.py | Added FP16 test data suite, updated test parametrization, and refactored to avoid duplicate function calls |
| backends/arm/test/ops/test_slice.py | Added FP16 test data suite and updated test parametrization |
| backends/arm/test/ops/test_cos.py | Added FP16 test data suite and updated test parametrization |
| backends/arm/test/ops/test_constant_pad_nd.py | Added FP16 test data suite and updated test parametrization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Arm backend tests fail: test_model_smollm2-135M Is a known fails and unrelated |
Add FP16 support for operators:
Update op tests to cover the new datatype.
Also correct the test name violations seen in test_conv2d.py.
cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai