The GitHub page doesn't mention what I would consider the leading competitor at all.
I just don't think it's really a competitor. I can see how there is some overlap, but in Neanderthal you'd be vectorizing things much more manually and you'd naturally get more performance. It's more-or-less the most performance you can get out of the CPU b/c it's optimized Fortran routine under the hood. (not that BLAS and IntelMKL are impossible to improve on, but they have decades of research and design behind them)
I also think Neanderthal isn't going to parallelize workloads. You'd have to do that manually yourself
I had to parallelize a routine in Neanderthal and it was very difficult to contort the problem to work with the tools provided. The BLAS routines do not really map directly to linear algebra operations. Some rather basic linear algebra steps become completely unclear in BLAS (I remember I wanted to zero out to columns of a matrix and it look ages to figure out how the system expected me to do it). But when BLAS doesn't fit that's usually a code-smell. What makes sense in a proof or paper-algo maybe doesn't make sense in code and you need to rethink how to do the algo. With LLMs it's probably a bit less daunting. All that said, the Neandertal API is always way way way nicer to use than the Intel MKL C++ one. Using that directly is a nightmare
Another downside is that it's also going to create huge bundle sizes if you need to distribute it b/c it bundles all of the MKL. Nonetheless it forces you to write performant code and it's fun to use at the REPL. I made my first prototype in Neandethal, then once I had a design I liked I rewrote it using OjAlgo and got comparable performance and it was all on the JVM. (I vaguely remember some part actually ending up faster b/c some memory was not being copied around)
once I had a design I liked I rewrote it using OjAlgo and got comparable performance and it was all on the JVM.
Interesting! Did you write it in Java or use a Clojure wrapper?
edit: Oh, and as for performance, I just remembered that Julia uses BLAS under the hood, so I imagine Neanderthal has similar performance characteristics.
I wrote the code with Neanderthal, then I refactored the interface to a Protocol. Then I had it set up so there are two "backends" that implement the protocol. The OjAlgo one just does Java interop calls
Julia uses BLAS under the hood
I haven't used Julia, but MATLAB has a similar setup. It generally abstracts most of things away and allows you to just write textbook-like code. I think it has some cleverness in the back to make the outputs optimal.. but it's also very possible to write very slow or very numerically unstable code. With straight BLAS/Neanderthal there is less handholding and lots seemingly basic operations are just not in the API.
Like a basic example, there is no function to make an identity matrix. (I think you're expected to make a diagonal matrix and feed in a series of 1's)
View all comments
Show parent comment
2
u/geokon Jun 25 '26 edited Jun 25 '26
I just don't think it's really a competitor. I can see how there is some overlap, but in Neanderthal you'd be vectorizing things much more manually and you'd naturally get more performance. It's more-or-less the most performance you can get out of the CPU b/c it's optimized Fortran routine under the hood. (not that BLAS and IntelMKL are impossible to improve on, but they have decades of research and design behind them)
I also think Neanderthal isn't going to parallelize workloads. You'd have to do that manually yourself
I had to parallelize a routine in Neanderthal and it was very difficult to contort the problem to work with the tools provided. The BLAS routines do not really map directly to linear algebra operations. Some rather basic linear algebra steps become completely unclear in BLAS (I remember I wanted to zero out to columns of a matrix and it look ages to figure out how the system expected me to do it). But when BLAS doesn't fit that's usually a code-smell. What makes sense in a proof or paper-algo maybe doesn't make sense in code and you need to rethink how to do the algo. With LLMs it's probably a bit less daunting. All that said, the Neandertal API is always way way way nicer to use than the Intel MKL C++ one. Using that directly is a nightmare
Another downside is that it's also going to create huge bundle sizes if you need to distribute it b/c it bundles all of the MKL. Nonetheless it forces you to write performant code and it's fun to use at the REPL. I made my first prototype in Neandethal, then once I had a design I liked I rewrote it using OjAlgo and got comparable performance and it was all on the JVM. (I vaguely remember some part actually ending up faster b/c some memory was not being copied around)