NVIDIA/torch-harmonics
Differentiable signal processing on the sphere for PyTorch
What it solves
torch-harmonics provides a differentiable way to perform signal processing on a sphere. It allows researchers to project signals from a spherical surface into a harmonic basis (and back), which is essential for solving partial differential equations (PDEs) on spheres and building neural operators that can learn dynamics on spherical data.
How it works
The library implements the Spherical Harmonic Transform (SHT), which generalizes the Fourier transform to the sphere. It uses a combination of Fast Fourier Transforms (FFTs) for longitude and Gaussian quadrature rules for latitude to compute projections onto associated Legendre polynomials. Because it is built using PyTorch primitives, the entire process is fully differentiable. It also includes support for distributed quadrature to enable model-parallelism across multiple GPUs.
Who it’s for
It is designed for scientists and machine learning engineers working with spherical data, such as those developing Spherical Fourier Neural Operators (SFNO) or solving complex physics simulations (e.g., shallow water equations) on a rotating sphere.
Highlights
- Differentiable SHT: Fully integrated with PyTorch for gradient-based optimization.
- Advanced Convolutions: Implements local discrete-continuous (DISCO) convolutions for structured and unstructured meshes on the sphere.
- Spherical Attention: Generalizes the attention mechanism to the sphere, using geodesic distance for neighborhood attention.
- Scalable: Supports distributed SHT for large-scale model parallelism.
- Cuda Optimized: Provides custom CUDA extensions for high-performance execution on NVIDIA GPUs.
Related
- Project
- Project
- Project
- Project
- Project