
Compiler Auto-Vectorization with Imitation Learning [pdf] - chmaynard
http://papers.nips.cc/paper/9604-compiler-auto-vectorization-with-imitation-learning.pdf
======
gok
ML seems like a great approach for compiler optimizations, as hand-written
heuristics have become almost unmaintainably complex. As the paper mentions,
reinforcement learning could be even more powerful.

The biggest barrier to deploying this kind of thing is probably ML skepticism
in the compiler world.

------
cs702
The agent, using a learned graph-DNN policy, produces a vectorization scheme
that:

* has a 22.6% higher average reduction in cost compared to LLVM compiler (as measured with its own cost model); and

* achieves a geometric mean runtime speedup of 1.015× on the NAS benchmark suite when compared to LLVM’s SLP vectorizer.

In short, the DNN achieves better performance in an NP-Hard problem than
human-tuned heuristics and human-designed algorithms.

------
stabbles
"achieves a geometric mean runtime speedup of 1.015× on the NAS benchmark
suite when compared to LLVM’s SLP vectorizer" sounds negligible?

~~~
sgillen
It looks like they get up to a 26% increase in the static case. And for NAS
they perform about as well (1.015x) as LLVM.

------
candiodari
One hope that this might be able to improve a bit on the traditional problem
you experience with optimizers: "will it still optimize if I move this
calculation 1 line down?".

I find the big problem with optimizers these days is not performance anymore.
I'd just so gladly trade even 2-3% performance for assurance that it's going
to actually _work_ , even if I move bits of code around a little bit. That it
won't slow down by a factor 2-3x.

------
thsealienbstrds
So, the advantage of this method is that it is practical and the closest one
to a method that produces the optimal solution. Where the latter method is at
risk of crazy compile times because it relies on solving a problem that is NP-
hard?

------
ekelsen
I'm generally unclear about the utility here - goSLP which generates the
training data seems to be significantly better at ~1.04. Is it because the NN
might be faster?

It would be illuminating to see approximate compile times. The 1.015 number
comes from 10 rollouts. Speedups are < 1 for 1 rollout. How long does goSLP
take vs. LLVM?

------
throwlaplace
does anyone know other areas of research at the intersection of ML and
compilers/languages? obviously i'm aware of building in auto-diff (S4TF) and
things like that but i mean outside of that and more things like this - where
you use both ML and PL/compiler theory.

------
_Microft
The title was unnecessarily editorialized?

The actual title is _" Compiler Auto-Vectorization with Imitation Learning"_.
It is currently titled _" MIT researchers develop new technique to generate
compiler optimizations [pdf]"_. Please don't do this.

~~~
charmen
The MIT news article is about the original performance prediction work, which
is an important piece for future reinforcement learning-based approaches.
([https://github.com/ithemal/Ithemal](https://github.com/ithemal/Ithemal)
[http://proceedings.mlr.press/v97/mendis19a.html](http://proceedings.mlr.press/v97/mendis19a.html)).
The imitation learning approach is a step towards how to automate the
development of compiler algorithms. Note that we are not merely tuning
heuristics, we learn the entire optimization algorithm.

------
deepnotderp
So imitation learning w/graph NNs for auto-vectorization plus some MIT PR team
editorializing?

~~~
charmen
The MIT news article is about the original performance prediction work, which
is an important piece for future reinforcement learning-based approaches.
[https://github.com/ithemal/Ithemal](https://github.com/ithemal/Ithemal)
[http://proceedings.mlr.press/v97/mendis19a.html](http://proceedings.mlr.press/v97/mendis19a.html)

