by onetimeuse92304 · 2y ago · 0 comments
A lot of the time even I can't tell what is going to be the optimum setting.
So for a number of years, rather than expose a configuration parameter, I am building in a performance test that establishes the values of these parameters.
This is a little bit of search and a hill climb through the multidimensional space of all relevant parameters. It is not perfect, but in my experience it is almost always better than I can do manually and always better than an operator without intimate understanding of the system.
The results are cached in a database and can be re-executed if change to configuration is found (just take a number of parameters from your environment, version of the application, etc. and hash the value and check if you already have parameters in the database).
As usual, there is no single universal solution to optimising performance (and in fact it can be trivially proven to not exist in general case). But you do not have to find perfect solution, you just have to be able to find as good or better solution than a human operator would.
When you have a large system you can be working with thousands or tens of thousands of parameters. I usually see that even if the application is migrated to different hardware, the configuration parameters like buffer sizes, concurrency, connection pools, etc. are not really revisited. The effect is that usually the application will work suboptimally for the environment it is in.
My solution is an attempt to keep this part of application configuration sufficiently close enough to optimal to be usable and do it automatically without operator involvement (and associated cost and possibility for defects).
I guess you could even use those if you're not using python. But it'd require slightly more plumbing.
% alias make
make='nice -n 20 make -j4'
But I found that even with a nice level of 20 using all CPUs doesn't quite give me the responsiveness I want for other tasks.I run all builds in containers/vms anyway as I am too tired to keep my personal machine able to build hundreds of different things. It is better to have a dedicated development environment frozen for each of the projects I work on.
Its "wisdom" system will plan/measure the best way to do transforms of a particular size/type and cache it for future use.
More here: https://www.fftw.org/fftw3_doc/Words-of-Wisdom_002dSaving-Pl...
Thanks for the link, I will take a look when I have a moment:)
But BLAS is a very weird case, there are only a couple kernels that you care about (and the most important, GEMM, has been studied like crazy). And BLAS is used under the hood by pretty much the whole HPC community, so there’s incentive for tons of expert human time investment.
You can look at ilbflame/BLIS for the modern strategy.
ATLAS is still neat, perhaps one can even derive more generally applicable lessons from that library, not sure…
e.g. I remember vaguely people using it on AMD cpus because they couldn't use icc/mkl effectively...
I'd be really interested in a blog post about this.
But now that I think about it, I could write a small library to automate most of it while delegating some tasks to the application (providing functionality to be tested, parameters and possible ranges to be searched, a way to save/restore parameters to/from the database, provide fitness function, etc.) It is essentially a small benchmarking framework with some added functionality. I think it could be quite useful to some people.