[Web] Report `Buffer (unlabled) used in submit while destoryed` when enabling SDXL Turbo demo
Describe the issue
After debugging and investigating the issue, it may be related with Pre-Pack feature, the input tensor of Pre-Pack may be already deleted before the Pre-Pack kernels being submitted.
WebGPU need to prepare 16 kernels for one command buffer submitting. But there are only 11 nodes needing Pre-Pack in unet model, so it will not submit command buffer until next model uploads its weights. But the inputs' tensors of Pre-Pack are deleted immediately
| st->initialized_tensors_.erase(ort_value_idx); |
, and the buffer manager for initializers is BufferCacheMode::Disabled
| initializer_buffer_mgr_ = BufferManagerFactory::Create(*this, |
, so error happens.
To reproduce
Use webgpu (not JS) EP, run SDXL turbo demo https://github.com/Honry/webnn-developer-preview/blob/sdxl-turbo-pr/demos/sdxl-turbo/index.js, throws an error Buffer (unlabled) used in submit while destoryed in loadModels function when creating sessions.
Urgency
No response
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
Execution Provider
'webgpu' (WebGPU)