NXP backend: Add DetailedGraphVerifier for strict checking of delegated nodes.#19327
Conversation
🔗 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 FailuresAs of commit a58fcf1 with merge base 48a8d58 ( 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. |
|
This PR is based on another one: #19272. Please review that one first. |
novak-vaclav
left a comment
There was a problem hiding this comment.
Two nits, otherwise LGTM. Good work! 😊
| exp_num_delegate_call_nodes=1, # Delegated AvgPool. | ||
| exp_non_delegated_nodes=[], | ||
| ) | ||
| graph_verifier = DetailedGraphVerifier({AvgPool2D: 1}, {}, mocker) |
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
Good point. I will update it.
045ddec to
a58fcf1
Compare
| ): | ||
| """Initializes the DetailedGraphVerifier and patches NeutronPartitioner.partition() to capture node state. | ||
|
|
||
| :param expected_delegated_ops: Dictionary mapping operators to their expected delegation count |
There was a problem hiding this comment.
Why not use NonDelegatedNode?
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