JuliaDynamics/Agents.jl

GPU Extensions to Agents.jl based on a different modelling approach

Open

#782 opened on 2023年3月14日

GitHub で見る
 (3 comments) (0 reactions) (0 assignees)Julia (904 stars) (146 forks)batch import
hardhelp wantedparallelismperformance

説明

I developed a package for agent based modelling in continuum spaces of 1D, 2D and 3D.

dsb-lab/AgentBasedModels.jl

The features that it had over the current implementation of Agents.jl are:

  1. GPU compatible.
  2. Implemented continuum model integration methods as Euler, Heun or RungeKutta4.
  3. The possibility to define a continuum field coupled with the agents.
  4. Optimization methods specific for non-differentiable problems as agent-models.

Although the package is more specific purposed than Agents.jl. Talking with @Datseris, we agreed that it include interesting features and we could try to make it an extension or even a merge into Agents.jl.

On the compatibility with GPU

Since there are quite a lot of different topics, we can start talking about the GPU compatibility of Agents.

So far, Agents is arranged as:

  • Array of mutable structures (agents).
  • Model with the global parameters of the model

In order for Agents.jl to be compatible with CUDA.jl, it is required to transform this vision as:

  • Each parameter of an agent to become a CUDA.Array by itself.
  • Model may contain both global and local parameters.

This transformation will not need mutable structures that are incompatible with CUDA.jl and allow GPU kernels to work out.

On the way we define code in the other package

For allowing models to work in both CPU and GPU, my package uses macro programming to vectorize the code in the appropriate shape compatible to CPU and GPU. It will be interesting to discuss how we could make compatible Agents.jl way of defining stepping functions to allow for this flexibility.

コントリビューターガイド

GPU Extensions to Agents.jl based on a different modelling approach · JuliaDynamics/Agents.jl#782 | Good First Issue