NXP backend: added support for scalar args of elementary ops#21011
Open
novak-vaclav wants to merge 1 commit into
Open
NXP backend: added support for scalar args of elementary ops#21011novak-vaclav wants to merge 1 commit into
novak-vaclav wants to merge 1 commit into
Conversation
novak-vaclav
requested review from
MartinPavella,
Copilot,
irtrukhina,
jirioc and
roman-janik-nxp
July 17, 2026 14:03
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21011
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit f7efe57 with merge base 43bdb7b ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
MartinPavella
approved these changes
Jul 17, 2026
MartinPavella
left a comment
Collaborator
There was a problem hiding this comment.
Just a few suggestions. Very nice work 👍🏻
| if isinstance(node_val, torch.Tensor): | ||
| return node_val.dtype | ||
|
|
||
| return torch.float32 |
Collaborator
There was a problem hiding this comment.
Nit:
Perhaps it would be better to call off the modification if we cannot infer the type.
|
|
||
| return torch.float32 | ||
|
|
||
| def _create_scalar_attr_node(self, node: Node, scalar_value: int | float) -> Node: |
Collaborator
There was a problem hiding this comment.
Nit:
Type hint int | float is equivalent to just float.
| exir_program_aten = torch.export.export(model, (example_input,)).module() | ||
|
|
||
| # Check if the node with scalar arg did not disappear. | ||
| assert graph_contains_any_of_ops(exir_program_aten.graph, [expected_op]) |
Collaborator
There was a problem hiding this comment.
Nit:
How about a check here to verify that the op indeed has a scalar argument?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Added support for scalar args of elementary ops.
Test plan
tests can be manually run using
pytest -c /dev/null backends/nxp/tests/cc @robert-kalmar @JakeStevens @digantdesai @rascani @MartinPavella