A followup to the previous "Nim AST -> GPU AST -> Cuda Runtime Compilation" https://forum.nim-lang.org/t/12868
Following the awesome work by @Vindaar at https://github.com/mratsim/constantine/pull/565 we now have WebGPU support with Nim code that can be reused for the Cuda backend as well.
Now, people might be wondering why would a cryptographic library need GPU acceleration, well people are competing to generate proofs of computing anything, transactions & account balances in our case, as fast as possible.
A proof allows to delegate compute on a specific dataset with a certain computation and trusting the result (without asking a lawyer to subpoena the company to review its process). This allows blockchains to process more transactions while only trusting math (instead of good behavior of potentially malicious party).
And there are also use-cases for generating fast proofs on a mobile device, for example the EU age-verification project: https://ageverification.dev/av-doc-technical-specification/docs/annexes/annex-B/annex-B-zkp/, hence the appeal of WebGPU.
In any case, Constantine now supports multiple ways to compile to GPU as a proof to Nim flexibility and the GPU code can be generated even at compile-time with a compiler implemented as Nim macros:
@elcritch: Yes it can be used for ML compute.
@Clonk: Thanks.