From 5e5271257680e20dbb98323a8c52f9273ee20e91 Mon Sep 17 00:00:00 2001 From: Erik van Sebille Date: Wed, 12 Feb 2025 10:35:38 +0100 Subject: [PATCH] Adding short document on the rationale for dropping JIT to docs --- docs/v4/index.md | 1 + docs/v4/nojit.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 docs/v4/nojit.md diff --git a/docs/v4/index.md b/docs/v4/index.md index 1c7fcb0604..6dec52cdc0 100644 --- a/docs/v4/index.md +++ b/docs/v4/index.md @@ -9,5 +9,6 @@ Collaboration on v4 development is happening on the [Parcels v4 Project Board](h ```{toctree} api +nojit Parcels v4 Project Board ``` diff --git a/docs/v4/nojit.md b/docs/v4/nojit.md new file mode 100644 index 0000000000..2959f81b40 --- /dev/null +++ b/docs/v4/nojit.md @@ -0,0 +1,16 @@ +# Rationale for dropping JIT support in v4 + +Parcels v4 will not support Just-In-Time (JIT) compilation. This means that the `JITParticle` class will be removed from the codebase. This decision was made for the following reasons: + +1. We want to leverage the power of `xarray` and `uxarray` for data handling and interpolation. These libraries are not compatible with the JIT compilation in v3. +2. We want to make the codebase more maintainable and easier to understand. The JIT compilation pre-v4 adds complexity to the codebase and makes it harder to debug and maintain. +3. We have quite a few features in Parcels (also v3) that only work in Scipy mode (particle-particle interaction, particle-field interaction, etc.). +4. We want users to write more flexible/complex kernels. JIT doesn't support calling functions, or using methods from `numpy` or `scipy`, while this is possible in Scipy mode. + +Essentially, the only advantage of JIT was its speed. But now that the ecosystem for just-in-time compilation with python has matured in the last 10 years, we want to leverage other packages and methods (`cython`, `numba`, `jax`?) and Python internals for speed-up. + +Furthermore, we think we have some good ideas how to speed up Parcels itself without JIT compilation, such as relying more on vectorized operations. + +In short, we think that the disadvantages of JIT in Parcels v3 outweigh the advantages, and we want to make Parcels v4 a more modern and maintainable codebase. + +In our development of v4, we will first focus on making the codebase more modular and easier to extend. Once we have a working codebase, we will release this as `v4-alpha`. After that, we will start working on performance improvements.