News for hackers. Stuff that matters.

hughleat

Re:Meta Releases LLM Compiler on Saturday June 29, 2024 @11:57AM (#40831480)
Never let a computer scientist name anything :-)
Re:Meta Releases LLM Compiler on Saturday June 29, 2024 @11:55AM (#40831471)
We plan to have a peer reviewed version of the paper where we will probably have more details on that. Otherwise we can't give anymore details than in the paper or post, etc. without going through legal which takes ages. Science is getting harder to do :-(
Re:Meta Releases LLM Compiler on Saturday June 29, 2024 @11:50AM (#40831425)
Yes! An AI building a compiler by learning from a super-optimiser is something I have wanted to do for a while now :-)
Re:Meta Releases LLM Compiler on Saturday June 29, 2024 @11:47AM (#40831408)
For the disassembler we round trip. x86 ->(via model) IR ->(via clang) x86. If they are identical then the IR is correct. Could be correct even if not identical, but then you need to check.

For the auto-tuning, we suggest the best passes to use in LLVM. We take some effort to weed out bad passes, but LLVM has bugs. This is in common with any auto-tuner.

We train it to emulate the compiler. The compiler does that better already. We do it because it helps the LLM understand the compiler better and it auto-tunes better as a result.

We hope people will use this model to fine-tune for other heuristics. E.g. an inliner which accepts the IR or the caller and callee to decide profitability. We think things like that will be vastly cheaper for people if they can start from LLM Compiler. Training LLMs from scratch is expensive :-)

IMO, right now, AI should be used to decide profitability not correctness.

Re:Meta Releases LLM Compiler on Friday June 28, 2024 @06:09PM (#40825828)
It can emulate the compiler (IR + passes -> IR or ASM).

> What would be more interesting is training a large model on pure (code, assembly) pairs like a normal translation task.

It is that.

> Presumably a very generalized model would be good at even doing the inverse: given some assembly, write code that will produce the given assembly.

Is has been trained to disassemble. It is much, much better than other models at that.

Re:Meta Releases LLM Compiler on Friday June 28, 2024 @06:06PM (#40825786)
There are two models.

- foundation model is pretrained on asm and ir. Then it is trained to emulate the compiler (ir + passes -> ir or asm)

- ftd model is fine tuned for solving phase ordering and disassembling

FTD is there to demo capabilities. We hope people will fine tune for other optimisations. It will be much, much cheaper than starting from scratch.

Yep, correctness in compilers is a pain. Auto-tuning is a very easy way to break a compiler.

Re:Meta Releases LLM Compiler on Friday June 28, 2024 @06:01PM (#40825731)
Yep! No GCC on this one. And yep, that's not far off how the pretraining data was gathered - but with random optimisations to give it a bit of variety.
Re:Meta Releases LLM Compiler on Friday June 28, 2024 @06:00PM (#40825719)
Yep, we tried it :-) These were exactly the problems we had with it.