Closed Bug 1902076 Opened 1 year ago Closed 8 months ago

onnxruntime webgpu backend doesn't work in Firefox

Categories

(Core :: Graphics: WebGPU, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jrmuizel, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

(Keywords: webcompat:platform-bug)

This shows up on https://huggingface.co/spaces/Xenova/whisper-webgpu and https://huggingface.co/spaces/Xenova/experimental-phi3-webgpu.

In the console I see: Unsupported device: "webgpu". Should be one of: wasm"

Both of those pages are trying to use the webgpu backend of onnxruntime-web via transformers.js

Blocks: 1896071

WebGPU is not detected because it's not enabled in workers.

Depends on: webgpu-workers
Blocks: webgpu-apps

When I turn on WebGPU in workers I get a shader validation error and then a crash in nsGlobalWindowInner::GetConsole

Marking P1: popular demo

Severity: -- → S3
Priority: -- → P1

The crash mentioned by :jrmuizel in comment 2 happens while failing to get a console for the worker context. I wrote that code, and, unfortunately, I'm not surprised it doesn't work in worker contexts. Once that is fixed, we'll likely have workable diagnostics around shader validation errors. Filed a bug for this: https://bugzilla.mozilla.org/show_bug.cgi?id=1902117

On https://huggingface.co/spaces/Xenova/experimental-phi3-webgpu with Erich's fix for bug 1902117 I get the following shader validation errors:


Shader validation error: 
   ┌─ BlockwiseMatMulNBits:78:13
   │
78 │             word_offset += 2;
   │             ^^^^^^^^^^^^^^^^ naga::Expression [163]



Shader validation error: 
   ┌─ RotaryEmbedding:55:62
   │
55 │                 u32(i32(position_ids[position_ids_idx].x)) + select(0, bsnh[1], position_ids_idx == 0);
   │                                                              ^^^^^^ naga::Expression [43]



Shader validation error: 
   ┌─ Concat:40:3
   │  
40 │ ╭   fn calculateInputIndex(index: u32) -> u32 {
41 │ │     let sizeInConcatAxis = array<u32, 1u>(uniforms.sizeInConcatAxis0);
42 │ │     for (var i: u32 = 0u; i < 1; i += 1u ) {
43 │ │       if (index < sizeInConcatAxis[i]) {
   │ │                   ^^^^^^^^^^^^^^^^^^^ naga::Expression [12]
   · │
46 │ │     }
47 │ │     return 1u;
   │ ╰──────────────^ naga::Function [4]

:jrmuizel: :teoxoy and I have determined that those are because of incomplete automatic type conversions, which are tracked at bug 1829879.

Priority: P1 → P3

I currently get:

Error: no available backend found. ERR: [webgpu] TypeError: e.requestAdapterInfo is not a function

Chrome as of 131 gives the same requestAdapterInfo is not a function issue on whisper-wgpu

:jrmuizel: That was changed in Firefox to conform to spec. with bug 1919119. onnxruntime has fixed their upstream at microsoft/onnxruntime#21065 and released with 1.19.0, but it seems that xenova/whisper-web (which I think backs this demo) does not yet consume that fix.

Oh, actually, this issue is for onnxruntime; I think this has been resolved. Closing.

Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.