Reproducing MILEPOST project

Grigori Fursin edited this page Jun 5, 2018 · 3 revisions

[ Home ]

Here we describe how to install MILEPOST GCC and cTuning CC via CK to be able to extract semantic program features and enable research on self-tuning compilers. However, note that MILEPOST GCC is now quite outdated, and we now use another approach where we first find unexpected behavior and optimizations, cluster benchmarks, and only then find related program, data set and hardware features. See:

Table of Contents

Obtaining the workflow with all dependencies

 $ ck pull all --kernel
 $ ck pull repo:reproduce-milepost-project

You may need to install the following dependencies for Linux to compile MILEPOST GCC via CK:

 $ apt-get install g++-multilib libc6-dev-i386

Then you can try to install all tools via:

 $ ck install package:compiler-ctuning-cc-2.5-plugins-src-linux

Note, that above command should normally install all dependencies needed for MILEPOST GCC (including GMP, MPFR, MPC, etc) as well as cTuning CC and GCC plugins. You can follow questions and normally just press Enter (answering Yes to all questions).

Checking feature extraction

You can find a demo entry with several scripts demonstrating how to extract semantic program features:

 $ ck find demo:ctuning-cc

This directory you have a demo script _use_ctuning_cc_directly_extract_features.sh as well as susan corners program written in C. When you run this script, it should normally extract features of this program into tmp directory.

Then you can similarly extract features for your C, C++ and Fortran applications ...

Script _use_ctuning_cc_via_ck_pipeline.sh shows you how to automatically extract semantic MILEPOST program features from programs in CK format (via CK universal autotuning workflow).

Using already extracted features from CK workloads

We extracted and saved semantic MILEPOST features in CK format for all shared workloads (such as from the ctuning-programs repo). You can find them via:

 $ ck list program.static.features

For example, you can use features per function for susan program via CMD:

 $ ck load program.static.features:cbench-automotive-susan

You can load above features using CK:

 import ck.kernel as ck
 r=ck.access({'action':'load', 
              'module_uoa':'program.static.features', 
              'data_uoa':'cbench-automotive-susan'})
 if r['return']>0: return r
 sfeatures=r['dict'].get('features',{}).get('program_static_milepost_features',{})

Implementing optimization prediction service in CK

cTuning CC is still connected to the deprecated Collective Mind JSON service (http://cknowledge.ddns.net/cm/repo/?cm_menu=scenarios&cm_submenu=ctuning_pipeline_build_and_run_program_predict_opt). We plan to implement it in CK (see ck-autotuning ticket https://github.com/ctuning/ck-autotuning/issues/10).

Questions and comments

You are welcome to get in touch with the CK community if you have questions or comments!

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.