onnxruntime/js/web/lib/wasm/jsep
Enrico Galli 1e5bda88f0
[WebNN EP] Cache MLTensors between runs (#22278)
### Description
This change enables caching `MLTensor`s between inferences runs. This is
done by keeping a reference to `MLTensor`s alive after they have been
released. `MLTensor`s are only destroyed once the sessions goes out of
scope.

### Motivation and Context
Creating and destroying `MTensor`s on every run has a non-trivial
performance penalty. This performance penalty materializes when using
`ort.Tensors`[location=cpu] for inputs/outputs or when using the CPU EP
as a fallback EP for unsupported operators. The former could be
mitigated by developer using `ort.Tensors`[location=ml-tensor]. The
latter cannot be mitigated by developers.
2024-10-18 08:07:00 -07:00
..
webgpu [js/webgpu] Optimize matmulnbits (#22360) 2024-10-14 15:49:29 -07:00
webnn [WebNN EP] Cache MLTensors between runs (#22278) 2024-10-18 08:07:00 -07:00
backend-webgpu.ts [js/webgpu] fix external buffer registration (#22254) 2024-09-28 10:36:40 -07:00
backend-webnn.ts [WebNN EP] Cache MLTensors between runs (#22278) 2024-10-18 08:07:00 -07:00
init.ts [WebNN EP] Enable IO Bindings with MLTensor (#21301) 2024-09-27 17:24:21 -07:00
log.ts [js] change default formatter for JavaScript/TypeScript from clang-format to Prettier (#21728) 2024-08-14 16:51:22 -07:00
tensor-view.ts [js/webgpu] support float16 for Clip (#21584) 2024-08-28 13:19:20 -07:00
util.ts [js] change default formatter for JavaScript/TypeScript from clang-format to Prettier (#21728) 2024-08-14 16:51:22 -07:00