Google ML Compiler Inlining Achieves 3-7% Reduction in Size
ai.googleblog.com
Google ML Compiler Inlining Achieves 3-7% Reduction in Size
1–10 of 84 posts
Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#2... and 1-2% improvement in performance via the register allocator.
Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#3... and 1-2% improvement in performance via the register allocator.
In this day and age, that's a pretty large compiled code performance improvement from just one feature.
Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#4They trained (and report) two optimization strategies:
- inline-for-size
We trained the inlining-for-size policy on a large internal software package containing 30k modules. The trained policy is generalizable when applied to compile other software and achieves a 3% ~ 7% size reduction.
- regalloc with 0.3% ~1.5% improvements in queries per second (QPS) on a set of internal large-scale datacenter applications
Try it Yourself
Check out the open-sourced end-to-end data collection and training solution on github and a demo that uses policy gradient to train an inlining-for-size policy.
https://github.com/google/ml-compiler-opt
https://github.com/google/ml-compiler-opt/blob/main/docs/demo/demo.md
With code, that's awesome—what I like to see.Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#5[deleted]
Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#6Would be interesting to compare with gcc, which has a better implementation of both inlining and register allocation.
Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#7Would be interesting to compare with gcc, which has a better implementation of both inlining and register allocation.
I still want to see the estimated distance heuristic (https://dspace.library.uvic.ca/bitstream/handle/1828/7107/Bu...) in a modern compiler.
Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#8Neat.
It seems like it's sort of built in to LLVM right now, but not usable unless you build LLVM yourself with pretrained models as part of the build process?
Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#9The (current) title used on HN (“Google ML Compiler Inlining Achieves 3-7% Reduction in Size”) is confusing. It made me think Google is using ML (https://en.wikipedia.org/wiki/ML_(programming_language))
It also is not the one of the referred page, which is “MLGO: A Machine Learning Framework for Compiler Optimization”.
This is about an LLVM extension that uses Machine Learning.
I think it would be better to change the title here.
Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size
#10Compilers have soooo many heuristics. And a lot of it looks like a chess or Go game: You have a list of 100s of AST optimization passes (possible moves) that preserve the semantics of the program but you have limited compute with which to run iterations of these passes. What order and combination of these should you use?