microsoft / webnn-developer-preview

MIT License
33 stars 7 forks source link

Stable Diffusion Turbo DOMException #13

Open andyricchuiti opened 1 month ago

andyricchuiti commented 1 month ago

When running https://microsoft.github.io/webnn-developer-preview/demos/sd-turbo/, i receive DOMException: Failed to execute 'build' on 'MLGraphBuilder': Unsupported operator expand

I'm running on Chrome v126.0.6478.127 with "Enables WebNN API" on a 2021 M1 MacBook Pro with 16GB Ram.

Am I doing something wrong? IMG_0668

ibelem commented 1 month ago

@andyricchuiti Sorry for late response, currently this demo is able to run on WebNN DirectML/GPU on Windows.

This demo requires "expand" and "layerNormalization" ops in UNet model, https://ibelem.github.io/netron/?url=https://huggingface.co/microsoft/sd-turbo-webnn/resolve/main/unet/model_layernorm.onnx (1.73 GB, need to load for a while)

Screenshot 2024-07-10 132608

For Chrome on MacBook, my recent update on https://webmachinelearning.github.io/webnn-status/ shows that the WebNN CoreML doesn't support "expand" and "layerNormalization" ops till now. Google Chrome team will work on these ops support. https://source.chromium.org/chromium/chromium/src/+/main:services/webnn/coreml/graph_builder_coreml.cc;l=819

When the required ops are supported in Chrome on CoreML/macOS, we will work with Microsoft closely to update WebNN Execution Provider of ONNX Runtime Web ASAP to make the demo work on Chrome/macOS.