Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have you considered a minimal-effort CPU runtime? #85

Open
PoignardAzur opened this issue Aug 28, 2024 · 1 comment
Open

Have you considered a minimal-effort CPU runtime? #85

PoignardAzur opened this issue Aug 28, 2024 · 1 comment

Comments

@PoignardAzur
Copy link

In your README, you mention wanting to build a JIT cranelift backend for the CPU.

I can see the appeal of such a backend, but at the same time, there are use-cases where users may really want a CPU runtime for their shaders and don't care that much about performance.

For instance, in Vello, we end up maintaining CPU pseudo-shaders in parallel of our actual WGSL shaders, mostly for testing and as a fallback. Personally, I'd like to push the fallback case even further so we can run Vello on machines without GPUs; in those cases, being able to run anything at all is a win, even with degraded performance. If we could achieve that and get rid of our duplicate CPU shaders, that would be a massive win for us.

Have you considered making a best-effort CPU runtime? One where annotated rust functions are simply lowered to regular rust functions, and you leave auto-vectorization to the rustc backend? How much effort do you think it would take to implement that runtime?

@nathanielsimard
Copy link
Member

Making a low-effort CPU runtime would probably be as hard as making a proper CPU runtime. To speed things up, we might generalize our CUDA compiler to a C++ compiler and compile it using gcc or llvm. The compiler wouldn't be embedded, but it would be faster to develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants