Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Ainsworth committed Nov 20, 2016
1 parent 26edc33 commit 6b49f75
Show file tree
Hide file tree
Showing 532 changed files with 40,654 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .ckr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"data_uid": "640f0b9dadc5bfda",
"data_name": "Artifacts to reproduce experiments from CGO 2017 paper by S.Ainsworth and T.M.Jones 'Software Prefetching for Indirect Memory Accesses'",
"dict": {
"url": "https://github.com/SamAinsworth/reproduce-cgo2017-paper",
"shared": "git",
"repo_deps": [
{
"repo_uoa": "ck-autotuning"
}
]
},
"data_alias": "reproduce-cgo2017-paper",
"data_uoa": "reproduce-cgo2017-paper"
}
1 change: 1 addition & 0 deletions .cm/alias-a-module
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
032630d041b4fd8a
1 change: 1 addition & 0 deletions .cm/alias-a-package
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1dc07ee0f4742028
1 change: 1 addition & 0 deletions .cm/alias-a-program
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b0ac08fe1d3c2615
1 change: 1 addition & 0 deletions .cm/alias-a-script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
84e27ad9dd12e734
1 change: 1 addition & 0 deletions .cm/alias-a-soft
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5e1100048ab875d7
1 change: 1 addition & 0 deletions .cm/alias-u-032630d041b4fd8a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module
1 change: 1 addition & 0 deletions .cm/alias-u-1dc07ee0f4742028
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package
1 change: 1 addition & 0 deletions .cm/alias-u-5e1100048ab875d7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
soft
1 change: 1 addition & 0 deletions .cm/alias-u-84e27ad9dd12e734
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
script
1 change: 1 addition & 0 deletions .cm/alias-u-b0ac08fe1d3c2615
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
program
Empty file added AUTHORS
Empty file.
Empty file added COPYRIGHT
Empty file.
Empty file added LICENSE
Empty file.
141 changes: 139 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,139 @@
# reproduce-cgo2017-paper
Artifact Evaluation Reproduction for "Software Prefetching for Indirect Memory Accesses", CGO 2017, using CK.
Auto and crowd-tuning framework for PLUTON library
==================================================

This repository contains artifacts and workflows
to reproduce experiments from the CGO 2017 paper
by S.Ainsworth and T.M.Jones
"Software Prefetching for Indirect Memory Accesses"

Hardware pre-requisities
========================
Any of the following three architectures:
* Intel-based
* ARMv7
* ARM64

Software pre-requisites
=======================

* Python 2.7 or 3.3+
* git client
* Collective Knowledge Framework (CK) - http://cKnowledge.org
* All other dependencies will be installed by CK (LLVM 3.9 and plugins)

You can install above dependencies on Ubuntu via:
```
$ sudo apt-get install python python-pip git
$ sudo pip install ck
```

Installation
============

You can install this repository via CK as following:
$ ck pull repo --url=https://github.com/SamAinsworth/reproduce-cgo2017-paper

You can install LLVM 3.9 via CK as following:
$ ck install package:compiler-llvm-3.9.0-linux-download

You can install 2 LLVM plugins described in the above paper as following:
$ ck install package:plugin-llvm-sw-prefetch-no-strides-pass
$ ck install package:plugin-llvm-sw-prefetch-pass

Testing installation
====================

You can compile and run one of the benchmarks (NAS CG) with the LLVM plugin as following:
$ ck compile program:nas-cg --speed --env.CK_COMPILATION_TYPE=auto
$ ck run program:nas-cg

Running experimental workflows (reproducing figures)
====================================================



TBD add compilation to the experimental workflow:
$ ck compile program:graph500 --speed --env.CK_COMPILATION_TYPE=auto
$ ck compile program:graph500 --speed --env.CK_COMPILATION_TYPE=auto-nostride
$ ck compile program:graph500 --speed --env.CK_COMPILATION_TYPE=man-inorder
$ ck compile program:graph500 --speed --env.CK_COMPILATION_TYPE=man-outoforder
$ ck compile program:graph500 --speed --env.CK_COMPILATION_TYPE=man-inorder-nostride
$ ck compile program:graph500 --speed --env.CK_COMPILATION_TYPE=man-outoforder-nostride
$ ck compile program:graph500 --speed --env.CK_COMPILATION_TYPE=no

$ ck compile program:hashjoin-ph-2 --env.CK_COMPILATION_TYPE=auto
$ ck compile program:hashjoin-ph-2 --env.CK_COMPILATION_TYPE=auto-nostride
$ ck compile program:hashjoin-ph-2 --env.CK_COMPILATION_TYPE=man
$ ck compile program:hashjoin-ph-2 --env.CK_COMPILATION_TYPE=offset --env.CK_FETCHDIST={2,4,8,16,32,64,128,256}
$ ck compile program:hashjoin-ph-2 --env.CK_COMPILATION_TYPE=no

