-
Notifications
You must be signed in to change notification settings - Fork 690
NXP backend: Add conversion and quantization support for dim_order_ops._clone_dim_order.default #14535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NXP backend: Add conversion and quantization support for dim_order_ops._clone_dim_order.default #14535
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14535
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 5647c3e with merge base 0b748bf ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "release notes: nxp" |
backends/nxp/tests/executors.py
Outdated
|
||
def graph_contains_any_of_ops(graph: Graph, ops: list) -> bool: | ||
return any(node.target in ops for node in graph.nodes) | ||
return graph_contains_any(graph, condition=lambda n: n in ops) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be:
return graph_contains_any(graph, condition=lambda n: hasattr(n, "target") and n.target in ops)
?
backends/nxp/tests/executors.py
Outdated
|
||
|
||
def graph_contains_any(graph: Graph, condition: Callable[[Node], bool]) -> bool: | ||
return any(condition(node.target) for node in graph.nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be:
return any(condition(node) for node in graph.nodes)
or if you prefer:
return any(map(condition, graph.nodes))
] | ||
|
||
quantized_program = to_quantized_edge_program(model, input_shape).exported_program() | ||
def target_can_be_clone(node): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
|
||
edge_program = to_edge_program(model, input_shape).exported_program() | ||
|
||
has_clone = graph_contains_any( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
You can use the graph_contains_any_of_ops()
here (once it's fixed).
Please take a look at the failing Neutron tests. |
edb2d3f
to
a56732e
Compare
Both fails seems unrelated to this PR while one of them was already failing in our previous PRs. |
a56732e
to
e6597c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update and rebase on new main.
backends/nxp/tests/ir/converter/node_converter/test_clone_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/tests/ir/converter/node_converter/test_clone_converter.py
Outdated
Show resolved
Hide resolved
backends/nxp/tests/ir/converter/node_converter/test_clone_converter.py
Outdated
Show resolved
Hide resolved
…s._clone_dim_order.default
e6597c2
to
5647c3e
Compare
That is done. ✅ |
Summary
dim_order_ops._clone_dim_order.default
operator and fixes problems with some variations ofnn.Dropout
.Test plan
All changes should be covered by unit tests.
cc @robert-kalmar @JakeStevens @digantdesai