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
* Fix bug in Transpose CUDA kernel (microsoft#7329)
* Fix permission error for ORTModule lock file (microsoft#7814)
* fix topo sort in quant tool (microsoft#7833)
* fix topo sort in quant tool
* add unit test and make the topo sort stable
* Relax tol for Conv1D fp16 test (microsoft#7844)
* Relax tol for Conv1D fp16 test
Co-authored-by: Sherlock Huang <bahuang@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
* Resolve issue with wrapped ORTModule load_state_dict (microsoft#7847)
* Encapsulate children modules inside a ModuleAccessor object to prevent erroneuos iteration over children while loading the state dictionary
* Add named_models, models, apply methods, change ModuleAccessor to ModuleMetadata and modify unit tests
* Change ModuleMetadata module getter logic, raise NotImplementedError for add_modules
* Add comment explaining why overriding _load_from_state_dict method is needed
* fixed bugs in packed mode and enable pack mode tests in ci (microsoft#7848)
* fixed bugs in packed mode and enable pack mode tests in ci
* removed unnecessary space
* pr comments
* pr comments
* disable an average pool test
* try disabling another avg pool
* disable more avg pool tests
* disable maxpool tests
* add environment variable to control default training package's local version (microsoft#7849)
* [js] update documents (microsoft#7852)
* [js] update documents
* escape double quotes
* update operators.md
* resolve comments
* Support bool type for Pad CPU (microsoft#7856)
* Initial commit
* update
* nit
* Include ORT C/C++ API headers in the ORT Mobile AAR package (microsoft#7858)
* Add header files of ort c/c++ api to aar package
* Move header file selection to cmake based on EP choice
* fix duplicated node name (microsoft#7865)
* Clean up CPU kernel definition for opset 13 Pad (microsoft#7867)
Co-authored-by: Hariharan Seshadri <[email protected]>
Co-authored-by: Thiago Crepaldi <[email protected]>
Co-authored-by: Yufeng Li <[email protected]>
Co-authored-by: Sherlock <[email protected]>
Co-authored-by: Sherlock Huang <bahuang@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: baijumeswani <[email protected]>
Co-authored-by: Tixxx <[email protected]>
Co-authored-by: liqunfu <[email protected]>
Co-authored-by: Yulong Wang <[email protected]>
Co-authored-by: Guoyu Wang <[email protected]>
Co-authored-by: Tianlei Wu <[email protected]>
-**required** extension: [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
37
+
38
+
- Chrome or Edge Browser
39
+
40
+
### Setup TypeScript development environment
41
+
42
+
In `<ORT_ROOT>/js`, run:
43
+
44
+
```
45
+
npm ci
46
+
```
47
+
48
+
This will install Clang-format and ESLint for code-formatting and linting features. This is a one-time setup unless a `git clean` is performed or folder `<ORT_ROOT>/js/node_modules` is removed manually.
49
+
50
+
### Using VSCode:
51
+
52
+
Use VSCode to open folder `<ORT_ROOT>/js`.
53
+
54
+
Make sure to open the correct folder to allow VSCode to load workspace configuration. Otherwise typescript and code formatter may not work as expected.
55
+
56
+
To populate typescript type declarations, in each project folder, run `npm ci`.
57
+
58
+
### Run code formatter and linter manually
59
+
60
+
In `<ORT_ROOT>/js`, use `npm run lint` to run ESLint , and use `npm run format` to run clang-format.
36
61
37
62
## onnxruntime-common
38
63
@@ -112,10 +137,6 @@ It should be able to consumed by from projects that uses NPM packages (through a
112
137
113
138
This project is a library for running ONNX models on browsers. It is the successor of [ONNX.js](https://github.com/Microsoft/onnxjs).
2.~~Follow [instructions](https://www.onnxruntime.ai/docs/how-to/build.html#apis-and-language-bindings) for building ONNX Runtime WebAssembly. (TODO: document is not ready. we are working on it.)~~
148
+
2.~~Follow [instructions](https://www.onnxruntime.ai/docs/how-to/build.html#apis-and-language-bindings) for building ONNX Runtime WebAssembly. (TODO: document is not ready. we are working on it. Please see steps described as below.)~~
128
149
129
-
in `<ORT_ROOT>/`, run either of the following commands to build WebAssembly:
150
+
in `<ORT_ROOT>/`, run one of the following commands to build WebAssembly:
130
151
131
152
```sh
132
153
# In windows, use 'build' to replace './build.sh'
133
154
134
155
# The following command build debug.
135
156
./build.sh --build_wasm
136
157
158
+
# The following command build debug with debug info.
To build with multi-thread support, append flag ` --enable_wasm_threads` to the command. Make sure to build both single-thread and multi-thread before next step.
165
+
To build with multi-thread support, append flag `--enable_wasm_threads` to the command. Make sure to build both single-thread and multi-thread before next step.
166
+
167
+
NOTE: You can also find latest build artifacts on [Windows WebAssembly CI Pipeline](https://dev.azure.com/onnxruntime/onnxruntime/_build?definitionId=161&_a=summary&repositoryFilter=1&branchFilter=4%2C4%2C4%2C4%2C4%2C4). Choose any build for master branch, download artifacts "Release_ort-wasm" and "Release_ort-wasm-threaded" and unzip.
142
168
143
169
3. Copy following files from build output folder to `<ORT_ROOT>/js/web/dist/`:
We use command `npm test` (test runner) and `npm run test:e2e` (E2E test) for tests in ONNXRuntime Web.
188
+
189
+
#### test runner
190
+
191
+
In folder `<ORT_ROOT>/js/web`,
192
+
193
+
- Run `npm test -- --help` for a full CLI instruction.
194
+
- Run `npm test -- <your-args> --debug` to run one or more test cases.
195
+
196
+
There are multiple levels of tests for ONNXRuntime Web:
197
+
198
+
- unit test: tests for individual components written in TypeScript. Launch unit test by:
199
+
```
200
+
npm test -- unittest
201
+
```
202
+
- model test: run a single model. The model folder should contains one .onnx model file and one or more folders for test cases, each folder contains several input*\*.pb and output*\*.pb as test data. Launch model test by:
203
+
```
204
+
npm test -- model <model_folder>
205
+
```
206
+
- op test: test a single operator. An op test is described in a `.jsonc` file which specify the operator type, its attributes and one or more test case(s), each includes a list of expected input tensor(s) and output tensor(s). The `.jsonc` file is located at `<ORT_ROOT>/js/web/test/data/ops`. Launch op test by:
207
+
208
+
```
209
+
npm test -- op <file_name>
210
+
```
211
+
212
+
- suite test: suite test includes unit test, a list of model tests and op tests. Launch suite test by:
213
+
```
214
+
npm test
215
+
```
216
+
217
+
#### E2E test
218
+
219
+
E2E test is for testing end-to-end package consuming. In this test, NPM packages for `onnxruntime-common` and `onnxruntime-web` are generated and a clean folder is used for installing packages. Then a simple mocha test is performed to make sure package can be consumed correctly.
220
+
221
+
To launch E2E test:
222
+
223
+
```
224
+
npm run test:e2e
225
+
```
226
+
227
+
### Debugging
228
+
229
+
#### Debugging TypeScript on Desktop/Chrome
230
+
231
+
To debug the code from test-runner on Chrome:
232
+
233
+
- Launch `npm test -- <your_args> --debug`. It opens an instance of Chrome browser.
234
+
- In the open Chrome browser, click the `DEBUG` button on the top-right of the page.
235
+
- In VSCode, click [side bar]->Run and Debug->select [Attach to Chrome]->click [Start Debugging] to attach.
236
+
- put breakpoints in source code, and Refresh the page to reload.
237
+
238
+
#### Debugging TypeScript on iOS/Safari
239
+
240
+
To debug on an Apple iOS device, please refer to the following steps:
241
+
242
+
- install [
243
+
RemoteDebug iOS WebKit Adapter](https://github.com/RemoteDebug/remotedebug-ios-webkit-adapter) by following its instructions.
244
+
- launch the adapter in commandline: `remotedebug_ios_webkit_adapter --port=9000`.
245
+
- in VSCode, select debug configuration `Remote Browser via Webkit Adaptor`.
246
+
- follow the steps above to debug.
247
+
248
+
#### Debugging TypeScript on Android/Chrome
249
+
250
+
To debug on an Android device, please refer to the following steps:
251
+
252
+
- Install [Android SDK Platform Tools](https://developer.android.com/studio/releases/platform-tools) and make sure `adb` is ready to use.
253
+
- Follow instructions in [Remote Debugging on Android](https://developer.chrome.com/devtools/docs/remote-debugging-legacy) to launch `adb`. Make sure to use port 9000 so that the existing debug configuration works.
254
+
- in VSCode, select debug configuration `Remote Browser via Webkit Adaptor`.
255
+
- follow the steps above to debug.
256
+
257
+
#### Debugging C/C++ for ONNX Runtime WebAssembly
258
+
259
+
To debug C/C++ code for ONNX Runtime WebAssembly, you need to build ONNX Runtime with debug info (see [Build](#Build-2)).
260
+
261
+
Currently debugging C/C++ code in WebAssembly is not supported in VSCode yet. Please follow [this instruction](https://developer.chrome.com/blog/wasm-debugging-2020/) to debug in browser devtool using extension [C/C++ DevTools Support (DWARF)](https://chrome.google.com/webstore/detail/cc%20%20-devtools-support-dwa/pdcpmagijalfljmkmjngeonclgbbannb).
262
+
263
+
### Generating Document
264
+
265
+
Use command `npm run build:doc` to generate the latest documents.
266
+
159
267
### Distribution
160
268
161
-
It should be able to consumed by both from projects that uses NPM packages (through a Node.js folder structure of `node_modules` folder that generated by `npm install onnxruntime-web`) and from a CDN service that serves a `.min.js` file and one or multiple `.wasm` file(s).
269
+
It should be able to consumed by both from projects that uses NPM packages (through a Node.js folder structure of `node_modules` folder that generated by `npm install onnxruntime-web`) and from a CDN service that serves a `ort.min.js` file and one or multiple `.wasm` file(s).
162
270
163
271
## onnxruntime-react-native
164
272
@@ -192,54 +300,61 @@ This project provides an ONNX Runtime React Native JavaScript library to run ONN
192
300
1. Set up an Android build environment referring to [instruction](https://www.onnxruntime.ai/docs/how-to/build.html#android)
193
301
194
302
2. In `<ORT_ROOT>`, run this python script to build ONNX Runtime Android archive file. In windows, this requires admin account to build. If an app uses a fixed set of models, refer to [instruction](https://www.onnxruntime.ai/docs/how-to/build.html#android) and build a mobile version package
3. This generates `onnxruntime-mobile-<version>.aar` in `<BUILD_DIRECTORY>/aar_out/MinSizeRel/com/microsoft/onnxruntime/onnxruntime-mobile/<version>`. Copy `aar` file into `<ORT_ROOT>/js/react_native/android/libs` and rename it as `onnxruntime.aar`
200
309
201
310
4. To verify, open Android Emulator and run this command from `<ORT_ROOT>/js/react_native/android`
311
+
202
312
```sh
203
313
adb shell am instrument -w ai.onnxruntime.react_native.test/androidx.test.runner.AndroidJUnitRunner
204
314
```
205
315
206
316
3. Build iOS ONNX Runtime package
207
317
208
318
1. Set up iOS build environment referring to [instruction](https://www.onnxruntime.ai/docs/how-to/build.html#ios).
209
-
319
+
210
320
2. Build ONNX Runtime library for iOS from `<ORT_ROOT>` using this command,
Copy `<ORT_ROOT>/build/iOS/MinSizeRel/MinSizeRel-iphoneos/libonnxruntime.<version>.dylib` file into `<ORT_ROOT>/js/react_native/ios/Libraries/onnxruntime/lib/iphoneos`
215
327
216
328
3. Clean up the previous build and build ONNX Runtime library for iOS Simulator from `<ORT_ROOT>`
Copy `<ORT_ROOT>/build/iOS/MinSizeRel/MinSizeRel-iphonesimulator/libonnxruntime.<version>.dylib` file into `<ORT_ROOT>/js/react_native/ios/Libraries/onnxruntime/lib/iphonesimulator`
221
-
335
+
222
336
4. Edit `onnxruntime-react-native.iphoneos.podspec` and `onnxruntime-react-native.iphonesimulator.podsepc` in `<ORT_ROOT>/js/react_native` to change a version of ONNX Runtime library.
0 commit comments