Two new Elixir-related papers at the 28th Brazilian Symposium on Programming Languages

These were both very interesting. Thanks for sharing.

I thought I’d share 10 things from my notes on what I think was most salient from the first one, ‘Hok: Higher-Order GPU kernels in Elixir’.


Q1: What is Hok?
A1: Hok is an extension of Elixir designed for GPU programming, simplifying the use of GPUs for high-performance tasks like machine learning.


Q2: Why is Hok useful for Elixir developers?
A2: Hok allows Elixir developers to leverage GPUs without needing to learn low-level languages like CUDA, while maintaining Elixir’s concurrency and distribution features.


Q3: What is a G-Matrix?
A3: G-Matrix is a matrix stored in GPU memory, used in Hok for parallel computations, and managed with automatic garbage collection via the BEAM VM.


Q4: How does Hok simplify GPU programming?
A4: Hok introduces higher-order kernels and algorithmic skeletons, enabling reusable GPU code and easier development of parallelized programs.


Q5: What is G-Potion?
A5: G-Potion is Hok’s domain-specific language for writing GPU kernels, extending Elixir with CUDA features and supporting in-place updates.


Q6: Can Hok be used for machine learning?
A6: Yes, Hok can implement neural networks and other matrix-heavy computations, with ongoing improvements for broader data type support.


Q7: How does Hok manage memory on the GPU?
A7: Hok automatically frees GPU memory when G-Matrices are no longer needed, using the BEAM VM’s garbage collection.


Q8: What are higher-order kernels in Hok?
A8: Higher-order kernels allow passing functions as arguments to GPU kernels, enabling dynamic configurations and flexible code reuse.


Q9: How does Hok compare to traditional GPU programming?
A9: Hok offers a higher-level abstraction, reducing complexity and eliminating the need to manage low-level GPU details like memory and synchronization.


Q10: What are the current limitations of Hok?
A10: Hok currently supports only floats for G-Matrix operations, with work underway to expand its capabilities through the NX library.

5 Likes