$ ck compile program:hashjoin-ph-8 --env.CK_COMPILATION_TYPE=auto
$ ck compile program:hashjoin-ph-8 --env.CK_COMPILATION_TYPE=auto-nostride
$ ck compile program:hashjoin-ph-8 --env.CK_COMPILATION_TYPE=man
$ ck compile program:hashjoin-ph-8 --env.CK_COMPILATION_TYPE=prefetches --env.CK_NUMPREFETCHES={1,2,3,4}
$ ck compile program:hashjoin-ph-8 --env.CK_COMPILATION_TYPE=no

$ ck compile program:nas-cg --speed --env.CK_COMPILATION_TYPE=auto
$ ck compile program:nas-cg --speed --env.CK_COMPILATION_TYPE=auto-nostride
$ ck compile program:nas-cg --speed --env.CK_COMPILATION_TYPE=man
$ ck compile program:nas-cg --speed --env.CK_COMPILATION_TYPE=offset --env.CK_FETCHDIST={2,4,8,16,32,64,128,256,2048}
$ ck compile program:nas-cg --speed --env.CK_COMPILATION_TYPE=offset-64-nostride
$ ck compile program:nas-cg --speed --env.CK_COMPILATION_TYPE=no

$ ck compile program:nas-is --speed --env.CK_COMPILATION_TYPE=auto
$ ck compile program:nas-is --speed --env.CK_COMPILATION_TYPE=auto-nostride
$ ck compile program:nas-is --speed --env.CK_COMPILATION_TYPE=man
$ ck compile program:nas-is --speed --env.CK_COMPILATION_TYPE=offset --env.CK_FETCHDIST={2,4,8,16,32,64,128,256,2048}
$ ck compile program:nas-is --speed --env.CK_COMPILATION_TYPE=offset-64-nostride
$ ck compile program:nas-is --speed --env.CK_COMPILATION_TYPE=no

$ ck compile program:randacc --speed --env.CK_COMPILATION_TYPE=auto
$ ck compile program:randacc --speed --env.CK_COMPILATION_TYPE=auto-nostride
$ ck compile program:randacc --speed --env.CK_COMPILATION_TYPE=man
$ ck compile program:randacc --speed --env.CK_COMPILATION_TYPE=offset --env.CK_FETCHDIST={2,4,8,16,32,64,128,256}
$ ck compile program:randacc --speed --env.CK_COMPILATION_TYPE=offset-32-nostride
$ ck compile program:randacc --speed --env.CK_COMPILATION_TYPE=no


Compare with pre-recorded results (expected)

If unexpected behavior, report the author

Jupyter notebook

Manual validation (if problems with CK)
=======================================

for x86-64:

$cd script/reproduce-cgo2017-paper

To compile:

$./compile_x86.sh

To run:

$./run_x86.sh

for ARM64:

cross compilation for ARM64 on an x86-64 machine:

$cd script/reproduce-cgo2017-paper
$./compile_aarch64.sh

running on an ARM64 machine:

$cd script/reproduce-cgo2017-paper
$./run_arm.sh

Recompilation should not be necessary, as all binaries are included, but is provided as an option.

Authors
=======
S.Ainsworth and T.M.Jones

Acknowledgments
===============
This work was supported by the Engineering and Physical Sciences Research Council (EPSRC), through grant references EP/K026399/1 and EP/M506485/1, and ARM Ltd.
1 change: 1 addition & 0 deletions module/.cm/alias-a-experiment-cgo2017
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
be5044a069071727
1 change: 1 addition & 0 deletions module/.cm/alias-u-be5044a069071727
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
experiment-cgo2017
1 change: 1 addition & 0 deletions module/experiment-cgo2017/.cm/desc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
21 changes: 21 additions & 0 deletions module/experiment-cgo2017/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"backup_data_uid": "be5044a069071727",
"backup_module_uid": "032630d041b4fd8a",
"backup_module_uoa": "module",
"control": {
"author": "",
"author_email": "",
"author_webpage": "",
"copyright": "",
"engine": "CK",
"iso_datetime": "2016-11-18T13:22:27.411345",
"license": "",
"version": [
"1",
"8",
"4",
"2"
]
},
"data_name": "experiment-cgo2017"
}
13 changes: 13 additions & 0 deletions module/experiment-cgo2017/.cm/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"actions": {
"reproduce": {
"desc": "reproduce experiment"
}
},
"copyright": "",
"desc": "Reproducing experiment from CGO2017 paper",
"developer": "",
"developer_email": "",
"developer_webpage": "",
"license": ""
}
Binary file added module/experiment-cgo2017/.module.py.swp
Binary file not shown.
Binary file not shown.
71 changes: 71 additions & 0 deletions module/experiment-cgo2017/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#
# Collective Knowledge (Reproducing experiment from CGO2017 paper)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: cTuning foundation, admin@cTuning.org, http://cTuning.org
#

cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
ck=None # Will be updated by CK (initialized CK kernel)

# Local settings

##############################################################################
# Initialize module

def init(i):
"""
Input: {}
Output: {
return - return code = 0, if successful
> 0, if error
(error) - error text if return > 0
}
"""
return {'return':0}

##############################################################################
# reproduce experiment

def reproduce(i):
"""
Input: {
}
Output: {
return - return code = 0, if successful
> 0, if error
(error) - error text if return > 0
}
"""

import os
os.environ['CK_FETCHDIST']="32"

r=ck.access({"action":"compile",
"module_uoa":"program",
"data_uoa":"randacc-swpf",
"out":"con"})
if r['return']>0: return r

r=ck.access({"action":"run",
"module_uoa":"program",
"data_uoa":"randacc-swpf",
"out":"con"})
if r['return']>0: return r

# import json
# print (json.dumps(r,indent=2))
exec_time=r['characteristics']['total_execution_time']

ck.out('')
ck.out('Total execution time via CK: '+str(exec_time))

return {'return':0}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4339bd3b6b127b43
1 change: 1 addition & 0 deletions package/.cm/alias-a-plugin-llvm-sw-prefetch-pass
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3468db6b2578ff7d
1 change: 1 addition & 0 deletions package/.cm/alias-u-3468db6b2578ff7d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugin-llvm-sw-prefetch-pass
1 change: 1 addition & 0 deletions package/.cm/alias-u-4339bd3b6b127b43
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugin-llvm-sw-prefetch-no-strides-pass
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
21 changes: 21 additions & 0 deletions package/plugin-llvm-sw-prefetch-no-strides-pass/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"backup_data_uid": "4339bd3b6b127b43",
"backup_module_uid": "1dc07ee0f4742028",
"backup_module_uoa": "package",
"control": {
"author": "",
"author_email": "",
"author_webpage": "",
"copyright": "",
"engine": "CK",
"iso_datetime": "2016-11-19T15:35:07.750211",
"license": "",
"version": [
"1",
"8",
"4",
"2"
]
},
"data_name": "plugin-llvm-sw-prefetch-no-stides-pass"
}
36 changes: 36 additions & 0 deletions package/plugin-llvm-sw-prefetch-no-strides-pass/.cm/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"customize": {
"env_extra": "_SW_PREFETCH_NO_STRIDES_PASS",
"extra_dir": "",
"version": "0.1",
"install_env": {
"CK_PLUGIN_OUT": "SwPrefetchPass_noStrides",
"CK_NO_STRIDES": "1"
}
},
"deps": {
"compiler": {
"local": "yes",
"name": "C++ compiler",
"tags": "compiler,lang-cpp,llvm"
}
},
"end_full_path": {
"android": "lib$#sep#$SwPrefetchPass_noStrides.so",
"linux": "lib/SwPrefetchPass_noStrides.so",
"mingw": "lib\\SwPrefetchPass_noStrides.so",
"win": "lib\\SwPrefetchPass_noStrides.so"
},
"process_script": "compile",
"soft_uoa": "cb5940a8eba4fe8b",
"suggested_path": "plugin-llvm-sw-prefetch-no-strides-pass",
"tags": [
"plugin",
"compiler-plugin",
"llvm",
"sw-prefetch-no-strides-pass"
],
"use_scripts_from_another_entry": {
"data_uoa": "3468db6b2578ff7d"
}
}
Binary file not shown.
1 change: 1 addition & 0 deletions package/plugin-llvm-sw-prefetch-pass/.cm/desc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
21 changes: 21 additions & 0 deletions package/plugin-llvm-sw-prefetch-pass/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"backup_data_uid": "3468db6b2578ff7d",
"backup_module_uid": "1dc07ee0f4742028",
"backup_module_uoa": "package",
"control": {
"author": "",
"author_email": "",
"author_webpage": "",
"copyright": "",
"engine": "CK",
"iso_datetime": "2016-11-18T20:21:48.341962",
"license": "",
"version": [
"1",
"8",
"4",
"2"
]
},
"data_name": "llvm-plugin-sw-prefetch-pass"
}
Loading

0 comments on commit 6b49f75

Please sign in to comment.