Repository navigation
Adding MSM for WebGPU #386
Alberto Centelles (Acentelles)
started this conversation in
Ideas
Replies: 3 comments 1 reply
|
Could we add a feature flag and then depending on the future flag we make the methods have appropriate signatures? Would that work? |
0 replies
|
Yes, but one needs to make so many changes that it becomes quite messy. You can get an idea from this PR. My suggestion is to create a separate repo/clone (e.g. |
1 reply
|
I don't think so, wasm runtimes in browsers run on a single thread, and you cannot block the main thread waiting for a Promise. So even |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
ICME have open sourced a WebGPU implementation for BN254 (other curves can be added):
https://github.com/ICME-Lab/msm-webgpu
For 2^20 MSMs, it brings a 10x improvement in performance.
Computing MSM on WebGPU is asynchronous. This means that any function that calls wgpu msm will need to be async, too.
One option is to have a
wasm_32variant for each of these functions. Another is to make all of these functions async regardless of the backend. Another one may be using WebWorkers, but I don't know much about it.I don't think blocking approaches work. For example,
pollster::block_ondoesn't work forwasm_32, since the runtime is single-threaded and blocking it freezes the environment (e.g. the browser). In any case, despite the seemingly small change, I wanted to discuss which approach would be best for this codebase.All reactions