Skip to content

Conversation

MartinPavella
Copy link
Collaborator

@MartinPavella MartinPavella commented Sep 17, 2025

Summary

This PR adds the option to specify delegation conditions which depend on the partition a particular node ends up in. This infrastructure is applied to the view_copy node.

Test plan

Unit tests provided.

cc @robert-kalmar @roman-janik-nxp @StrycekSimon @jirioc

Copy link

pytorch-bot bot commented Sep 17, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14373

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures, 2 Cancelled Jobs, 2 Unrelated Failures

As of commit 8ad83cf with merge base b3f3111 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was 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.

@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 17, 2025
@MartinPavella
Copy link
Collaborator Author

@pytorchbot label "module: nxp" "release notes: nxp"

@pytorch-bot pytorch-bot bot added module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate labels Sep 17, 2025
@MartinPavella MartinPavella force-pushed the upstream/main-nxp/EIEX-528-add-context-dependent-partitioning-conditions branch from 123e92d to 1b7ae0e Compare September 18, 2025 06:11
@MartinPavella MartinPavella force-pushed the upstream/main-nxp/EIEX-528-add-context-dependent-partitioning-conditions branch 2 times, most recently from 2cf03eb to 5fcf3c6 Compare September 18, 2025 08:30
Copy link
Collaborator

@jirioc jirioc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the unit tests restore the original state of supports_partitioning_result, the PR looks OK.

@MartinPavella MartinPavella force-pushed the upstream/main-nxp/EIEX-528-add-context-dependent-partitioning-conditions branch 2 times, most recently from 6325471 to cdadf15 Compare September 24, 2025 11:17
@MartinPavella
Copy link
Collaborator Author

The failing test pull / test-samsung-models-linux / linux-job (pull_request) fails on the command mkdir -p /tmp/exynos_ai_lite_core, which seems unrelated to this PR.
All other failing tests seem unrelated to this PR, and are also failing on main.

filter(is_not_qdq_node, view_copy_partitions[0].nodes)
)

if len(non_q_dq_partition_nodes) == 1:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For any practical model the contion is enough, but in theory not right.
Thinking loudly:

  • The view_copy (==> Reshape in Neutron IR) cannot be alone in the partition because on Neutron it is a NOOP. Regardless of the count (2 view_copies is also not allowed)
  • Another operator is clone, as we convert it to an "identity" tensor, what will be NOOP in neutron too.
    So I would say, the correct condition is there must be at least 1 compute operator, that is the partition must not contain only view_copy and clone ops (any number).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.
I will create a ticket for this, as it is not trivial to determine which nodes will end up being "noops". And it would require another PR to be merged first.

@MartinPavella MartinPavella force-pushed the upstream/main-nxp/EIEX-528-add-context-dependent-partitioning-conditions branch from cdadf15 to 8ad83cf Compare September 25, 2025 08:34
@MartinPavella MartinPavella merged commit 6a238e3 into pytorch:main Oct 1, 2025
122 of 130 checks passed
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.

3 participants