This paper carries out the porting of the HPC programming language Chapel to emerging RISC-V hardware, records the core changes made during the porting process, and analyzes through multiple benchmark evaluations the feasibility of the RISC-V architecture for HPC scenarios and its current performance boundaries.
The Chapel programming language has recently added support for the RISC-V architecture.
The core focus of this study is the complete porting of the Chapel HPC programming language to the RISC-V architecture along with accompanying evaluation. The study selected multiple RISC-V hardware platforms, including the SiFive P550, the Unmatched development board, and the Sophon SG2042, and compared their performance horizontally against several mainstream HPC CPU platforms released in recent years. An important boundary condition must be made clear: all RISC-V devices used in this experiment are early, non-HPC-grade hardware products.
The practice of porting the Chapel HPC programming language to the RISC-V architecture shows that for a well-maintained codebase that heavily uses modern interfaces such as C11 atomic operations to limit the share of platform-specific assembly code, adding support for a new instruction set architecture is only a moderately difficult development challenge.
In this porting work, the changes to the build systems of Chapel itself and the Qthreads runtime were minimal; the only core non-trivial code modification was adding a RISC-V assembly context-switching implementation for Qthreads.
The study also points out that the insufficient supply of prebuilt binary packages for Chapel's dependencies increases porting complexity, while the recently released RVA23 profile will make future similar RISC-V porting efforts easier.
To provide fast context switching for the RISC-V architecture in the Qthreads runtime, the porting work required four interrelated core non-trivial changes. First, define a dedicated struct type to store all register contents that need to be saved during a context switch. Second, implement RISC-V assembly code conforming to the swapcontext calling convention to perform bidirectional switching between the current execution context and this register-storage struct. Third, develop a RISC-V version of the makecontext function to complete the context object initialization process. Finally, wire all of the above implementation logic into the architecture-adaptation branch of Qthreads, ensuring that under the RISC-V architecture the runtime automatically invokes this native context-switching implementation.
Although the current RISC-V ecosystem already has basic support at the operating system and compiler levels, there is still a clear gap in the adaptation of high-performance communication layers for high-performance computing scenarios. While InfiniBand technology has official support in the Linux kernel, currently available RISC-V systems generally lack full-size PCIe slots, available PCIe lane bandwidth is limited, and support for critical components such as firmware, interrupts, IOMMU, and DMA remains incomplete. HPE Cray Slingshot could in theory work with the RISC-V architecture, but the corresponding host-side software stack still needs to be ported and fully validated for RISC-V. Therefore, before HPC-grade RISC-V platforms become widely available, most RISC-V systems use ordinary Ethernet as the interconnect, relying on MPI to support distributed-memory program execution.
Results for high-precision arithmetic benchmarks such as Digits of Pi show that the single-core performance of the RISC-V platforms remains clearly below that of mainstream ARM and x86 platforms in the same scenarios. The core cause of this performance gap is that the RISC-V instruction set lacks a single add-with-carry instruction; achieving equivalent extended-precision arithmetic requires 3 separate instructions, whereas ARM and x86 platforms can accomplish it with a single instruction. Please refer to the figure immediately following to see the timing distribution and performance differences of different architectures on this class of high-precision arithmetic benchmarks.
Results for floating-point-intensive benchmarks show a significant performance gap between the tested RISC-V platforms and mainstream high-performance platforms featuring the Grace and Granite Rapids architectures. The core cause of this phenomenon is that none of the tested RISC-V devices supports the RVV 1.0 vector extension, so automatic vectorization optimizations cannot be enabled, whereas the ARM and x86 platforms used for comparison all come with mature dedicated vector extension instruction sets. Please refer to the figure immediately following to see the timing behavior and performance distribution patterns of different architectures on floating-point-intensive tasks.
None of the RISC-V devices tested in this study is equipped with multiple CPU sockets, nor do they support simultaneous multithreading (SMT). To clarify the impact of SMT and NUMA features on the benchmark results, the research team re-ran the full set of Chapel CLBG benchmarks on the AMD64 and ARM64 devices serving as controls, covering four configuration scenarios: single socket with SMT off, single socket with SMT on, all sockets with SMT off, and all sockets with SMT on.
ChOp, a branch-and-bound optimization engine written in Chapel, is a representative benchmark for verifying the cross-architecture compatibility of non-trivial large Chapel code. This test reports only pure CPU version performance data, because the existing GPU runtimes have not yet been adapted to the RISC-V platform. The results show that ChOp achieved the best performance on the Grace and Granite Rapids platforms, with the SG2042 platform performing essentially on par with the Ice Lake platform, standing out in its corresponding price segment, while the other two RISC-V platforms, P550 and Unmatched, showed relatively lower performance.
The practical experience of porting the Qthreads runtime and the Chapel programming language to the RISC-V architecture clearly highlights that, beyond traditional architectural portability, the demand for performance portability continues to expand — a new core requirement that cross-architecture HPC adaptation work must address.
The study selected a well-maintained subset of the Chapel benchmark suite to horizontally evaluate currently partially available RISC-V hardware against existing x86 and ARM server-class systems. Under the paper's test setup, current RISC-V system performance has not yet reached the competitiveness of server-class hardware, but the corresponding hardware costs are far lower than similarly positioned x86 and ARM server-class products; these results provide supporting evidence that future server-oriented RISC-V hardware can achieve competitive performance and gain widespread adoption in the HPC field.
The scripts used to run the benchmarks and all performance data from this study have been open-sourced on a public platform.