Skip to content

NXP Backend: Force backend (NeutronBackend) destructor call before neutronDeInit()#19795

Merged
robert-kalmar merged 1 commit into
pytorch:mainfrom
nxp-upstream:bugfix/nxp-runner-double-free
May 28, 2026
Merged

NXP Backend: Force backend (NeutronBackend) destructor call before neutronDeInit()#19795
robert-kalmar merged 1 commit into
pytorch:mainfrom
nxp-upstream:bugfix/nxp-runner-double-free

Conversation

@robert-kalmar
Copy link
Copy Markdown
Collaborator

@robert-kalmar robert-kalmar commented May 27, 2026

Summary

The NeutronBackend::destroy function shall be called before the Neutron driver's neutronDeInit() function to avoid double free. At this moment the ExecuTorch does not provide means to destroy the backend or the method outside of the method's desctructor.

Test plan

With upcomming eIQ Neutron SDK 3.1.2 the nxp-executor-runner crash, so existing unit tests covers this problem.

cc @JakeStevens @digantdesai @rascani

…utronDeInit().

The `NeutronBackend::destroy` function shall be called before the Neutron driver's `neutronDeInit()` function to avoid double free.
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 27, 2026

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (3 Unrelated Failures)

As of commit 09a0b86 with merge base 77df9b7 (image):

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 27, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

CLA Not Signed

@robert-kalmar
Copy link
Copy Markdown
Collaborator Author

Reviewers: The Github diff messy, the change is nesting the code block with the ExecuTorch program method instantiation to limit the lifetime of the method local variable.

@robert-kalmar robert-kalmar 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 27, 2026
@robert-kalmar robert-kalmar merged commit acce7cd into pytorch:main May 28, 2026
185 of 198 checks passed
@robert-kalmar robert-kalmar deleted the bugfix/nxp-runner-double-free branch May 28, 2026 15:00
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