Saved in:
Bibliographic Details
Main Authors: Stücker, Jens, Hahn, Oliver, Winkler, Lukas, Adame, Adrian Gutierrez, Flöss, Thomas
Format: Preprint
Published: 2026
Subjects:
Online Access:https://arxiv.org/abs/2604.05885
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918432094552064
author Stücker, Jens
Hahn, Oliver
Winkler, Lukas
Adame, Adrian Gutierrez
Flöss, Thomas
author_facet Stücker, Jens
Hahn, Oliver
Winkler, Lukas
Adame, Adrian Gutierrez
Flöss, Thomas
contents Algorithms based on spatial tree traversal are widely regarded as among the most efficient and flexible approaches for many problems in CPU-based high-performance computing (HPC). However, directly transferring these algorithms to GPU architectures often yields substantially smaller performance gains than expected in light of the high computational throughput of modern GPUs. The branching nature of tree algorithms leads to thread divergence and irregular memory access patterns -- both of which may severely limit GPU performance. To address these challenges, we propose a Morton (z-order) 'plane-based tree hierarchy' that is specifically designed for GPU architectures. The resulting flattened data layout enables efficient dual-tree traversal with collaborative execution across thread groups, leading to highly coalesced memory access patterns. Based on this framework we present implementations of two important spatial algorithms -- exact $k$-nearest neighbour search and friends-of-friends (FoF) clustering. For both cases, we observe more than an order-of-magnitude performance improvement over the closest competing GPU libraries for large problem sizes ($N \gtrsim 10^7$), together with strong scaling to distributed multi-GPU systems. We provide an open-source implementation, 'JZ-Tree' (JAX z-order tree), which serves as a foundation for efficient GPU implementations of a broad class of tree-based algorithms.
format Preprint
id arxiv_https___arxiv_org_abs_2604_05885
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle JZ-Tree: GPU friendly neighbour search and friends-of-friends with dual tree walks in JAX plus CUDA
Stücker, Jens
Hahn, Oliver
Winkler, Lukas
Adame, Adrian Gutierrez
Flöss, Thomas
Distributed, Parallel, and Cluster Computing
Cosmology and Nongalactic Astrophysics
Computational Physics
Algorithms based on spatial tree traversal are widely regarded as among the most efficient and flexible approaches for many problems in CPU-based high-performance computing (HPC). However, directly transferring these algorithms to GPU architectures often yields substantially smaller performance gains than expected in light of the high computational throughput of modern GPUs. The branching nature of tree algorithms leads to thread divergence and irregular memory access patterns -- both of which may severely limit GPU performance. To address these challenges, we propose a Morton (z-order) 'plane-based tree hierarchy' that is specifically designed for GPU architectures. The resulting flattened data layout enables efficient dual-tree traversal with collaborative execution across thread groups, leading to highly coalesced memory access patterns. Based on this framework we present implementations of two important spatial algorithms -- exact $k$-nearest neighbour search and friends-of-friends (FoF) clustering. For both cases, we observe more than an order-of-magnitude performance improvement over the closest competing GPU libraries for large problem sizes ($N \gtrsim 10^7$), together with strong scaling to distributed multi-GPU systems. We provide an open-source implementation, 'JZ-Tree' (JAX z-order tree), which serves as a foundation for efficient GPU implementations of a broad class of tree-based algorithms.
title JZ-Tree: GPU friendly neighbour search and friends-of-friends with dual tree walks in JAX plus CUDA
topic Distributed, Parallel, and Cluster Computing
Cosmology and Nongalactic Astrophysics
Computational Physics
url https://arxiv.org/abs/2604.05885