Arm32 JIT available on GRiSP2, with a 2x to 4x performance boost

Enjoy seamless jit integration on GRiSP2!

TL;DR:

- The Arm32 JIT for Erlang/OTP is now available on GRiSP2 for everyone deployng with package OTP-27.3.4.16 and any future OTP 27 maintenance release.

- A 2x performance boost is available with the latest OTP maintenance releases for versions 27, 28, and 29.

Arm32 JIT on GRiSP2

Over the last year, we developed the Arm32 backend for the BEAM JIT. Later during last month we worked hard to ship the Arm32 JIT on our bare-metal platform, GRiSP2, achieving the following:

- Improved our patch-selection algorithm to support more OTP versions, more easely

- Updated the Arm32 JIT with the latest maintainance OTP 27 changes and fixes

- Produced new OTP patches to enable Arm32 JIT execution on RTEMS 5 on GRiSP2

- Automated our grisp2-rtems-toolchain releases on Docker Hub

- Automated the building of OTP packages with the Arm32 JIT in GitHub CI

- Released a new grisp dependency and a new rebar3_grisp plugin to support the JIT

The result is free, out-of-the-box Arm32 JIT support for GRiSP2 owners using OTP 27. Our next objective is to port the jit to the latest OTP 29 release. Once that will be done, shipping it to grisp2 will be a simple job, thanks to the automation we now have in place.

How do I try it?

Prerequisites

- One GRiSP2 board

- OTP 27 and Rebar3 installed on your machine

I never worked with GRiSP2. How do I get started?

Follow the [GRiSP wiki]( Home · grisp/grisp Wiki · GitHub ). You will automatically use the latest software, and the guided configuration will walk you through the process (including the JIT enabling).

I already own a GRiSP2, but I do not have a project

You can clone the grisp_demo repository and use it as your project, just remember to set the OTP version to 27 and make sure your rebar3_grisp plugin is up to date.

I already have a GRiSP2 project laying around. How do I upgrade it to use the JIT?

1. Update your `rebar3_grisp` plugin to the latest version:

- `rebar3 update`

- `rebar3 as global plugins upgrade rebar3_grisp`

- Make sure `rebar3_grisp` is at version 2.13.1 and `grisp_tools` is at version 2.10.1.

2. Run `rebar3 upgrade grisp` and make sure `grisp` is at version 2.11.0.

3. Add the JIT option to your GRiSP settings in `rebar.config`, and make sure you set `27` as the OTP version.

% inside your rebar.config
{grisp, [

    {otp, [

        {version, "27"},

        {jit, true}

    ]},

    {platform, grisp2},

    {deploy, [

% other options

    ]}

]}.

4. Deploy as usual with `rebar3 grisp deploy`.

5. When the Erlang shell boots, you will see the [jit] marker in the Eshell header.

About the 2x and 4x performance boosts

We have just rebuilt and shipped OTP builds that finally set the CPU clock to its full potential on the i.MX6UL. RTEMS 5 does not have drivers for managing the clock on this CPU and we always inherited the bootloader’s cpu settings, which ran the CPU at half its full speed (oops :face_with_hand_over_mouth:). This has changed with the latest Docker release of the toolchain. We now include a procedure that during the board initialization sets the CPU voltage and clock. The result is a 2x performance increase for CPU-intensive tasks; which is expected since we just doubled the usual clock.

Available OTP package versions using the new CPU clock:

- 27.3.4.16

- 28.5.0.5

- 29.0.5

If you deploy with the package 27.3.4.16, you can combine this improvement with the JIT for a total performance increase of 4X.

We observed this improvements using the ESTONE benchmark suite taken from the OTP repository.

Comparing ESTONE results:

- Legacy GRiSP2 toolchain (half clock, no JIT): 12,780 ESTONES

- Legacy GRiSP2 toolchain with JIT: 26,735 ESTONES

- New GRiSP2 toolchain with JIT: 53,316 ESTONES

Cheers!

2 Likes

This is a massive leap forward for the GRiSP2 ecosystem. The jump from ~12k to over 53k ESTONES is staggering, and it’s impressive to see the combination of the Arm32 JIT with the proper CPU clock management finally unlocked.

The automation around the toolchain and OTP builds is also a huge win—it makes adopting these performance gains frictionless for existing users. Great work on the patch-selection algorithm and the RTEMS integration. Looking forward to seeing this ported to OTP 29!

4x performance for free? Yes, please! It’s great to see the Arm32 JIT finally land on bare-metal GRiSP2. The fact that the CPU was running at half clock this whole time explains a lot, but doubling the speed plus adding the JIT is an incredible upgrade.

Huge shoutout to the team for the automated CI/CD and the easy ‘rebar3’ upgrade path. It literally takes two minutes to get this boost. Can’t wait to test these new ESTONE numbers on my board!

Fixing the clock voltage/init on RTEMS 5 is a huge underlying fix that often gets overlooked, and combining that with the JIT is a chef’s kiss.

The upgrade path is incredibly smooth—just updating grisp_tools and rebar3_grisp is exactly how this should work. Thanks for making the bare-metal experience so much snappier