4 ms·
Skimming through this book, one thing i was constantly wondering, is how well does this ocaml framework use the hardware. Leaving ocaml aside, the connection b
by fluffything 6y ago
Skimming through this book, one thing i was constantly wondering, is how well does this ocaml framework use the hardware.
Leaving ocaml aside, the connection between scientific computing and hardware is the one thing I miss the most in "scientific computing" books and courses, because it sooner or later limits the science that any researcher doing scientific computing can do.
To give an example, earlier this week, one of our scientists was waiting 10 minutes between each interactive iteration of their data-set, so I was called to help, and the only feedback they gave was that "its slow", to which I replied "slow with respect to what? how fast are you expecting this to be and _why_?".
The answer to these questions is the difference between "maybe they just need a faster computer", "maybe they need a different algorithm", or even "maybe this problem cannot be solved today because computers this fast do not exist".
From their facial expression, it looked to me that they actually had never thought about any of this, probably because whatever they did before was always fast enough, but now this issue was limiting their science and they were lacking the bare minimum set of tools to even get proper help.
If you are doing scientific computing, chances are that the problems you are going to be dealing with are going to be getting bigger and harder as you advance in your career. For many scientists, the first problems will actually be big enough for the hardware to matter.
I wish scientific computing courses and books will at least provide the most basic tools to these scientist for them to at least be able to get meaningful help. Having someone on call for when this matters is quite expensive.
- matrixanger 6y agoThis 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.
- Bukhmanizer 6y agoLet’s face it, is this researcher ever going to read a book on scientific computing in OCaml? Most researchers won’t even read a book on scientific computing.
- fluffything 6y agoI suppose this book exists because somebody developed a scientific computing course at university that uses it. So I'd expect that every year, there will at least be a class of 30 scientists taking this course.
- jimbokun 6y agoWhy do you think that? That's like saying "most programmers would never read a book about science, or finance...", or whatever field they are writing software for.
- gnufx 6y ago> Why do you think that? Observation in research support, I'd guess. It typically no longer seems to be the case that you do whatever you need to for your data.
- pjmlp 6y agoThis is how we ended up with research being done in Python and R.
- gnufx 6y agoIt is a continuing source of wonder how many scientists seem unable to apply scientific method/research to computing. However, yes, things like debugging, measurement, and hardware features should be taught and rarely are apart from courses on performance engineering which seem to pass most by.