Skip to content

Conversation

StrycekSimon
Copy link
Collaborator

@StrycekSimon StrycekSimon commented Sep 24, 2025

Summary

  • Adds support for conversion and quantization of dim_order_ops._clone_dim_order.default operator and fixes problems with some variations of nn.Dropout.
  • Adds more robust test cases for clone operators.

Test plan

All changes should be covered by unit tests.

cc @robert-kalmar @JakeStevens @digantdesai

Copy link

pytorch-bot bot commented Sep 24, 2025

🔗 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 Failure

As of commit 5647c3e with merge base 0b748bf (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 24, 2025
@StrycekSimon
Copy link
Collaborator Author

@pytorchbot label "release notes: nxp"

@pytorch-bot pytorch-bot bot added the release notes: nxp Changes to the NXP Neutron backend delegate label Sep 24, 2025

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)
Copy link
Collaborator

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)

?



def graph_contains_any(graph: Graph, condition: Callable[[Node], bool]) -> bool:
return any(condition(node.target) for node in graph.nodes)
Copy link
Collaborator

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):
Copy link
Collaborator

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(
Copy link
Collaborator

@MartinPavella MartinPavella Sep 24, 2025

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).

@MartinPavella
Copy link
Collaborator

Please take a look at the failing Neutron tests.

@StrycekSimon StrycekSimon force-pushed the feature/EIEX-536-fix-clone-conversion-and-tests branch 3 times, most recently from edb2d3f to a56732e Compare September 29, 2025 07:28
@StrycekSimon
Copy link
Collaborator Author

Both fails seems unrelated to this PR while one of them was already failing in our previous PRs.

@StrycekSimon StrycekSimon force-pushed the feature/EIEX-536-fix-clone-conversion-and-tests branch from a56732e to e6597c2 Compare October 6, 2025 13:20
Copy link
Collaborator

@roman-janik-nxp roman-janik-nxp left a 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.

@robert-kalmar robert-kalmar added the module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ label Oct 6, 2025
@StrycekSimon StrycekSimon force-pushed the feature/EIEX-536-fix-clone-conversion-and-tests branch from e6597c2 to 5647c3e Compare October 7, 2025 14:12
@StrycekSimon
Copy link
Collaborator Author

Please update and rebase on new main.

That is done. ✅

@roman-janik-nxp roman-janik-nxp merged commit afd98fe into pytorch:main Oct 13, 2025
129 of 130 checks passed
@roman-janik-nxp roman-janik-nxp deleted the feature/EIEX-536-fix-clone-conversion-and-tests branch October 13, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants