Skip to content

NXP backend: Add DetailedGraphVerifier for strict checking of delegated nodes.#19327

Open
MartinPavella wants to merge 3 commits intopytorch:mainfrom
nxp-upstream:nxg01483/EIEX-902-create-a-graphverifier-with-strict-operator-checking
Open

NXP backend: Add DetailedGraphVerifier for strict checking of delegated nodes.#19327
MartinPavella wants to merge 3 commits intopytorch:mainfrom
nxp-upstream:nxg01483/EIEX-902-create-a-graphverifier-with-strict-operator-checking

Conversation

@MartinPavella
Copy link
Copy Markdown
Collaborator

@MartinPavella MartinPavella commented May 6, 2026

Summary

The new DetailedGraphVerifier allows us to test for exact delegated and non-delegated nodes in NXP tests. This should improve the reliability of the tests,

Test plan

Tested by MaxPool and AvgPool tests.

cc @robert-kalmar @JakeStevens @digantdesai

@MartinPavella MartinPavella self-assigned this May 6, 2026
@MartinPavella MartinPavella 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 May 6, 2026
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 6, 2026

🔗 Helpful Links

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

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

❌ 1 New Failure, 4 Unrelated Failures

As of commit a58fcf1 with merge base 48a8d58 (image):

NEW FAILURE - The following job has failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but were 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 May 6, 2026
@MartinPavella
Copy link
Copy Markdown
Collaborator Author

This PR is based on another one: #19272. Please review that one first.
@novak-vaclav please feel free to have a look.

Copy link
Copy Markdown
Contributor

@novak-vaclav novak-vaclav left a comment

Choose a reason for hiding this comment

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

Two nits, otherwise LGTM. Good work! 😊

exp_num_delegate_call_nodes=1, # Delegated AvgPool.
exp_non_delegated_nodes=[],
)
graph_verifier = DetailedGraphVerifier({AvgPool2D: 1}, {}, mocker)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I would prefer that names of the arguments are used explicitly, just like before with BaseGraphVerifier, because this way I do not know if AvgPool2D should be delegated or not.

Like this:

graph_verifier = DetailedGraphVerifier(
    expected_delegated_ops={AvgPool2D: 1},
    expected_non_delegated_ops={},
    mocker
)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I will update it.

Comment thread backends/nxp/tests/graph_verifier.py
@MartinPavella MartinPavella force-pushed the nxg01483/EIEX-902-create-a-graphverifier-with-strict-operator-checking branch from 045ddec to a58fcf1 Compare May 6, 2026 09:42
):
"""Initializes the DetailedGraphVerifier and patches NeutronPartitioner.partition() to capture node state.

:param expected_delegated_ops: Dictionary mapping operators to their expected delegation count
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not use NonDelegatedNode?

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