Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wasi_ephemeral_nn module support #3241

Merged
merged 3 commits into from
Mar 21, 2024

Conversation

AuYang261
Copy link
Contributor

Add wasi_ephemeral_nn module support with optional cmake variable, which mentioned in #3229.

@wenyongh
Copy link
Contributor

@tonibofarull could you help review this PR? Thanks a lot.

Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 570 to 578
if (!wasm_native_register_natives("wasi_nn", native_symbols,
n_native_symbols))
goto fail;
#if WASM_ENABLE_WASI_EPHEMERAL_NN != 0
n_native_symbols = get_wasi_ephemeral_nn_export_apis(&native_symbols);
if (!wasm_native_register_natives("wasi_ephemeral_nn", native_symbols,
n_native_symbols))
goto fail;
#endif /* WASM_ENABLE_WASI_EPHEMERAL_NN != 0 */
Copy link
Contributor

Choose a reason for hiding this comment

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

I strongly believe that we shouldn't replicate the code but instead define here wasi_nn or wasi_ephemeral_nn as part of the configuration.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just FYI, in wasi-nn, both rust api and assembly script api are using "wasi_ephemeral_nn" as its one and only import name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Before deprecating wasi_nn I'd give the option to select one or the other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just FYI, in wasi-nn, both rust api and assembly script api are using "wasi_ephemeral_nn" as its one and only import name.

Do you mean wasi_nn and wasi_ephemeral_nn only need to be registered one and only one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I strongly believe that we shouldn't replicate the code but instead define here wasi_nn or wasi_ephemeral_nn as part of the configuration.

It seems there are slight difference in this file between original wasi_nn_xx() and newly added wasi_ephemeral_nn_xx(). I am wondering can merge both?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd consider on supporting only 1 at a time and update the implementation of wasi_nn_xx and wasi_ephemeral_nn, if there are any.

@wenyongh
Copy link
Contributor

@AuYang261 I have just merged PR #3246 to disable running CodeQL CI on each pull request, or it will run for a long time and fail eventually. Could you please rebase your branch with WAMR main?

@AuYang261
Copy link
Contributor Author

@AuYang261 I have just merged PR #3246 to disable running CodeQL CI on each pull request, or it will run for a long time and fail eventually. Could you please rebase your branch with WAMR main?

No problem.

Copy link
Contributor

@tonibofarull tonibofarull left a comment

Choose a reason for hiding this comment

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

I'd like to verify later on why there's this drift from one to the other.

@wenyongh wenyongh merged commit cef88de into bytecodealliance:main Mar 21, 2024
384 checks passed
@wenyongh
Copy link
Contributor

@AuYang261, @tonibofarull the code seems good now, I merged the PR. Please submit a new PR to enhance it if needed.

@AuYang261 AuYang261 deleted the dev/wasi_ephemeral_nn branch March 22, 2024 06:53
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Add `wasi_ephemeral_nn` module support with optional cmake variable,
which was mentioned in bytecodealliance#3229.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants