You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I’m gradually migrating my app projects to New Architecture. While the new architecture still supports legacy bridge for “module”, but usually there will be a lot of calls with onnxruntime-react-native, the new Turbo Native Module will help to improve the performance, so I make it a high priority in my work. These are what I did in this PR:
For E2E project, it needs to enable the new architecture for the entire app project to test the changes
In React Native v0.69, it requires complex setup to enable new architecture. Starting with 0.71 it just need one flag to enable, so I upgrade the project to 0.71 version by template. (Currently Detox is supported React Native <= v0.71)
It’s still old-arch compatible for module, so I haven’t change the MNISTDataHandler demo module
The project still use old-arch by default, Detox probably not supported yet for new-arch
I still use RN v0.69 for react_native unit tests, it has some build issues from v0.71 on Android
Motivation and Context
Related #16031 because the interface of Turbo Native Module is based on JSI. I still keep JSIHelper because Turbo Module’s type conversation still does not seem to support buffer.
With new architecture enabled, It improve latency issue from bridge I mentioned in #16031 (comment), the latency obvious drop in my cases.
another general question: If I understand correctly, to enable the new architecture for testing:
On Android, need to set buildconfig.IS_NEW_ARCHITECTURE_ENABLED (which is defined in build.gradle) and this option can also be passed into ./gradlew command?
For E2E project, you can change newArchEnabled=false to true.
On iOS, just need to set the ENV and uncomment the lines in Podfile?
# Use New Architecture
# ENV['RCT_NEW_ARCH_ENABLED'] = '1'
platform:mobileissues related to ONNX Runtime mobile; typically submitted using template
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I’m gradually migrating my app projects to New Architecture. While the new architecture still supports legacy bridge for “module”, but usually there will be a lot of calls with onnxruntime-react-native, the new Turbo Native Module will help to improve the performance, so I make it a high priority in my work. These are what I did in this PR:
lib/NativeOnnxruntime.ts
is necessary.{}
forSessionOptions
andRunOptions
.I still use RN v0.69 for react_native unit tests, it has some build issues from v0.71 on AndroidMotivation and Context
Related #16031 because the interface of Turbo Native Module is based on JSI. I still keep JSIHelper because Turbo Module’s type conversation still does not seem to support buffer.
With new architecture enabled, It improve latency issue from bridge I mentioned in #16031 (comment), the latency obvious drop in my cases.