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 "glue" between training WASM artifacts and training web #17474

Merged
merged 10 commits into from
Oct 12, 2023

Conversation

carzh
Copy link
Contributor

@carzh carzh commented Sep 8, 2023

Description

  • follows the packaging approach according to the design document
    • adds ENABLE_TRAINING boolean flag to BUILD_DEFS
    • modifies package.json to include training submodule
    • modifies build script to handle, validate, and minimize training WASM artifacts
  • adds the binding for the new backend with training enabled & the new training artifacts
    • adds training backend
    • edits index.ts to use training backend depending on BUILD_DEFS
    • edits wasm-factory.ts to use the training artifacts if necessary

Motivation and Context

  • we are in the process of adding web bindings to enable training.
  • Adding the "glue" to allow onnxruntime-web to use the training WASM artifacts is required for this work.
  • Since BUILD_DEFS is defined and used at build time, I thought that it made sense to bundle the changes to building in the same PR.

Related work

js/web/webpack.config.js Outdated Show resolved Hide resolved
@carzh carzh requested a review from fs-eire September 25, 2023 23:36
@carzh carzh force-pushed the carzh/training-wasm-binding branch from 9885866 to 5adbcf4 Compare October 2, 2023 22:01
js/web/script/build.ts Outdated Show resolved Hide resolved
js/web/script/build.ts Outdated Show resolved Hide resolved
js/web/script/build.ts Outdated Show resolved Hide resolved
@carzh
Copy link
Contributor Author

carzh commented Oct 12, 2023

/azp run ONNX Runtime React Native CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@carzh carzh merged commit c373a80 into microsoft:main Oct 12, 2023
50 of 52 checks passed
carzh added a commit that referenced this pull request Oct 26, 2023
### Description
* Adds TrainingSession.create() functionality following the web bindings
for training design doc
* Added 2 new training APIs to wasm/api.h:
   * OrtTrainingGetInputOutputName
   * OrtTrainingGetInputOutputCount
* Moved isOrtEnvInitialized boolean to the wasm-core-impl and added a
method that references it

### Motivation and Context
* Adding web bindings for training

#### Related work
* #16521 allowed for training artifacts to be built
* #17333 added interfaces for training
* #17474 allows for training package to be built + adds training backend
to web package **[MUST BE MERGED IN BEFORE THIS ONE]**

---------

Co-authored-by: Yulong Wang <[email protected]>
Co-authored-by: Ashwini Khade <[email protected]>
carzh added a commit that referenced this pull request Nov 2, 2023
### Description
* based on design document & following InferenceSession's run
implementation, implemented TrainingSession.runTrainStep

### Motivation and Context
* Adding web bindings for training

#### Related work
* #16521 allowed for training artifacts to be built
* #17333 added interfaces for training
* #17474 allowed for training package to be built + added training
backend to web package
* #17891 implementation for createTrainingSession on the TypeScript side
**[SHOULD BE MERGED IN BEFORE THIS PR]**

---------

Co-authored-by: Yulong Wang <[email protected]>
Co-authored-by: Ashwini Khade <[email protected]>
@carzh carzh deleted the carzh/training-wasm-binding branch December 20, 2023 22:32
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
…t#17474)

### Description
* follows the packaging approach according to the design document
    * adds `ENABLE_TRAINING` boolean flag to `BUILD_DEFS`
    * modifies `package.json` to include training submodule
* modifies build script to handle, validate, and minimize training WASM
artifacts
* adds the binding for the new backend with training enabled & the new
training artifacts
    * adds training backend
    * edits `index.ts` to use training backend depending on `BUILD_DEFS`
    * edits `wasm-factory.ts` to use the training artifacts if necessary

### Motivation and Context
* we are in the process of adding web bindings to enable training. 
* Adding the "glue" to allow onnxruntime-web to use the training WASM
artifacts is required for this work.
* Since BUILD_DEFS is defined and used at build time, I thought that it
made sense to bundle the changes to building in the same PR.
#### Related work
* microsoft#16521 allowed for training artifacts to be built
* microsoft#17333 must be merged in before this one

