You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://arxiv.org/abs/2311.14670)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[](https://colab.research.google.com/drive/1YmJ2ljsF8HBvhPmD4hrYPlyAKc4WPUgq?usp=sharing)
7
+
[](https://colab.research.google.com/github/astro-informatics/s2fft/blob/main/notebooks/spherical_harmonic_transform.ipynb)
> For algorithmic reasons JIT compilation of HEALPix transforms can become slow at high bandlimits, due to XLA unfolding of loops which currently cannot be avoided. After compiling HEALPix transforms should execute with the efficiency outlined in the associated paper, therefore this additional time overhead need only be incurred once. We are aware of this issue and will work to improve this in subsequent versions.
89
+
> For algorithmic reasons JIT compilation of HEALPix transforms can become slow at high bandlimits, due to XLA unfolding of loops which currently cannot be avoided. After compiling HEALPix transforms should execute with the efficiency outlined in the associated paper, therefore this additional time overhead need only be incurred once. We are aware of this issue and are working to fix it. A fix for CPU execution has now been implemented (see example [notebook](https://astro-informatics.github.io/s2fft/tutorials/spherical_harmonic/JAX_HEALPix_backend.html)). Fix for GPU execution is coming soon.
80
90
81
91
## Installation :computer:
82
92
@@ -87,12 +97,7 @@ into the active python environment by [pip](https://pypi.org) when running
87
97
```bash
88
98
pip install s2fft
89
99
```
90
-
This will install all core functionality which includes JAX support. To install `S2FFT`
91
-
with PyTorch support run
92
-
93
-
```bash
94
-
pip install s2fft[torch]
95
-
```
100
+
This will install all core functionality which includes JAX support (including PyTorch support).
96
101
97
102
Alternatively, the `S2FFT` package may be installed directly from GitHub by cloning this
98
103
repository and then running
@@ -101,16 +106,22 @@ repository and then running
101
106
pip install .
102
107
```
103
108
104
-
from the root directory of the repository. To enable PyTorch support you will need to run
109
+
from the root directory of the repository.
110
+
111
+
Unit tests can then be executed to ensure the installation was successful by first installing the test requirements and then running pytest
Unit tests can then be executed to ensure the installation was successful by running
118
+
Documentation for the released version is available [here](https://astro-informatics.github.io/s2fft/). To build the documentation locally run
111
119
112
120
```bash
113
-
pytest tests/
121
+
pip install -r requirements/requirements-docs.txt
122
+
cd docs
123
+
make html
124
+
open _build/html/index.html
114
125
```
115
126
116
127
> [!NOTE]
@@ -143,7 +154,29 @@ For further details on usage see the [documentation](https://astro-informatics.g
143
154
> [!NOTE]
144
155
> We also provide PyTorch support for the precompute version of our transforms. These are called through forward/inverse_torch(). Full PyTorch support will be provided in future releases.
145
156
146
-
## Benchmarking :hourglass_flowing_sand:
157
+
## C/C++ JAX Frontends for SSHT/HEALPix :bulb:
158
+
159
+
`S2FFT` also provides JAX support for existing C/C++ packages, specifically [`HEALPix`](https://healpix.jpl.nasa.gov) and [`SSHT`](https://github.com/astro-informatics/ssht). This works
160
+
by wrapping python bindings with custom JAX frontends. Note that this C/C++ to JAX interoperability is currently limited to CPU.
161
+
162
+
For example, one may call these alternate backends for the spherical harmonic transform by:
All of these JAX frontends supports out of the box reverse mode automatic differentiation,
173
+
and under the hood is simply linking to the C/C++ packages you are familiar with. In this
174
+
way `S2fft` enhances existing packages with gradient functionality for modern scientific computing or machine learning
175
+
applications!
176
+
177
+
For further details on usage see the associated [notebooks](https://astro-informatics.github.io/s2fft/tutorials/spherical_harmonic/JAX_SSHT_backend.html).
178
+
179
+
<!-- ## Benchmarking :hourglass_flowing_sand:
147
180
148
181
We benchmarked the spherical harmonic and Wigner transforms implemented
149
182
in `S2FFT` against the C implementations in the
@@ -167,7 +200,7 @@ that scale linearly with spin).
For algorithmic reasons JIT compilation of HEALPix transforms can become slow at high bandlimits, due to XLA unfolding of loops which currently cannot be avoided. After compiling HEALPix transforms should execute with the efficiency outlined in the associated paper, therefore this additional time overhead need only be incurred once. We are aware of this issue and will work to improve this in subsequent versions.
53
+
For algorithmic reasons JIT compilation of HEALPix transforms can become slow at high bandlimits, due to XLA unfolding of loops which currently cannot be avoided. After compiling HEALPix transforms should execute with the efficiency outlined in the associated paper, therefore this additional time overhead need only be incurred once. We are aware of this issue and are working to fix it. A fix for CPU execution has now been implemented (see example `notebook <https://astro-informatics.github.io/s2fft/tutorials/spherical_harmonic/JAX_HEALPix_backend.html>`_). Fix for GPU execution is coming soon.
44
54
45
55
Sampling |:earth_africa:|
46
56
-----------------------------------
@@ -53,7 +63,7 @@ The equiangular sampling schemes of `McEwen & Wiaux (2012) <https://arxiv.org/ab
53
63
The popular `HEALPix <https://healpix.jpl.nasa.gov>`_ sampling scheme (`Gorski et al. 2005 <https://arxiv.org/abs/astro-ph/0409513>`_) is also supported. The HEALPix sampling does not exhibit a sampling theorem and so the corresponding harmonic transforms do not achieve machine precision but exhibit some error. However, the HEALPix sampling provides pixels of equal areas, which has many practical advantages.
0 commit comments