onnxruntime/js/web/lib/wasm/jsep
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
..
webgpu [JS/WebGPU] fix an error in Clip (#18799) 2023-12-19 13:51:01 -08:00
backend-webgpu.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
init.ts [js/web] revise backend registration (#18715) 2023-12-20 14:45:55 -08:00
log.ts [js/webgpu] support proxy for webgpu (#15851) 2023-05-15 16:23:13 -07:00
tensor-view.ts [js/web] revise TensorView (#17473) 2023-09-14 21:14:44 -07:00
util.ts [js/webgpu] allow 0 sized tensor for tensor view (#16540) 2023-06-30 12:05:04 -07:00