Skip to content

Conversation

jirioc
Copy link
Collaborator

@jirioc jirioc commented Sep 9, 2025

Summary

This feature makes the flow robust against Neutron converter crash/exit. Especially useful for running unit tests.

Test plan

When the nxp unit tests pass, the Neutron converter is properly invoked. No need for extra testing.

cc @digantdesai @JakeStevens @robert-kalmar

Copy link

pytorch-bot bot commented Sep 9, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (6 Unrelated Failures)

As of commit c3f5a69 with merge base 6ed10e5 (image):

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

BROKEN TRUNK - The following jobs 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.

@jirioc jirioc requested a review from robert-kalmar September 9, 2025 16:06
@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 9, 2025
@jirioc jirioc added ciflow/trunk 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 9, 2025
Copy link

pytorch-bot bot commented Sep 9, 2025

To add the ciflow label ciflow/trunk please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@pytorch-bot pytorch-bot bot removed the ciflow/trunk label Sep 9, 2025
@@ -3,11 +3,18 @@
# This source code is licensed under the BSD-style license found in the
Copy link
Contributor

Choose a reason for hiding this comment

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

# Copyright 2024-2025 NXP

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed ✅

@@ -52,6 +59,25 @@ def convert(
cctx.targetOpts = neutron_converter.getNeutronTarget(target)
# New switch since Neutron Converter SDK_25.06
cctx.compilationOpts.minNumOpsPerGraph = 1
model_converted = neutron_converter.convertModel(list(tflite_model), cctx)
# Don't merge `Transpose` operators, to avoid creating unsupported permutations.
cctx.compilationOpts.excludeGraphPasses = "MergeTranspose"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably not be included, as proper permute_copy support has not been up-streamed yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

I removed it. ✅

import pkgutil

from executorch.backends.nxp.backend.ir.converter.node_converter import Target


def convert_unsafe(neutron_converter, tflite_model, cctx, queue):
Copy link
Contributor

Choose a reason for hiding this comment

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

A documentation comment would be useful here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jirioc, can you please add it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@StrycekSimon StrycekSimon force-pushed the upstream/main-nxp/EIEX-532-upstream-converter-failure-catching branch from 62ab20c to fce6017 Compare September 10, 2025 08:06
@jirioc jirioc force-pushed the upstream/main-nxp/EIEX-532-upstream-converter-failure-catching branch from fce6017 to ee901ae Compare September 10, 2025 15:35
@jirioc jirioc force-pushed the upstream/main-nxp/EIEX-532-upstream-converter-failure-catching branch from ee901ae to c3f5a69 Compare September 11, 2025 07:49
@StrycekSimon
Copy link
Contributor

Seems like the failed tests are unrelated to this PR.

@robert-kalmar robert-kalmar merged commit 757c62b into pytorch:main Sep 12, 2025
117 of 123 checks passed
@robert-kalmar robert-kalmar deleted the upstream/main-nxp/EIEX-532-upstream-converter-failure-catching branch September 12, 2025 11:57
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.

5 participants