Hi!
I’m looking for a C# library for matrix operations and preferably some linear algebra or optimization routines. Basically a NumPy/SciPy or PyTorch.
Ideally there’d be support for various backends (e.g. CPU, CUDA, OpenCL) for operations where possible.
As far as I can tell, there’s Math.NET Numerics, Numpy.NET (which binds to Python’s numpy), and NumSharp (which hasn’t had commits since 2021), which seem to fit the bill mostly, though none are accelerated.
Otherwise, there are some libraries I’ve forgotten that seem to specifically target CUDA, which is too selective for my purpose. Maybe it was Hybridizer, which seems like its own compiler, which I’m not sure would work for me either.
There’s also ComputeSharp which lets you write shaders directly in C#, though targets DirectX if I understand well.
The closest thing I’ve found is ILGPU, which seems brilliant since it JIT compiles kernels to CPU, CUDA, and OpenCL. The problem is I believe I’d need to write my own operations and kernels and essentially implement my own matrix compute library, though there seems to be some work on it, so maybe what I’m looking for is supported out of the box, minus optimization algorithms and so on.
Basically, does anyone have any pointers?
The closest thing I’ve been able to find so far (which seems to have been under slow development by 1-2 contributors for the past couple years) is https://github.com/MPSQUARK/BAVCL which is based on ILGPU. I’ll probably be keeping an eye on it though.