4 ms·
This comment is tangential at best, but coming from someone who has never written a compiler (i.e. I'm a Dunning-Kruger peak), I'm curious to know if ML approac
by bick_nyers 3y ago
This comment is tangential at best, but coming from someone who has never written a compiler (i.e. I'm a Dunning-Kruger peak), I'm curious to know if ML approaches could drive more optimizations. As I understand it, compiler optimizations are NP-hard so they use heuristics and clever ways to constrain the search space for optimizations, which I would think could be potentially guided by ML?
I think that there would be a lot of cases where engineers would accept 10x longer compile times if it gave 10% more application performance.
- pjc50 3y agoML systems do not guarantee valid output. If you have a system that can prove a given transformation is behavior-preserving, then sure you can let the AI have a go at it and then check the result, but having such a checker is much harder than it sounds.
- brickteacup 3y ago> ML systems do not guarantee valid output no one said this has to be an LLM or whatever. you could have a compiler that just uses ML-based cost heuristics. iirc some research has already been done in this direction
- compiler-guy 3y agoThere is a fair amount of academic research on this topic. Eg, MLGO[1], but I don't know of any being used for production work. 1. https://arxiv.org/pdf/2101.04808.pdf https://arxiv.org/pdf/2101.04808.pdf
- bick_nyers 3y agoThanks for the link, I've seen statistical models used in computer architecture e.g. branch predictors, so I figured it might translate to compilers as well. Excited to learn more when I take a compiler course next year, as compilers are the most "dark magic" part of software to me.