---------

Co-authored-by: Yulong Wang <[email protected]>
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
### Description
* Adds TrainingSession.create() functionality following the web bindings
for training design doc
* Added 2 new training APIs to wasm/api.h:
   * OrtTrainingGetInputOutputName
   * OrtTrainingGetInputOutputCount
* Moved isOrtEnvInitialized boolean to the wasm-core-impl and added a
method that references it

### Motivation and Context
* Adding web bindings for training

#### Related work
* microsoft#16521 allowed for training artifacts to be built
* microsoft#17333 added interfaces for training
* microsoft#17474 allows for training package to be built + adds training backend
to web package **[MUST BE MERGED IN BEFORE THIS ONE]**

---------

Co-authored-by: Yulong Wang <[email protected]>
Co-authored-by: Ashwini Khade <[email protected]>
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
### Description
* based on design document & following InferenceSession's run
implementation, implemented TrainingSession.runTrainStep

### Motivation and Context
* Adding web bindings for training

#### Related work
* microsoft#16521 allowed for training artifacts to be built
* microsoft#17333 added interfaces for training
* microsoft#17474 allowed for training package to be built + added training
backend to web package
* microsoft#17891 implementation for createTrainingSession on the TypeScript side
**[SHOULD BE MERGED IN BEFORE THIS PR]**

---------

Co-authored-by: Yulong Wang <[email protected]>
Co-authored-by: Ashwini Khade <[email protected]>
siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this pull request May 9, 2024
…t#17474)

### Description
* follows the packaging approach according to the design document
    * adds `ENABLE_TRAINING` boolean flag to `BUILD_DEFS`
    * modifies `package.json` to include training submodule
* modifies build script to handle, validate, and minimize training WASM
artifacts
* adds the binding for the new backend with training enabled & the new
training artifacts
    * adds training backend
    * edits `index.ts` to use training backend depending on `BUILD_DEFS`
    * edits `wasm-factory.ts` to use the training artifacts if necessary

### Motivation and Context
* we are in the process of adding web bindings to enable training. 
* Adding the "glue" to allow onnxruntime-web to use the training WASM
artifacts is required for this work.
* Since BUILD_DEFS is defined and used at build time, I thought that it
made sense to bundle the changes to building in the same PR.
#### Related work
* microsoft#16521 allowed for training artifacts to be built
* microsoft#17333 must be merged in before this one

---------

Co-authored-by: Yulong Wang <[email protected]>
siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this pull request May 9, 2024
### Description
* Adds TrainingSession.create() functionality following the web bindings
for training design doc
* Added 2 new training APIs to wasm/api.h:
   * OrtTrainingGetInputOutputName
   * OrtTrainingGetInputOutputCount
* Moved isOrtEnvInitialized boolean to the wasm-core-impl and added a
method that references it

### Motivation and Context
* Adding web bindings for training

#### Related work
* microsoft#16521 allowed for training artifacts to be built
* microsoft#17333 added interfaces for training
* microsoft#17474 allows for training package to be built + adds training backend
to web package **[MUST BE MERGED IN BEFORE THIS ONE]**

---------

Co-authored-by: Yulong Wang <[email protected]>
Co-authored-by: Ashwini Khade <[email protected]>
siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this pull request May 9, 2024
### Description
* based on design document & following InferenceSession's run
implementation, implemented TrainingSession.runTrainStep

### Motivation and Context
* Adding web bindings for training

#### Related work
* microsoft#16521 allowed for training artifacts to be built
* microsoft#17333 added interfaces for training
* microsoft#17474 allowed for training package to be built + added training
backend to web package
* microsoft#17891 implementation for createTrainingSession on the TypeScript side
**[SHOULD BE MERGED IN BEFORE THIS PR]**

---------

Co-authored-by: Yulong Wang <[email protected]>
Co-authored-by: Ashwini Khade <[email protected]>
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.

3 participants