NXP backend: added support for aten.bmm#17818
NXP backend: added support for aten.bmm#17818novak-vaclav wants to merge 1 commit intopytorch:mainfrom
aten.bmm#17818Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17818
Note: Links to docs will display an error until the docs builds have been completed.
|
|
@pytorchbot label "release notes: nxp" |
|
@pytorchbot label "module: nxp" |
|
@MartinPavella Please try to re-run the After that, this can be merged ✔️ |
backends/nxp/tests/ir/converter/node_converter/test_bmm_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/tests/ir/converter/node_converter/test_bmm_converter.py
Outdated
Show resolved
Hide resolved
0c62f83 to
53924f3
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds support for the aten.bmm (batch matrix multiply) operator in the NXP Neutron backend for ExecuTorch. It includes a new BMMConverter node converter, a BMMPattern quantization pattern, test models, and test cases.
Changes:
- Adds
BMMConverterclass with IR support and target-level (num_macs) validation, convertingaten.bmmto TFLiteBatchMatMulwith proper channels-first/last handling - Registers
BMMPatternquantizer andBMMConverterin the partitioner/converter registries - Adds test models (
BatchMatMulModel,BatchMatMulConvModel) and tests covering supported/unsupported shapes and conv+bmm fusion scenarios
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
bmm_converter.py |
Core converter implementation with IR and target support checks, channels-format handling |
__init__.py |
Exports BMMConverter |
edge_program_converter.py |
Registers BMMConverter for aten.bmm.default |
neutron_partitioner.py |
Registers BMMConverter in the supported ops map |
patterns.py |
Adds BMMPattern quantization pattern |
neutron_quantizer.py |
Registers BMMPattern in the quantizer |
models.py |
Adds BatchMatMulModel and BatchMatMulConvModel test models |
test_bmm_converter.py |
Tests for supported/unsupported configs and conv+bmm quantization |
op-support.csv |
Documents aten.bmm.default operator support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Show resolved
Hide resolved
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Show resolved
Hide resolved
backends/nxp/tests/ir/converter/node_converter/test_bmm_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/tests/ir/converter/node_converter/test_bmm_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Show resolved
Hide resolved
backends/nxp/tests/ir/converter/node_converter/test_bmm_converter.py
Outdated
Show resolved
Hide resolved
53924f3 to
abc0237
Compare
4ec6cd4 to
a69dad7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Show resolved
Hide resolved
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Show resolved
Hide resolved
|
Fixed the issues mentioned by @MartinPavella |
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/backend/ir/converter/node_converters/ops_converters/bmm_converter.py
Outdated
Show resolved
Hide resolved
| @pytest.mark.parametrize( | ||
| "input_shape_x1, input_shape_x2", | ||
| [ | ||
| pytest.param((1, 8, 16), (1, 16, 24), id="3D, x1_W not divisible by NUM_MACS."), |
There was a problem hiding this comment.
x1_W not divisible by NUM_MACS
Unless W refers to the first dimension, this is not true,
There was a problem hiding this comment.
During the implementation and review of the feedback, I forgot to also modify this test. The test cases were all a bit off, so I fixed them. Please have a look.
a69dad7 to
8fc1396
Compare
|
Fixed all the issues, please have a look @MartinPavella |
Summary
adds support for
aten.bmmoperator.The original PR is here, however I pushed to the branch without committing the work first and the PR closed itself auto-magically.
Test plan
tests can be manually run using
pytest -c /dev/null backends/nxp/tests/cc @robert-kalmar @JakeStevens @digantdesai @MartinPavella