### Description
<!-- Describe your changes. -->
As title.
Validation at JS call level in E2E app is not included. Can cover
together in a separate pr.
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Test coverage.
---------
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
A couple of places in onnxruntime used `float_t` data type alias as an
alternative to `float`. However, this is not entirely correct, since
`float_t` is an implementation-defined type alias, which may be `float`,
`double`, `long double` or some other implementation-defined data type,
depending on the state of the internal `FLT_EVAL_METHOD` macro:
https://en.cppreference.com/w/c/numeric/math/float_t
On most major platforms and compilers (clang, GCC, MSVC) this is only a
cosmetic change and will not lead to any changes. However, icpx compiler
(and legacy icc) tends to substitute `float_t` with `long double`,
resulting in a linker error (unresolved reference) to the base onnx
library, that only contains the `ParseData` function for `float` and
`double` as in
[here](9264e09367/onnx/defs/tensor_proto_util.cc (L133-L134)).
Overall, this PR cleans up the implementation-defined behaviour and
enables building onnxruntime with icpx.
### Description
<!-- Describe your changes. -->
This PR adds support for `executionProviders` option for react-native
package, support:
- Android: cpu / xnnpack / nnapi
- iOS: cpu / xnnpack / coreml
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
In my case I want to enable Core ML / NNAPI EP for react-native project.
### Description
<!-- Describe your changes. -->
- Create `OnnxruntimeJSIHelper` native module to provide two JSI
functions
- `jsiOnnxruntimeStoreArrayBuffer`: Store buffer in Blob Manager &
return blob object (iOS: RCTBlobManager, Android: BlobModule)
- `jsiOnnxruntimeResolveArrayBuffer`: Use blob object to get buffer
- The part of implementation is reference to
[react-native-blob-jsi-helper](https://github.com/mrousavy/react-native-blob-jsi-helper)
- Replace base64 encode/decode
- `loadModelFromBlob`: Rename from `loadModelFromBase64EncodedBuffer`
- `run`: Use blob object to replace input.data & results[].data
For [this
context](https://github.com/microsoft/onnxruntime/issues/16031#issuecomment-1556527812),
it saved a lot of time and avoid JS thread blocking in decode return
type, it is 3700ms -> 5~20ms for the case. (resolve function only takes
0.x ms)
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
It’s related to #16031, but not a full implementation for migrate to
JSI.
It just uses JSI through BlobManager to replace the slow part (base64
encode / decode).
Rewriting it entirely in JSI could be complicated, like type convertion
and threading. This PR might be considered a minor change.
/cc @skottmckay
### Description
<!-- Describe your changes. -->
Implement `dispose` react native method.
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Currently we are not able to release the memory used by model in JS
runtime if we don't want to use it anymore, we can do that only by
reload app on debug or restart app on release.
### Description
<!-- Describe your changes. -->
Identified the cause for a `redefinition compilation error` happened in
a react native expo app with ort-extensions enabled when running the ios
side. Fix the include path now, so we can remove the temporary forward
declaration in OnnxruntimeModule.mm file.
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Fix implementation detail.
---------
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
### Description
<!-- Describe your changes. -->
js/react_native package dependency change to manage ort-extensions for
react-native app.
Enable optional inclusion of ort-ext aar/ ort-ext pods for react-native
extensions apps when specifiy `ortExtensionsEnabled` in user's
package.json file
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
---------
Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
### Description
<!-- Describe your changes. -->
-Add support for loading model from buffer on iOS
-Update OnnxruntimeModuleTest to use updated loadModelFromBuffer
Based on #12676
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Issue: #12500
---------
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
### Description
<!-- Describe your changes. -->
Integrate react native e2e test framework with detox.
https://wix.github.io/Detox/
Good build in CI:
https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=946695&view=results
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Write cross-platform end-to-end tests in JavaScript.
Resolve flaky e2e tests in react native ci pipelines.
---------
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
### Description
<!-- Describe your changes. -->
As title.
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Uint8 type might be required for some model used in sample application.
To match supported data types for onnxruntime-react-native for Android.
Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
**Description**:
Use full ORT package for onnxruntime-react-native.
Left the params required for the mobile build in comments so they're
easily discovered if we need to create onnxruntime-react-native-mobile
in the future.
**Motivation and Context**
Remove barrier to using ORT with react native as the mobile package that
was being used supports a limited range of opsets/operators/types, and
requires ORT format models. The full package will run any model.
# Motivation
Currently, ORT minimal builds use kernel def hashes to map from nodes to
kernels to execute when loading the model. As the kernel def hashes must
be known ahead of time, this works for statically registered kernels.
This works well for the CPU EP.
For this approach to work, the kernel def hashes must also be known at
ORT format model conversion time, which means the EP with statically
registered kernels must also be enabled then. This is not an issue for
the always-available CPU EP. However, we do not want to require that any
EP which statically registers kernels is always available too.
Consequently, we explore another approach to match nodes to kernels that
does not rely on kernel def hashes. An added benefit of this is the
possibility of moving away from kernel def hashes completely, which
would eliminate the maintenance burden of keeping the hashes stable.
# Approach
In a full build, ORT uses some information from the ONNX op schema to
match a node to a kernel. We want to avoid including the ONNX op schema
in a minimal build to reduce binary size. Essentially, we take the
necessary information from the ONNX op schema and make it available in a
minimal build.
We decouple the ONNX op schema from the kernel matching logic. The
kernel matching logic instead relies on per-op information which can
either be obtained from the ONNX op schema or another source.
This per-op information must be available in a minimal build when there
are no ONNX op schemas. We put it in the ORT format model.
Existing uses of kernel def hashes to look up kernels are replaced
with the updated kernel matching logic. We no longer store
kernel def hashes in the ORT format model’s session state and runtime
optimization representations. We no longer keep the logic to
generate and ensure stability of kernel def hashes.
* Pipeline for ONNX Runtime react native
* Fix a test failure
* test with custom built binaries
* add onnxruntime-common package back
* don't bob build when bootstrap
* revise Android test
* rename example to e2e
* remove onnxruntime packages from package.json
* remove release-it package
* upgrade gradle version to the same as CI
* add a pipeline for react native
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* android and ios mobile build for react native e2e
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* use android aar package template
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* use android aar package template
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* publish ios test results
* add e2e tests and publish a npm package
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* remove aar from npm package
* wait for view displayed
* change a waiting logic
* increase wait time for app launching
* give more time to launch an app
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* disable metro server on testing
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* test ios simulator launching
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* fix iOS e2e test
* use a publishing version of npm packages
* make pretty
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* make only one onnxruntime-common package after packaging
* make a powershell script of packaging universal
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Add a warning for file changes during a test
* clean up
* fix lint errors
* fix js npm packaging
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* Update mac-react-native-ci-pipeline.yml for Azure Pipelines
* resolve comments
* fix a typo
* Change full ort to mobile ort
* Update Android example to load mobile ort
* Change the format of test models to ort
* update ios to use mobile ort
* revise README
* use onnxruntime-mobile-c CocoaPods in a npm package
* onnxruntime react native binding
* add react native backend
* fix lint comments
* fix react native backend for ios
* remove unnecessary files to check in
* move onnxruntime-common to devDependency
* create two podspec files for iphoneos and iphonesimulator
* revise README.md and add third party notices for react native
* rename a package
* rename a package and revise README
* add a license into package.json
* revise README and comments
* fix typo
* fix lint errors
* fix lint errors
* add a prepack script. touch index.tsx and App.tsx to resolve CI issue
* remove a unsupported tsx format from clang-format
* fix a type and add steps tp publish a react native npm package
* resolve comments
* fix clang format
* remove promise wrap. change prepack to typescript