Skip to content

Update HiFi1 to use nnlib (#17676)#17676

Merged
meta-codesync[bot] merged 1 commit intomainfrom
export-D94179206
Mar 20, 2026
Merged

Update HiFi1 to use nnlib (#17676)#17676
meta-codesync[bot] merged 1 commit intomainfrom
export-D94179206

Conversation

@mcremon-meta
Copy link
Copy Markdown
Contributor

@mcremon-meta mcremon-meta commented Feb 24, 2026

Summary:

As titled. Was falling back on xtensa.
Adds a few fixes to some operators to enable the build for all cases.

Differential Revision: D94179206

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Feb 24, 2026

🔗 Helpful Links

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

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 034a40e with merge base 2548ee1 (image):

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

BROKEN TRUNK - The following job 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 Feb 24, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Feb 24, 2026

@mcremon-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94179206.

@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.

@mcremon-meta
Copy link
Copy Markdown
Contributor Author

@dijopaul @cad-audio can you take a look please? :)

#include "xa_nnlib_err_chk.h"

// HiFi1 compatibility: int32_rtor_xtbool2 is not available on HiFi1
#ifndef int32_rtor_xtbool2
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.

I think this is not needed. Can remove this line
xtbool2 con = int32_rtor_xtbool2(0x00000003);
the vaiable not used


// HiFi1 compatibility: AE_MOVAB is not available on HiFi1
#ifndef AE_MOVAB
static inline unsigned char AE_MOVAB(xtbool b) {
Copy link
Copy Markdown
Contributor

@dijopaul dijopaul Feb 25, 2026

Choose a reason for hiding this comment

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

Can use the below code

#ifndef AE_MOVAB
#ifdef AE_MOVAB1
#define AE_MOVAB AE_MOVAB1
#else
#define AE_MOVAB(x) (x)
#endif
#endif

#ifndef AE_MOVAB2
#define AE_MOVAB2(x) (x)
#endif

@dijopaul
Copy link
Copy Markdown
Contributor

@dijopaul @cad-audio can you take a look please? :)

The root cause here is that we are using local implementations outside nnlib (which is hifi4 specific). The latest nnlib has all these implementation inside including hifi1 support. So better solution is to upgrade to latest nnlib and avoid these local files. We will make a PR for the same. This may involve some changes in API calls as well due to minor changes in API names.

@mcremon-meta
Copy link
Copy Markdown
Contributor Author

@dijopaul @cad-audio can you take a look please? :)

The root cause here is that we are using local implementations outside nnlib (which is hifi4 specific). The latest nnlib has all these implementation inside including hifi1 support. So better solution is to upgrade to latest nnlib and avoid these local files. We will make a PR for the same. This may involve some changes in API calls as well due to minor changes in API names.

I see, makes sense. Are some of those changes on our side, or if you open a PR to update the lib, we get things for free on our end? If that's the case, we can wait a little bit

@cad-audio
Copy link
Copy Markdown
Contributor

@dijopaul @cad-audio can you take a look please? :)

The root cause here is that we are using local implementations outside nnlib (which is hifi4 specific). The latest nnlib has all these implementation inside including hifi1 support. So better solution is to upgrade to latest nnlib and avoid these local files. We will make a PR for the same. This may involve some changes in API calls as well due to minor changes in API names.

I see, makes sense. Are some of those changes on our side, or if you open a PR to update the lib, we get things for free on our end? If that's the case, we can wait a little bit

We will create a PR for nnlib update after verifying the build on HiFi1. We will target this on this week

@mcremon-meta
Copy link
Copy Markdown
Contributor Author

@dijopaul @cad-audio can you take a look please? :)

The root cause here is that we are using local implementations outside nnlib (which is hifi4 specific). The latest nnlib has all these implementation inside including hifi1 support. So better solution is to upgrade to latest nnlib and avoid these local files. We will make a PR for the same. This may involve some changes in API calls as well due to minor changes in API names.

I see, makes sense. Are some of those changes on our side, or if you open a PR to update the lib, we get things for free on our end? If that's the case, we can wait a little bit

We will create a PR for nnlib update after verifying the build on HiFi1. We will target this on this week

Sounds good! Thanks :)

@meta-codesync meta-codesync bot changed the title Update HiFi1 to use nnlib Update HiFi1 to use nnlib (#17676) Mar 19, 2026
meta-codesync bot pushed a commit that referenced this pull request Mar 19, 2026
Summary:

As titled. Was falling back on xtensa.
Adds a few fixes to some operators to enable the build for all cases.

Differential Revision: D94179206
Summary:
Pull Request resolved: #17676

As titled. Was falling back on xtensa.
Adds a few fixes to some operators to enable the build for all cases.

Differential Revision: D94179206
@aliafzal aliafzal self-requested a review March 20, 2026 00:27
@meta-codesync meta-codesync bot merged commit e2d3ca7 into main Mar 20, 2026
138 of 146 checks passed
@meta-codesync meta-codesync bot deleted the export-D94179206 branch March 20, 2026 06:38
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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants