Live data from Hacker News

Google ML Compiler Inlining Achieves 3-7% Reduction in Size

ai.googleblog.com

1–10 of 84 posts

Re: Google ML Compiler Inlining Achieves 3-7% Reduction in Size

#4
They 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

#7
post #6

Would 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

#9
The (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

#10
Compilers 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?
Post reply on HN