Helium: lifting high-performance stencil kernels from stripped x86 binaries to halide DSL code
Authors:
Open Access
- 3 June 2015
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 391-402
Abstract
Highly optimized programs are prone to bit rot, where performance quickly becomes suboptimal in the face of new hardware and compiler techniques. In this paper we show how to automatically lift performance-critical stencil kernels from a stripped x86 binary and generate the corresponding code in the high-level domain-specific language Halide. Using Halide’s state-of-the-art optimizations targeting current hardware, we show that new optimized versions of these kernels can replace the originals to rejuvenate the application for newer hardware. The original optimized code for kernels in stripped binaries is nearly impossible to analyze statically. Instead, we rely on dynamic traces to regenerate the kernels. We perform buffer structure reconstruction to identify input, intermediate and output buffer shapes. We abstract from a forest of concrete dependency trees which contain absolute memory addresses to symbolic trees suitable for high-level code generation. This is done by canonicalizing trees, clustering them based on structure, inferring higher-dimensional buffer accesses and finally by solving a set of linear equations based on buffer accesses to lift them up to simple, high-level expressions. Helium can handle highly optimized, complex stencil kernels with input-dependent conditionals. We lift seven kernels from Adobe Photoshop giving a 75% performance improvement, four kernels from IrfanView, leading to 4.97× performance, and one stencil from the miniGMG multigrid benchmark netting a 4.25× improvement in performance. We manually rejuvenated Photoshop by replacing eleven of Photoshop’s filters with our lifted implementations, giving 1.12× speedup without affecting the user experience.Keywords
Funding Information
- U.S. Department of Energy (DE-SC0005288 and DE-SC0008923)
This publication has 24 references indexed in Scilit:
- Integrating profile-driven parallelism detection and machine-learning-based mappingACM Transactions on Architecture and Code Optimization, 2014
- Halide2013
- Scalable variable and data type detection in a binary rewriter2013
- A compiler-level intermediate representation based binary analysis and rewriting system2013
- HELIX2012
- Transparent dynamic instrumentation2012
- BitBlaze: A New Approach to Computer Security via Binary Analysis2008
- Valgrind2007
- Analyzing Memory Accesses in x86 Executables2004
- An Approach to the Problem of Detranslation of Computer ProgramsThe Computer Journal, 1980