Description
openedon Oct 3, 2024
Describe the issue
My WebNN model was running 100x slower due to me using wrong argument names in freeDimensionOverrides. You can see the discussion here: microsoft/webnn-developer-preview#40
In my case I mistakenly wrote freeDimensionOverrides: { batch: 1, channels: 3, height: 512, width: 512 }
instead of correct freeDimensionOverrides: { batch_size: 1, num_channels: 3, height: 512, width: 512 }
, these caused optimizations not to work without explicit notification, and I did not know why my model is running so slowly. In my case I got the names completely wrong, but a similar issue could be caused by a simple typo.
I suggest that using wrong argument names would throw an error (or at least a warning). Also I suggest to emphasize in the docs that WebNN runs without optimizations unless you fix all free dimensions.
To reproduce
Inserting a typo in one of the arguments here https://github.com/eyaler/webnn-developer-preview/blob/main/demos/sd-turbo/index.js#L314 will causes the model to run 100x slower
Urgency
This may hinder WebNN dev onboarding
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.19.0-dev.20240804-ee2fe87e2d, 1.19.2, 1.20.0-dev.20240928-1bda91fc57
Execution Provider
Other / Unknown