HACKER Q&A
📣 agluszak

Is there a compiler powered by a neural net?


OpenAI has recently shared a demo[1] where they "translate" English descriptions of tasks to Bash commands. I wonder if somebody experimented with using neural nets to compile code, i.e. to "translate" for example Java to JVM bytecode. The dataset for such neural net is easily obtainable and wouldn't require manual labelling at all.

[1] - https://beta.openai.com/?app=chat&demo=5


  👤 bruce511 Accepted Answer ✓
I'm not sure I understand what you are asking. Compiling English to bash sounds like a thing because English is a very imprecise way of describing a set of computational tasks.

Whereas java is the exact opposite. Every single command in java is precisely defined, and does exactly what you tell it to do. Compilers already have 100% effectiveness on doing this.

I am lead to assume that an AI would then compile "what I meant" and not "what I wrote". I'm not sure that's helpful because that sounds like a great way to get random, sometimes, bugs.

If you are getting errors from the compiler it is because your code is imprecise - and the fix there is to make it more precise.

I may have misinterpreted your question, or lack the imagination to see where you are going, so please feel free to expand on your point.


👤 lamchob
In the area of AutoTuning some machine learning methods are used. The goal is to optimize throughput or latency for compute intensive workloads. The machine learning model is trained with performance measurements on the hardware and then use it as proxy for real execution to try out different configurations.

Notable works:

AutoTVM - https://arxiv.org/abs/1805.08166

CHAMELEON - https://deepai.org/publication/chameleon-adaptive-code-optim...

GPU-Warp Scheduling - https://deepai.org/publication/rlws-a-reinforcement-learning...