For those wondering what it's for: it's basically NumPy + a JIT compiler with standard Haskell syntax (you mostly just need to change the type signatures, not the code).
It can vectorize, parallelize on the CPU, or offload to the GPU automatically.
One big difference compared to NumPy (which you may or may not care about depending on how picky you are), is that Accelerate is a higher-order programming model. Basically, you can have 'map' (with a user-provided function), and it will go fast, in contrast to NumPy's model where only first-order operations go fast.
In particular, compare you JAX’s vmap — one model for vmap is that it is a program transformation on first order functions, that returns a first order function (“function” is a bit wonky here: but it’s JAX’s Jaxpr representation), but vmap itself is not a primitive in the Jaxpr language.
Is the same true here about map (can I think of it like vmap)? Or is it true that I can define higher order functions and Accelerate will handle them? What about functions with recursion?
Thanks! If you happen to see this - Futhark is very cool.
I'm not a Jax expert. Accelerate's 'map' allows for almost arbitrary sequential code - there is some fine print, because it's an embedded language, and the biggest fine print is that nested parallelism is not allowed. You can define your own Haskell-level higher order functions, and Accelerate will handle them just fine, because essentially all the Haskell-level computation is "compiled away" (by being run) before the Accelerate code is JIT-compiled at run-time. You can consider Haskell to be a meta-language in which you ultimately construct Accelerate program terms, and then those are compiled and run - not too dissimilar from how Jax does it, actually.
Recursion works, but for an uninteresting reason: the recursion is on the Haskell side, and will essentially be unrolled before Accelerate gets its hand on it. This allows you to do some fun things (like partially evaluating a ray tracer on its scene description), but it's often not what you want, and Accelerate provides some combinators (that look like higher-order Haskell functions) for expressing sequential looping.
Yes, and that’s fine. There are many notable Michael Jordans for instance. Maybe they could have taken the opportunity to call this one Haccelerate or Haskellerate or something like that but there is no reason for everything to have a distinct name. Context has sufficient namespacing.
I think we ran out of `$NameFast` and `Fast$Name`, so people are just using plain verbs as names now, ideally as similar to something existing as possible, so you can attempt to steal their SEO and similar nifty "growth hacking" stuff.
Making Haskell programs go faster. I will say that Accelerate is in most cases not faster than similar libraries for other languages (e.g. Jax), but the integration with normal Haskell is very pleasant. As Haskell is a very nice and practical language for general-purpose programming, it's convenient to be able to use Accelerate for those parts where numerical performance is critical (but not so critical that you rewrite the entire program in CUDA or C).
I think this is only the fifty millionth time I've said this: get rid of the FOMO clickbait "project name only title" submissions, particularly since it is almost always something very few people have heard of.
I'd go so far as to say that any submission with a title that is less three words should get automatically binned, and posts to software projects should be required to explain in the title what the software is/does.
Is it just me or is this post also clearly vote-manipulated? Either that or a lot of NumPy people are hanging around on HN early on a Saturday morning.
Damn you for making me look in the OED thinking surely there’s an earlier usage of the word given it’s Latin roots and seeing the first citation as 1535.
It can vectorize, parallelize on the CPU, or offload to the GPU automatically.
It's a very mature project, maybe 10+ years old.
In particular, compare you JAX’s vmap — one model for vmap is that it is a program transformation on first order functions, that returns a first order function (“function” is a bit wonky here: but it’s JAX’s Jaxpr representation), but vmap itself is not a primitive in the Jaxpr language.
Is the same true here about map (can I think of it like vmap)? Or is it true that I can define higher order functions and Accelerate will handle them? What about functions with recursion?
Thanks! If you happen to see this - Futhark is very cool.
I'm not a Jax expert. Accelerate's 'map' allows for almost arbitrary sequential code - there is some fine print, because it's an embedded language, and the biggest fine print is that nested parallelism is not allowed. You can define your own Haskell-level higher order functions, and Accelerate will handle them just fine, because essentially all the Haskell-level computation is "compiled away" (by being run) before the Accelerate code is JIT-compiled at run-time. You can consider Haskell to be a meta-language in which you ultimately construct Accelerate program terms, and then those are compiled and run - not too dissimilar from how Jax does it, actually.
Recursion works, but for an uninteresting reason: the recursion is on the Haskell side, and will essentially be unrolled before Accelerate gets its hand on it. This allows you to do some fun things (like partially evaluating a ray tracer on its scene description), but it's often not what you want, and Accelerate provides some combinators (that look like higher-order Haskell functions) for expressing sequential looping.
Jokes aside, types should help a lot.
also, accelerate was first published to Hackage in 2009 though so it isn't an especially new thing.
I'd go so far as to say that any submission with a title that is less three words should get automatically binned, and posts to software projects should be required to explain in the title what the software is/does.
Is it just me or is this post also clearly vote-manipulated? Either that or a lot of NumPy people are hanging around on HN early on a Saturday morning.
/s
Overlaps in naming happen, especially when we all want to choose simple and catchy words like "Accelerate."