ComputeSharp icon indicating copy to clipboard operation
ComputeSharp copied to clipboard

documentation: non graphics samples & feasibility

Open Tylertron1998 opened this issue 3 years ago • 1 comments

Firstly I'd like to thank you for your amazing work here. This library is one of the most awesome and coolest things I've seen built in .NET!

Something I was wondering is the feasibility of this library for highly parallel workloads in real world scenarios which are non graphics related - the first thing that comes to mind is simulating hundreds of basic AI in parallel. I think it would be really cool to see something like this, and was wondering if there was any chance of getting documentation on what would or would not be worth doing in ComputeSharp. I understand performance is a difficult metric and the usual answer is "do it and then benchmark" but is there any recommendations on what compute workloads would/would not be good for this library in terms of raw throughput?

Tylertron1998 avatar Mar 11 '21 16:03 Tylertron1998

I'm currently trying that exact thing. Running thousands of basic AI's in parallel to make training WAY faster. I'm currently trying to convert all AI node and genome structure data into an encrypted texture. That way, the RGB values of each pixel represent a different variable value (So you can encode your variable data into the equivalent of a 24 bit number). It'll be slower than just directly running the AI on the CPU, but since my CPU can only train 8 at a time, while my GPU can train almost 2K, it'll be worth it in the long run

I'll let you know how it goes, and maybe create a texture-based class handler so that you can throw "List" and "Class" types onto the GPU without a TON of headaches

Techmokid avatar May 19 '21 06:05 Techmokid

Hey there! Thank you for the kind words, glad to hear you like ComputeSharp! I don't have docs specific to that, and as you can imagine it's not an easy question to answer. The good news though is that the same general principles apply here as they would for any other GPU accelerated framework, so what you're looking for isn't really docs about ComputeSharp per se, but rather about tradeoffs for CPU vs. GPU parallel computing, and I believe you should be able to find plenty of those online 🙂

Sergio0694 avatar Dec 23 '23 01:12 Sergio0694