Skip to content

Repository files navigation

Introduction

This project uses Rust-gpu and vulkano to run compute shaders and write shaders in rust. I can share my struct definitions, functions, ... from both crates I don't think this project will ever be prod-ready but I want to make it to learn.

TODO

Remove all unwraps, get better errors messages when interfacing with vulkano Learn more about vulkano for buffer types, memory types, allocators, ... to make things faster Support basic vector and matrix operations Also it would be great to make a GPU-realtime visualiser based on your operations (so you don't need to send the data to the cpu to not waste time)

Trade-offs

Currently, not enough features are implemented but here are some trade-offs I've thought of: GPU: Good for big matrices / repeated operations (but keeping the buffers on the gpu, and getting the data only in the end) Faer or other CPU libraries will be way better for small matrices / short fns I want to create a system to easily make fast computations without having to make compute shaders yourself, I think it could be inserted into Jupyter notebooks or something like this.

Benchmarks

100x 2*2 matmul

gpu_linalg: 5804.081615ms Faer: 0.015135ms As you can see it's not worth it for small matrices

100x 1024*1024 matmul

GPU: 3803.39127ms Faer: 1068.1014ms Still too slow, but it's probably because of interop. If I make a system where the 100 iterations are performed only on GPU, then it would be faster I think

Tests

Run cargo test -- --list to run the tests. Currently I use static muts which requires single threads in test mode (no multithreading available)

About

I want to try: Vulkano + Rust-gpu to speedup big linear algebra operations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages