onnxruntime/js/web/lib/wasm
Yulong Wang 9a61388f0a
[js/web] revise backend registration (#18715)
### Description
This PR revises the backend registration.

The following describes the expected behavior after this change:
(**bolded are changed behavior**)

- (ort.min.js - built without webgpu support)
    - loading: do not register 'webgpu' backend
- creating session without EP list: use default EP list ['webnn', 'cpu',
'wasm']
- creating session with ['webgpu'] as EP list: should fail with backend
not available
- (ort.webgpu.min.js - built with webgpu support)
    - loading: **always register 'webgpu' backend**
( previous behavior: only register 'webgpu' backend when `navigator.gpu`
is available)
- creating session without EP list: use default EP list ['webgpu',
'webnn', 'cpu', 'wasm']
        - when WebGPU is available (win): use WebGPU backend
- when WebGPU is unavailable (android): **should fail backend init,**
and try to use next backend in the list, 'webnn'
(previous behavior: does not fail backend init, but fail in JSEP init,
which was too late to switch to next backend)
    - creating session with ['webgpu'] as EP list
        - when WebGPU is available (win): use WebGPU backend
- when WebGPU is unavailable (android): **should fail backend init, and
because no more EP listed, fail.


related PRs: #18190 #18144
2023-12-20 14:45:55 -08:00
..
binding [js/web/training] Add CreateTrainingSession (#17891) 2023-10-26 09:22:10 -07:00
jsep [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
proxy-worker [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
proxy-messages.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
proxy-wrapper.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
run-options.ts [js/web] enable ONNX Runtime Web error messages in JS (#16335) 2023-06-15 09:45:41 -07:00
session-handler-inference.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
session-handler-training.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
session-options.ts [WebNN EP] Support numThreads option for WebNN CPU device (#18054) 2023-11-12 16:45:10 -08:00
wasm-common.ts [js/webgpu] support IO binding (#17480) 2023-09-29 11:24:42 -07:00
wasm-core-impl.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
wasm-factory.ts Add "glue" between training WASM artifacts and training web (#17474) 2023-10-12 11:16:56 -07:00
wasm-training-core-impl.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
wasm-utils.ts [js/web] enable ONNX Runtime Web error messages in JS (#16335) 2023-06-15 09:45:41 -07:00