jFoF: GPU Friends-of-Friends Halo Finding with Gradient Propagation
Abstract We present jFoF, a fully GPU-native Friends-of-Friends (FoF) halo finder designed for both high-performance simulation analysis and differentiable modeling. Implemented in JAX, jFoF achieves end-to-end acceleration by performing all neighbor searches, label propagation, and group construction directly on GPUs, eliminating costly host-device transfers. We introduce two complementary neighbor-search strategies, a standard k-d tree and a novel linked-cell grid, and demonstrate that jFoF attains up to an order-of-magnitude speedup compared to optimized CPU implementations while maintaining consistent halo catalogs. Beyond performance, jFoF enables gradient propagation through discrete halo-finding operations via both frozen-assignment and topological optimization modes. Using a topological optimization approach via a REINFORCE-style estimator, our approach allows smooth optimization of halo connectivity and membership, bridging continuous simulation fields with discrete structure catalogs. These capabilities make jFoF a foundation for differentiable inference, enabling end-to-end, gradient-based optimization of structure formation models within GPU-accelerated astrophysical pipelines.
Authors
- Benjamin Horowitz (ORCID: https://orcid.org/0000-0001-7832-5372)
- Adrian E. Bayer (ORCID: https://orcid.org/0000-0002-3568-3900)
Institutions
- Lawrence Berkeley National Laboratory (US)
- Kavli Institute for the Physics and Mathematics of the Universe (JP)
- Princeton University (US)
- Flatiron Health (United States) (US)
- Flatiron Institute (US)
- The University of Tokyo (JP)
Publication Details
- Journal
- Monthly Notices of the Royal Astronomical Society
- Published
- 2026-06-17
- DOI
- https://doi.org/10.1093/mnras/stag1151
- Primary Topic
- Topological and Geometric Data Analysis
- Type
- article
- Field-Weighted Citation Impact
- 0.00