Skip to content

Commit

Permalink
[js/web] remove training release (#22103)
Browse files Browse the repository at this point in the history
### Description

Remove training from onnxruntime-web

Following up of #22082
  • Loading branch information
fs-eire authored Sep 16, 2024
1 parent e93f14e commit 291a535
Show file tree
Hide file tree
Showing 20 changed files with 15 additions and 1,544 deletions.
5 changes: 0 additions & 5 deletions js/web/lib/backend-wasm-inference.ts

This file was deleted.

29 changes: 0 additions & 29 deletions js/web/lib/backend-wasm-training.ts

This file was deleted.

2 changes: 2 additions & 0 deletions js/web/lib/backend-wasm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ export class OnnxruntimeWebAssemblyBackend implements Backend {
return Promise.resolve(handler);
}
}

export const wasmBackend = new OnnxruntimeWebAssemblyBackend();
4 changes: 1 addition & 3 deletions js/web/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ if (!BUILD_DEFS.DISABLE_WEBGL) {
}

if (!BUILD_DEFS.DISABLE_WASM) {
const wasmBackend = BUILD_DEFS.DISABLE_TRAINING
? require('./backend-wasm-inference').wasmBackend
: require('./backend-wasm-training').wasmBackend;
const wasmBackend = require('./backend-wasm').wasmBackend;
if (!BUILD_DEFS.DISABLE_JSEP) {
registerBackend('webgpu', wasmBackend, 5);
registerBackend('webnn', wasmBackend, 5);
Expand Down
198 changes: 0 additions & 198 deletions js/web/lib/wasm/session-handler-training.ts

This file was deleted.

9 changes: 4 additions & 5 deletions js/web/lib/wasm/wasm-core-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import { loadFile } from './wasm-utils-load-file';
* Refer to web/lib/index.ts for the backend registration.
*
* 2. WebAssembly artifact initialization.
* This happens when any registered wasm backend is used for the first time (ie. `ort.InferenceSession.create()` or
* `ort.TrainingSession.create()` is called). In this step, onnxruntime-web does the followings:
* This happens when any registered wasm backend is used for the first time (ie. `ort.InferenceSession.create()` is
* called). In this step, onnxruntime-web does the followings:
* - create a proxy worker and make sure the proxy worker is ready to receive messages, if proxy is enabled.
* - perform feature detection, locate correct WebAssembly artifact path and call the Emscripten generated
* JavaScript code to initialize the WebAssembly runtime.
Expand All @@ -57,9 +57,8 @@ import { loadFile } from './wasm-utils-load-file';
* - logging level (ort.env.logLevel) and thread number (ort.env.wasm.numThreads) are set in this step.
*
* 4. Session initialization.
* This happens when `ort.InferenceSession.create()` or `ort.TrainingSession.create()` is called. Unlike the first 3
* steps (they only called once), this step will be done for each session. In this step, onnxruntime-web does the
* followings:
* This happens when `ort.InferenceSession.create()` is called. Unlike the first 3 steps (they only called once),
* this step will be done for each session. In this step, onnxruntime-web does the followings:
* If the parameter is a URL:
* - download the model data from the URL.
* - copy the model data to the WASM heap. (proxy: 'copy-from')
Expand Down
Loading

0 comments on commit 291a535

Please sign in to comment.