Profile-Guided Optimization tools : problems, methods and approaches in their development

Loading...
Thumbnail Image

Files

URL

Journal Title

Journal ISSN

Volume Title

Perustieteiden korkeakoulu | Bachelor's thesis
Electronic archive copy is available locally at the Harald Herlin Learning Centre. The staff of Aalto University has access to the electronic bachelor's theses by logging into Aaltodoc with their personal Aalto user ID. Read more about the availability of the bachelor's theses.

Department

Major/Subject

Mcode

SCI3027

Language

en

Pages

25

Series

Abstract

The digital age has created a constantly growing demand for computing power in both industrial and research sectors. Increasing the number of servers is however not a sustainable, long-term solution, but rather the pre-existing hardware should be utilized more efficiently. Profile-Guided Optimization (PGO) is an umbrella term for methods used for improving program performance by utilizing profiles formed from collected runtime data. Using these profiles compilers and post-link optimization tools can rearrange the program code at various stages to optimize memory layout, cache usage, or other performance factors. This study was conducted as a literature review, intending to form a comprehensive overview of the methods and challenges in PGO, as well as modern PGO tools and their respective design choices. The study compares various PGO tools and analyzes their paradigms, benefits, and limitations. The thesis also discusses the compilation pipeline as this is integral knowledge for program optimization. Sources utilized in the study consist of scientific and conference publications, technical documentation, and expert blogs. The study considers two profile collection methods: instrumentation and sampling. Software-based instrumentation produces more precise profiles while incurring some overhead in runtime performance. Hardware-based sampling is better suited for production environments due to the lack of a performance overhead, but it produces lower-quality profiles. Both methods are utilized in software production depending on the size of the target program and the runtime environment. Sampling has been utilized in recently developed PGO tools thanks to the advancements in hardware performance counters. Such tools include AutoFDO, BOLT, and Propeller. The study touches on the subject of future PGO development trends and discusses context-sensitive sampling-based PGO (CSSPGO) as well as the use of machine learning methods in program optimization. PGO tool development will strive for higher performance gains. One area of focus for this progress will be more accurate profiling with minimal performance overhead, likely meaning developments in sampling accuracy and mitigation of quality defects in profiles.

Digitaalisen aikakauden myötä palvelimien sekä tietokoneiden laskentatehon kysyntä on kasvanut jatkuvasti niin teollisuus- kuin tutkimussektorillakin. Palvelinten määrän jatkuva kasvattaminen ei kuitenkaan ole kestävä ratkaisu, minkä vuoksi olemassa olevaa laskentatehoa on pyrittävä hyödyntämään tehokkaammin. Profiiliohjattu optimointi (profile-guided optimization, PGO) on kattotermi menetelmille, joissa ohjelman suorituskykyä parannetaan hyödyntämällä suoritusprofiileja, joita kerätään ohjelman suorituksesta. Tämän profiilin perusteella ohjelmakoodia voidaan järjestellä uudelleen esimerkiksi kääntäjässä tai binääritasolla suorituskyvyn, muistin- ja välimuistinkäytön optimoimiseksi. Työ on toteutettu kirjallisuuskatsauksena, ja sen tavoitteena on muodostaa kattava yleiskuva PGO:n menetelmistä, haasteista ja nykyaikaisista työkaluista niiden suunnitteluratkaisujen näkökulmasta. Työssä vertaillaan erityyppisiä PGO-työkaluja sekä analysoidaan niiden lähestymistapoja, hyötyjä ja rajoitteita. Työssä käsitellään myös kääntäjien toimintaa, mikä on keskeinen osa ohjelmien ja profiiliohjatun optimoinnin ymmärtämistä. Työssä hyödynnetyt lähteet ovat tieteellisiä artikkeleita, konferenssijulkaisuja, teknistä dokumentaatiota ja asiantuntijablogeja. Työ käsittelee erityisesti kahta profiilin keräystapaa: instrumentointia ja näyteenottoa. Ohjelmistopohjainen instrumentointi tuottaa tarkempia mittauksia, mutta aiheuttaa suoritusaikaisia tehokustannuksia. Laitteistopohjainen näytteenotto soveltuu paremmin tuotantoympäristöihin, mutta tuotettu mittausdata on epätarkempaa. Kumpaakin lähestymistapaa käytetään kohdeohjelman koosta ja ympäristöstä riippuen. Näytteenottoa on hyödynnetty yhä enemmän PGO-työkaluissa laitteistotason suorituskykymittareiden kehityksen myötä. Tämän johdosta on kehitetty työkaluja kuten AutoFDO, BOLT ja Propeller, jotka hyödyntävät näytteenottoa profiiliohjatussa optimoinnissa. Tutkimus käsittelee myös alan kehityssuuntia ja tuo esiin kontekstiherkän profiiliohjatun optimoinnin (context-sensitive sampling-based PGO, CSSPGO) sekä koneoppimisen hyödyntämisen optimoinnissa. PGO-teknologioiden kehitys pyrkii kohti tarkempaa näytteenottoa, laajempia profiileja ja parempaa profiilidatan hyödyntämistä, joiden avulla voidaan saavuttaa parempia suorituskykyparannuksia.

Description

Supervisor

Savioja, Lauri

Thesis advisor

Malykhina, Tetiana

Other note

Citation