NeuroVectorizer: End-to-End Vectorization with Deep Reinforcement Learning

09/20/2019
by   Ameer Haj-Ali, et al.
0

One of the key challenges arising when compilers vectorize loops for today's SIMD-compatible architectures is whether to vectorize and/or interleave. Then, the compiler has to determine how many instructions to pack together and how many loop iterations to interleave. Compilers are designed today to use fixed-cost models that rely on heuristics to make vectorization decisions on loops. However, these models are unable to capture data dependencies, access patterns, and computation graphs. Alternatively, software engineers often hand-write the vectorization factors of every loop. This however places a huge burden on them, since it requires prior experience and significantly increases the development time. In this work, we explore a novel approach for handling loop vectorization, and propose an end-to-end solution using deep reinforcement learning (RL). We conjecture that deep RL can capture different instructions, dependencies, and data structures to enable learning a sophisticated model that can better predict the actual performance cost and determine the optimal vectorization factors. We develop an end-to-end framework, from code to vectorization, that integrates deep RL in the LLVM compiler. Our proposed framework takes benchmark codes as input and extracts the loop codes. These loop code are then fed to a loop embedding generator that learns an embedding for these loops. Finally, the learned embeddings are used as input to a deep RL agent, which dynamically determines the vectorization factors for all the loops. We further extend our framework to support random search, decision trees, and nearest-neighbor search. We evaluate our approaches against the currently used LLVM vectorizer and loop polyhedral optimization techniques. Our experiments show 1.29X-4.73X performance speedup compared to baseline and only 3

READ FULL TEXT
research
10/08/2015

Data-Efficient Learning of Feedback Policies from Image Pixels using Deep Dynamical Models

Data-efficient reinforcement learning (RL) in continuous state-action sp...
research
10/19/2019

Explainable AI: Deep Reinforcement Learning Agents for Residential Demand Side Cost Savings in Smart Grids

Motivated by the recent advancements in deep Reinforcement Learning (RL)...
research
10/23/2021

Policy Search using Dynamic Mirror Descent MPC for Model Free Off Policy RL

Recent works in Reinforcement Learning (RL) combine model-free (Mf)-RL a...
research
08/28/2023

Target-independent XLA optimization using Reinforcement Learning

An important challenge in Machine Learning compilers like XLA is multi-p...
research
04/26/2021

End-to-end grasping policies for human-in-the-loop robots via deep reinforcement learning

State-of-the-art human-in-the-loop robot grasping is hugely suffered by ...
research
09/18/2020

Deep Reinforcement Learning for Closed-Loop Blood Glucose Control

People with type 1 diabetes (T1D) lack the ability to produce the insuli...
research
08/20/2020

Static Neural Compiler Optimization via Deep Reinforcement Learning

The phase-ordering problem of modern compilers has received a lot of att...

Please sign up or login with your details

Forgot password? Click here to reset