LTheGreats

LTheGreats

I am wondering if it is possible to run a process from a beam language on the GPU and if so how?

Being able to spawn a process on the GPU could be cool because it might (depending on how it’s implemented) make the BEAM better at handling lots of floating point math very quickly and since GPUs generally have many more cores than CPUs it would be possible to run a lot more processes truly asynchronously.

I would also like to know some downsides of doing this.

Showing Posts 1 to 8

Qqwy

Qqwy

TypeCheck Core Team

GPUs are completely different animals from CPUs (GPU processors are very small, very limited in what kind of instructions they can execute, but therefore very fast and plentiful.)

Because they are so different, I do not think that a BEAM scheduler would be able to run on there.

If you’d like to make use of the GPU in your code, you might want to look into writing a NIF (such as using rustler and writing it in Rust).

tty

tty

There was research done in the EU with integrating Erlang and CUDA. Just don’t know the details.

peerreynders

peerreynders

Kevin Smith - Erlang & CUDA: Concurrent and Fast (2011)

slides

Machine Learning in Erlang and CUDA
https://github.com/vascokk/NumEr

As already alluded to - the BEAM is used for orchestration of computation - because that is what it is good at.


Aside: Simon Marlow: Parallel and Concurrent Programming in Haskell (amazon.com; GPU Programming with Accelerate)

easco

easco

There is also the Scene library that was presented at ElixirConf.

On the surface it would seem unrelated as it is dedicated to drawing graphics - but it draws those graphics through OpenGL. There is a small step between scheduling graphics on the GPU and scheduling programs to run on the GPU. Scene may or may not have the primitives needed to take that step, but it certainly shows that communicating with the GPU is possible.

jarble

jarble

There are some BEAM runtimes that use LLVM, so it might be possible to run a process on the GPU using the SPIRV-LLVM-Translator.

yukster

yukster

Bleh. I feel like this is such a ripe area of research and development but Kevin Smith’s Pteracuda library hasn’t been touched in a decade. I feel like there should be a way to just inform the BEAM that a GPU is available and it just throws processes at it. It’s awesome that the BEAM is so good at scheduling but it seems irrefutable that never having to swap out a process is way better. I’m not a hardware guy though, so maybe there are limits to what a GPU core can do? Just to throw out a possible use-case, how about a web scraper that spawns many many processes to make http connections and parse the response? I’m seeing Nvidia GPUs with over 1500 cores these days! That sounds super parallel to me!

ityonemo

ityonemo

Gpu cores are simd. One way to think of it is that you must dispatch the same instruction to all of the cores simultaneously (this is not exactly correct for most modern gpus, but it gives you the flavor of the problem). I do think that the idea of having a process manage a gpu is correct, though, and every other programming language that does gpu stuff does this abstraction wrong. I tried to convince the Julia folks that they should treat the gpu as a virtual “distributed node” that you can dispatch Julia code to (you can do this with distributed cpu nodes on Julia), but they did not pick that idea up.

yukster

yukster

@ityonemo thanks for the explanation! I hope that tech/libs catch up and we can make the BEAM easily dispatch onto 1k+ cores!

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews