Panoptes: A Profile Clustering Framework for Context-Aware Binary Optimization
Optimization strategies are widely employed to ensure efficient execution of applications. However, aggressive optimization strategies such as compiler autotuning and profile-guided optimization suffer from scalability issues when dealing with a large suite of programs. Clustering techniques become a focal point in this regard, as they can detect binaries with similar bottlenecks and promote reuse of optimizations between them. However, existing program clustering techniques fail to cluster at granularities that represent meaningful optimization targets, thus hindering their utility.
To solve this, we introduce Panoptes, a clustering and visualization tool designed to identify common optimization targets across multiple binaries. Panoptes clusters Single-Entry-Single-Exit (SESE) regions – a granularity large enough to encompass program structures yet small enough to effectively pinpoint program hot spots. Our tool incorporates Dynamic Binary Instrumentation (DBI) techniques, to filter and prioritize high-impact candidates for optimization. Subsequently, a recurrent autoencoder generates embeddings from the filtered regions, thereby providing a compatible yet information-dense representation for clustering algorithms. The resulting clusters enable developers to identify effective optimizations that are applicable across an entire cluster. Additionally, Panoptes incorporates a Graphical User Interface (GUI) that enables the visualization and exploration of program clusters, assisting user-guided optimization efforts. To demonstrate the capabilities of Panoptes, we examine case studies that involve analyzing various benchmark suites to evaluate the framework’s efficiency in identifying, clustering, and visualizing areas of interest for optimizing binaries.