webmachinelearning / webnn-polyfill

🧠⚙️ Web Neural Network API polyfill based on TensorFlow.js
https://www.npmjs.com/package/@webmachinelearning/webnn-polyfill
Apache License 2.0
101 stars 18 forks source link

WebGPU backend error: Binding size is smaller than the minimum binding size #230

Closed yyc-git closed 1 year ago

yyc-git commented 1 year ago

Hello everyone, Thanks for your great work!

relate to #229 , but this time I use webgpu backend

Now when I use input with 256*258 or 1280*720 size image and inference, it all error with the same error info:

Binding size (68) is smaller than the minimum binding size (72).
 - While validating entries[5] as a Buffer.
Expected entry layout: { binding: 5, visibility: ShaderStage::Compute, buffer: { type: BufferBindingType::Uniform, hasDynamicOffset: 0, minBindingSize: 72 } }
 - While validating [BindGroupDescriptor] against [BindGroupLayout]
 - While calling [Device].CreateBindGroup([BindGroupDescriptor]).

[Invalid BindGroup] is invalid.
 - While encoding [ComputePassEncoder].SetBindGroup(0, [Invalid BindGroup], 0, ...).

[Invalid CommandBuffer] is invalid.
    at ValidateObject (..\..\third_party\dawn\src\dawn\native\Device.cpp:689)
    at ValidateSubmit (..\..\third_party\dawn\src\dawn\native\Queue.cpp:444)

Binding size (124) is smaller than the minimum binding size (128).
 - While validating entries[3] as a Buffer.
Expected entry layout: { binding: 3, visibility: ShaderStage::Compute, buffer: { type: BufferBindingType::Uniform, hasDynamicOffset: 0, minBindingSize: 128 } }
 - While validating [BindGroupDescriptor] against [BindGroupLayout]
 - While calling [Device].CreateBindGroup([BindGroupDescriptor]).

'Chrome':1 Binding size (68) is smaller than the minimum binding size (72).
 - While validating entries[5] as a Buffer.
Expected entry layout: { binding: 5, visibility: ShaderStage::Compute, buffer: { type: BufferBindingType::Uniform, hasDynamicOffset: 0, minBindingSize: 72 } }
 - While validating [BindGroupDescriptor] against [BindGroupLayout]
 - While calling [Device].CreateBindGroup([BindGroupDescriptor]).

'Chrome':1 Binding size (68) is smaller than the minimum binding size (72).
 - While validating entries[5] as a Buffer.
Expected entry layout: { binding: 5, visibility: ShaderStage::Compute, buffer: { type: BufferBindingType::Uniform, hasDynamicOffset: 0, minBindingSize: 72 } }
 - While validating [BindGroupDescriptor] against [BindGroupLayout]
 - While calling [Device].CreateBindGroup([BindGroupDescriptor]).
BruceDai commented 1 year ago

this time I use webgpu backend

Sorry, current WebNN Polyfill API doesn't support WebGPU backend, we will support later.

yyc-git commented 1 year ago

Thanks for reply!