Agent-Based Modeling with Nx

Paweł Długosz


Nx library opens a world of numerical computations for the BEAM which natively is one of its weak spots. There are already some successful production systems which use machine learning that are written in Elixir. My goal is to explore non-ML applications for this technology. I want to show you a case study of how I redesigned an Agent-Base Modeling framework using tensor algebra with Nx to run it efficiently on GPU. We’ll go through a few key algorithms and look what approach we need to take to express them in a different paradigm.

Key Takeaways: This talk is intended to give you an example of how an imperative algorithm can be reimplemented with tensor algebra to run efficiently on GPU with Nx.

Target Audience: Elixir developers who are interested in leveraging Nx library capabilities.

Nx,, tensor, algebra,, agent-based, modeling