Improving Vectorization Heuristics in a Dynamic Compiler with Machine Learning Models
summary
Machine learning replaces GraalVM’s hand-tuned post-vectorization unroll heuristic by a trained model that predicts loop unroll factors using ~142 code features extracted from 140k measured vectorized loops across 231 microbenchmarks. A random forest classifier is deployed inside the dynamic compiler, finds several large speedups that expose a compiler bug, and yields a geometric mean improvement of 8-11% on those benchmarks; model loading and feature extraction add compile-time overhead and generalization to large real-world suites is limited.
AI-written summary · about
chapters (16)
- 0:00Intro
- 0:19Loop Vectorization
- 1:18Unrolling of Vectorized Loops
- 3:18What do we need?
- 5:14Data Generation
- 7:56Vector Operation Features
- 8:53Vector Component Features
- 9:55Graph Features
- 10:20Features - Overview
- 10:57Label Distribution
- 12:34Model Training
- 14:00Cross Validation Setup
- 14:39Training Configurations
- 15:28Training Results
- 20:10Model Size → Compile Time
- 22:01Improving Vectorization Heuristics. in a Dynamic Compiler with Machine Learning Models
related talks
16mAccelerate HPC and AI Applications with RVV Auto-Vectorization
54mProgramming Language Design and Implementation for the Machine Learning Era: A Personal(…)
33mImproving the Effectiveness and Generality of GCC Auto-Vectorization
17mRecent Developments in Optimizing Compilers for RISC-V
21mDiagnosing Compiler Performance by Comparing Optimization Decisions
54mProgramming Language Design and Implementation for the Machine Learning Era: A Personal(…)
51m"Manual" Vectorization in 2025: When the Compiler Is Not Enough
19mGetting the Most out of the LLVM Auto Vectorizer for RISC-V Vectors (RVV)
