Skip to content

Add E9945 support and harden ENN integration (#24165) - #24165

Open
alirezamonfared wants to merge 1 commit into
pytorch:mainfrom
alirezamonfared:export-D124906831
Open

alirezamonfared wants to merge 1 commit into
pytorch:mainfrom
alirezamonfared:export-D124906831

Conversation

@alirezamonfared

@alirezamonfared alirezamonfared commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Summary

This change improves the Samsung ENN backend integration by:

  • adding E9945 to SamsungChipset and testing compile-spec serialization for every supported chipset;
  • adding host-side AOT and Android runtime build targets, including static backend registration;
  • importing CompileSpec from the lightweight schema module;
  • hardening EnnExecutor teardown after partial or failed initialization;
  • fixing portable size_t formatting and Android variadic logging.

EnnExecutor now avoids model and buffer cleanup before successful initialization or model creation, releases buffers only when an allocation exists, and still closes a valid model when no buffers were allocated. Android logging copies the va_list and uses __android_log_vprint before writing separately to stderr.

Existing E9955 and E9965 behavior is unchanged. The backend continues to load ENN dynamically from the device and does not bundle vendor binaries. This is backend infrastructure and contains no application, model, asset, device-eligibility, or rollout policy.

Authorship

Authored with Codex.

Test Plan:

Test plan

  • Unit tests passed for compile-spec serialization of E9945, E9955, and E9965, including case-insensitive E9945 lookup (2 tests).
  • Built the Samsung host-side AOT and Android ENN runtime/static-registration targets.
  • On E9945 hardware, loaded an ExecuTorch program with one ENN delegate and observed successful model open, commit, and execution.
  • Verified output matched the reference within the expected tolerance and placement logs confirmed NPU participation.
  • With the ENN runtime library unavailable, verified the backend returned a clean initialization error and the process remained alive.
  • Lint and format checks passed.

Reviewed By: sivapatibandla

Differential Revision: D124906831

Pulled By: alirezamonfared

@pytorch-bot

pytorch-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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:

✅ No Failures

As of commit d117543 with merge base 79feb10 (image):
💚 Looks good so far! There are no failures yet. 💚

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 Oct 26, 2026
@meta-codesync

meta-codesync Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

@alirezamonfared has exported this pull request. If you are a Meta employee, you can view the originating Diff in D124906831.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync Bot changed the title Add E9945 support and harden ENN integration Add E9945 support and harden ENN integration (#24165) Nov 3, 2026
alirezamonfared added a commit to alirezamonfared/executorch that referenced this pull request Nov 3, 2026
Summary:
Pull Request resolved: pytorch#24165

## Summary

This change improves the Samsung ENN backend integration by:

- adding E9945 to `SamsungChipset` and testing compile-spec serialization for every supported chipset;
- adding host-side AOT and Android runtime build targets, including static backend registration;
- importing `CompileSpec` from the lightweight schema module;
- hardening `EnnExecutor` teardown after partial or failed initialization;
- fixing portable `size_t` formatting and Android variadic logging.

`EnnExecutor` now avoids model and buffer cleanup before successful initialization or model creation, releases buffers only when an allocation exists, and still closes a valid model when no buffers were allocated. Android logging copies the `va_list` and uses `__android_log_vprint` before writing separately to stderr.

Existing E9955 and E9965 behavior is unchanged. The backend continues to load ENN dynamically from the device and does not bundle vendor binaries. This is backend infrastructure and contains no application, model, asset, device-eligibility, or rollout policy.

## Authorship

Authored with Codex.

Test Plan:
## Test plan

- Unit tests passed for compile-spec serialization of E9945, E9955, and E9965, including case-insensitive E9945 lookup (2 tests).
- Built the Samsung host-side AOT and Android ENN runtime/static-registration targets.
- On E9945 hardware, loaded an ExecuTorch program with one ENN delegate and observed successful model open, commit, and execution.
- Verified output matched the reference within the expected tolerance and placement logs confirmed NPU participation.
- With the ENN runtime library unavailable, verified the backend returned a clean initialization error and the process remained alive.
- Lint and format checks passed.

Reviewed By: sivapatibandla

Differential Revision: D124906831

Pulled By: alirezamonfared
Signed-off-by: Ali Monfared <2058201+alirezamonfared@users.noreply.github.com>
@psiddh
psiddh requested a review from SS-JIA November 3, 2026 17:49
alirezamonfared added a commit to alirezamonfared/executorch that referenced this pull request Nov 3, 2026
Summary:

## Summary

This change improves the Samsung ENN backend integration by:

- adding E9945 to `SamsungChipset` and testing compile-spec serialization for every supported chipset;
- adding host-side AOT and Android runtime build targets, including static backend registration;
- importing `CompileSpec` from the lightweight schema module;
- hardening `EnnExecutor` teardown after partial or failed initialization;
- fixing portable `size_t` formatting and Android variadic logging.

`EnnExecutor` now avoids model and buffer cleanup before successful initialization or model creation, releases buffers only when an allocation exists, and still closes a valid model when no buffers were allocated. Android logging copies the `va_list` and uses `__android_log_vprint` before writing separately to stderr.

Existing E9955 and E9965 behavior is unchanged. The backend continues to load ENN dynamically from the device and does not bundle vendor binaries. This is backend infrastructure and contains no application, model, asset, device-eligibility, or rollout policy.

## Authorship

Authored with Codex.

Test Plan:
## Test plan

- Unit tests passed for compile-spec serialization of E9945, E9955, and E9965, including case-insensitive E9945 lookup (2 tests).
- Built the Samsung host-side AOT and Android ENN runtime/static-registration targets.
- On E9945 hardware, loaded an ExecuTorch program with one ENN delegate and observed successful model open, commit, and execution.
- Verified output matched the reference within the expected tolerance and placement logs confirmed NPU participation.
- With the ENN runtime library unavailable, verified the backend returned a clean initialization error and the process remained alive.
- Lint and format checks passed.

Reviewed By: sivapatibandla

Differential Revision: D124906831

Pulled By: alirezamonfared




Signed-off-by: Ali Monfared <2058201+alirezamonfared@users.noreply.github.com>
alirezamonfared added a commit to alirezamonfared/executorch that referenced this pull request Nov 3, 2026
Summary:

## Summary

This change improves the Samsung ENN backend integration by:

- adding E9945 to `SamsungChipset` and testing compile-spec serialization for every supported chipset;
- adding host-side AOT and Android runtime build targets, including static backend registration;
- importing `CompileSpec` from the lightweight schema module;
- hardening `EnnExecutor` teardown after partial or failed initialization;
- fixing portable `size_t` formatting and Android variadic logging.

`EnnExecutor` now avoids model and buffer cleanup before successful initialization or model creation, releases buffers only when an allocation exists, and still closes a valid model when no buffers were allocated. Android logging copies the `va_list` and uses `__android_log_vprint` before writing separately to stderr.

Existing E9955 and E9965 behavior is unchanged. The backend continues to load ENN dynamically from the device and does not bundle vendor binaries. This is backend infrastructure and contains no application, model, asset, device-eligibility, or rollout policy.

## Authorship

Authored with Codex.

Test Plan:
## Test plan

- Unit tests passed for compile-spec serialization of E9945, E9955, and E9965, including case-insensitive E9945 lookup (2 tests).
- Built the Samsung host-side AOT and Android ENN runtime/static-registration targets.
- On E9945 hardware, loaded an ExecuTorch program with one ENN delegate and observed successful model open, commit, and execution.
- Verified output matched the reference within the expected tolerance and placement logs confirmed NPU participation.
- With the ENN runtime library unavailable, verified the backend returned a clean initialization error and the process remained alive.
- Lint and format checks passed.

Reviewed By: sivapatibandla

Differential Revision: D124906831

Pulled By: alirezamonfared
Summary:

## Summary

This change improves the Samsung ENN backend integration by:

- adding E9945 to `SamsungChipset` and testing compile-spec serialization for every supported chipset;
- adding host-side AOT and Android runtime build targets, including static backend registration;
- importing `CompileSpec` from the lightweight schema module;
- hardening `EnnExecutor` teardown after partial or failed initialization;
- fixing portable `size_t` formatting and Android variadic logging.

`EnnExecutor` now avoids model and buffer cleanup before successful initialization or model creation, releases buffers only when an allocation exists, and still closes a valid model when no buffers were allocated. Android logging copies the `va_list` and uses `__android_log_vprint` before writing separately to stderr.

Existing E9955 and E9965 behavior is unchanged. The backend continues to load ENN dynamically from the device and does not bundle vendor binaries. This is backend infrastructure and contains no application, model, asset, device-eligibility, or rollout policy.

## Authorship

Authored with Codex.

Test Plan:
## Test plan

- Unit tests passed for compile-spec serialization of E9945, E9955, and E9965, including case-insensitive E9945 lookup (2 tests).
- Built the Samsung host-side AOT and Android ENN runtime/static-registration targets.
- On E9945 hardware, loaded an ExecuTorch program with one ENN delegate and observed successful model open, commit, and execution.
- Verified output matched the reference within the expected tolerance and placement logs confirmed NPU participation.
- With the ENN runtime library unavailable, verified the backend returned a clean initialization error and the process remained alive.
- Lint and format checks passed.

Reviewed By: sivapatibandla

Differential Revision: D124906831

Pulled By: alirezamonfared

This branch has not been deployed

No deployments
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant