onnxruntime
67c2bc19 - [js/web] Forward WebGPU EP buffer cache mode options from JS (#29017)

Commit
51 days ago
[js/web] Forward WebGPU EP buffer cache mode options from JS (#29017) ### Description The native WebGPU EP already supports the buffer cache mode options (`ep.webgpuexecutionprovider.storageBufferCacheMode` and friends), but onnxruntime-web never forwarded them from `executionProviders`, so they were unreachable from JS. This adds `storageBufferCacheMode`, `uniformBufferCacheMode`, `queryResolveBufferCacheMode` and `defaultBufferCacheMode` to `WebGpuExecutionProviderOption` and forwards them to the EP the same way `validationMode` is forwarded today, with the values validated against the set the native side accepts. The options ride the existing `SessionOptionsAppendExecutionProvider` path, which prefixes each key into exactly the config entry the EP reads, so no native changes are needed. ### Motivation and Context Fixes #29016. For static shape models, `storageBufferCacheMode: 'simple'` reuses exact size buffers across runs instead of allocating new bucket sized ones, which the issue's repro shows cutting peak WebGPU memory by about 27 percent. Verified locally with tsc builds of js/common and js/web, prettier and eslint, the js/common unit tests, and type level checks that the new options compile and invalid values are rejected. --------- Signed-off-by: Samaresh Kumar Singh <ssam3003@gmail.com>
Author
Parents
Loading