3 ms·
Check out my project NDScala (https://github.com/SciScala/NDScala https://github.com/SciScala/NDScala). N-dimensional arrays in Scala 3. Think NumPy ndarray, b
by emergentorder 5y ago
Check out my project NDScala (https://github.com/SciScala/NDScala https://github.com/SciScala/NDScala).
N-dimensional arrays in Scala 3. Think NumPy ndarray, but with compile-time type-checking/inference over shapes, ndarray/axis labels & numeric data types.
- zeec123 5y agoThanks. Does it map to native routines like numpy? If yes, what about the copy overhead from JVM to native memory?
- The_rationalist 5y agoNd4j (another project) enable to use cuda/MKL sota backends. It does native calls but I don't think the overhead is high. Besides some of those overhead are being optimized in the JNI successor.
- emergentorder 5y agoYes, it uses ONNX Runtime / MLAS (their native BLAS lib) under the hood. And yes, there is copy overhead but you can eliminate it internally to a single function/graph by compiling it down to a single ONNX model. The end result is within ~15% run time of PyTorch w/ MKL when training a reasonably-sized MLP. And ORT also provides support for CUDA and a number of other "execution providers".