HOLYSHT is a production-ready GPU acceleration layer for spherical harmonic transforms (SHT) in the torch-harmonics ecosystem. It provides high-performance CUDA kernels for NVIDIA GPUs (Hopper/Blackwell with TMA support) and Apple Metal/MPS kernels for arm64 Macs. Rather than reimplementing torch-harmonics, HOLYSHT focuses on accelerating the slowest execution paths—Legendre stage computation, vector SHT composition, and inverse-FFT preparation—via backend-specific kernels. It reuses torch-harmonics for quadrature weight generation and remains an intentional companion library rather than a full replacement.
Martian weather simulation using HOLYSHT — spectral advection on a 256×512 grid with real MOLA topography
Spectral advection on Mars (256×512 grid, real MOLA topography). Left: terrain + weather. Right: flow dynamics with velocity streamlines. Simulated at 300+ frames/s on an NVIDIA GB10.
Metal/MPS: Native Metal compute kernels for Apple Silicon, with hybrid dispatch strategies (native kernel for small grids, fallback einsum for larger grids, tuned mid-size ranges)
Runtime architecture-aware launch selection and backend autotuning via configurable environment variables
Infrastructure:
Full benchmark suite (forward, inverse, BF16, training paths)
Profiling helpers for nsys, ncu, and cuobjdump resource reporting
Parity tests against torch-harmonics covering backward and non-contiguous inputs
Local torch JIT build caching for safe day-to-day development iteration
Apple Metal/MPS (M4 Mini, PyTorch 2.11.0, batch size 4):
Vector forward: 1.5x–3.25x (wins on larger grids)
Vector inverse: 1.4x–2.81x
Scalar forward: wins on smaller grids; slower on large
Sparse Y_n^m synthesis: 1.1x
Vector forward+backward: 1.7x
Technical approach
Runtime backend selection: TMA (Tensor Memory Accelerator) for Hopper/Blackwell, with tensor-core variants and FMA kernels available; autotuned on first use via configurable cache