Open Bug 1900273 Opened 1 year ago Updated 7 months ago

await mapAsync slow

Categories

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

Firefox 128
defect

Tracking

()

UNCONFIRMED

People

(Reporter: 6a224f5ada1867c791, Unassigned)

References

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

Details

Attachments

(1 file)

Attached file slow_mapAsync.html

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Steps to reproduce:

await readBuffer.mapAsync(GPUMapMode.READ);

(see attached HTML file)

Actual results:

Took 100ms for 3 floats.

Expected results:

Should take <1 ms (CuPy takes 0.02 ms)

Severity: -- → S3
Priority: -- → P3

+1 this is a blocker for using webgpu for compute on firefox. Unfortunately google dawn has other bugs that prevent using it as well, so if this issue is fixed, at least something would work :)

This issue also happens on macOS M1 arm64 computers, with a large slowdown using Firefox compared to Chrome and wgpu directly on native.

100ms is from https://searchfox.org/mozilla-central/source/dom/webgpu/ipc/WebGPUParent.cpp#37, currently firefox polls GPU devices only every 100ms, So I think this is duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1870699

That sounds like it is the problem. This ticket has the test example from the OP, so maybe good to link to it in that issue? I'm not sure what the protocol is here on bugzilla. Thanks!

How long would reading a buffer take if this was fixed as described in https://bugzilla.mozilla.org/show_bug.cgi?id=1870699 ? I am asking because it will decide whether a future project I am planning is tractable or not.

@John I don't have the answer to this but in our testing on Chrome it ran as fast as native, so in principle it should be possible to have a fully functional implementation, and hopefully that is the goal here.

This is definitely a symptom of bug 1870699.

John:

How long would reading a buffer take if this was fixed as described in https://bugzilla.mozilla.org/show_bug.cgi?id=1870699 ? I am asking because it will decide whether a future project I am planning is tractable or not.

Exact timings are difficult to give you, but I would expect something on par with what WGPU native offers. I don't know if closing bug 1870699 will reach that, but we are open to follow-up work to address remaining performance gaps after that.

Depends on: 1870699
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: