2 ms·
This has a chapter on low level optimisation in Owl: https://ocaml.xyz/book/core-opt.html https://ocaml.xyz/book/core-opt.html, which includes how core function
by matrixanger 6y ago
This has a chapter on low level optimisation in Owl: https://ocaml.xyz/book/core-opt.html https://ocaml.xyz/book/core-opt.html, which includes how core functions are implemented in C, and how OpenMP is utilised etc. Besides, Owl relies on certain libraries such as OpenBLAS and FFTPack for the performance of key operations in e.g. linear algebra.
- fluffything 6y agoThis chapter showcases the problem perfectly. It gives scientists a lot of information about how to perform low level optimization on code, e.g., if your code is "slow", use SIMD, OpenMP, BLAS, or do this or that trick. But it does not provide the scientist with even the most basic tools to answer the question: "Is my code fast or slow?" (i.e. should I optimize it at all?), much less "_Why_ is it slow, and what's the best way to address that?" (e.g. if it is slow because its using 100% of the peak FLOPs of the CPU, but your hardware has a GPU, so you end up with 1% total FLOP utilization, then none of the "tricks" there will help). It also completely avoids the issue that, in practice, a O(N) algorithm beats a OpenMP+SIMD-optimized O(N^2/p) algorithm pretty much all the time. The chapter kind of assumes that scientists OCaml code will be slow, and gives them a "bag of tricks" that they can try to make it faster. So we end up with the irony of a book on scientific computing that completely ignores the scientific method.