Spherical Bessel functions on MLX: 570x speedup over scipy #3284
akaiHuang
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I implemented GPU-accelerated spherical Bessel functions using piecewise Chebyshev interpolation on MLX.
Performance (M1 Max)
Table build is a one-time cost (~5s for 500 ells). Subsequent evaluations use cached GPU coefficients.
Accuracy
Method
Piecewise Chebyshev interpolation: precompute j_l(x) at Chebyshev nodes on CPU, store coefficients on GPU, evaluate via matrix multiply. Supports both j_l(x) and j_l'(x).
Use case
Spherical Bessel functions are needed in CMB cosmology (Boltzmann solvers), acoustics, and electromagnetic simulations. No GPU framework currently provides them natively.
Code
Would there be interest in adding spherical Bessel functions to mlx or mlx-examples?
Beta Was this translation helpful? Give feedback.
All reactions