Skip to content

Commit 0429aa7

Browse files
committed
Add devito-compiler-paper data and scripts
1 parent a1b88c6 commit 0429aa7

797 files changed

Lines changed: 230602 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

devito-compiler-paper/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
all: clean
2+
3+
clean:
4+
find results -type f -name '*.pdf' -exec rm {} +

devito-compiler-paper/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#### Experimentation framework for the manuscript:
2+
3+
> Architecture and performance of Devito, a system for automated stencil
4+
> computation
5+
6+
#### Usage
7+
8+
You will need:
9+
10+
* [Devito vTODO](todo) to reproduce the experiments in the manuscript.
11+
* [Opescibench v0.1](https://github.com/opesci/opescibench/releases) to
12+
recreate the plots.
13+
14+
This directory is structured as follows:
15+
16+
* The collected performance data as well as the generated plots are located
17+
in the ``results`` directory.
18+
* The script ``run.sh`` was used to run the experiments.
19+
* The file ``machines.txt`` contains a description of the architectures used
20+
for the experiments. The file is structured so that it can be easily read and
21+
imported by a Python program. The Python program ``plot.sh`` (see below)
22+
reads ``machines.txt``.
23+
* The program ``plot.py`` can be run to recreate the plots. You can run it as:
24+
```
25+
DEVITO_HOME=/absolute/path/to/devito python plot.py data
26+
```
27+
Note that you are expected to run it from this directory, otherwise you have
28+
to specify the right path to ``results``. You will find the generated plots
29+
within ``results``.
30+
* A ``Makefile`` that you can invoke to clean up the directory tree (e.g., to
31+
remove all of the generated plot files)

devito-compiler-paper/machines.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# WARNING: ASSUME SINGLE PRECISION
2+
# WARNING: EVERYTHING ASSUMES SINGLE SOCKET
3+
# WARNING: THE REPORTED CORE FREQUENCY IS THE SIMD ISA BASE (no turbo boost) FREQUENCY
4+
5+
###########################################
6+
7+
# KNL 7250 ("knl7250")
8+
# ---------------
9+
# machine peak: 1.2 Ghz * 68 cores * 16 flots/avx512_register * 2 avx units * 2[fma] = 5222 SP-GFlops/s
10+
# stream triad:
11+
# 68 threads
12+
# MCDRAM: 475 GB/s
13+
# DDR4: 87 GB/s
14+
15+
knl7250 = {
16+
'machine-peak': 5222,
17+
'linpack-peak': 3790,
18+
'dram-stream-bw': 475, # Hack, actually DRAM BW is 87
19+
'mcdram-stream-bw': 475
20+
}
21+
22+
23+
# SKL 6148 ("skl6148")
24+
# ---------------
25+
# machine peak: 2.2 Ghz * 20 cores * 16 flots/avx512_register * 2 avx units * 2[fma] = 2816 SP-GFlops/s
26+
27+
skl6148 = {
28+
'machine-peak': 2816,
29+
'linpack-peak': 2273,
30+
'dram-stream-bw': 98
31+
}
32+
33+
34+
# SKL 8180 ("skl8180")
35+
# ---------------
36+
# machine peak: 2.3 Ghz * 28 cores * 16 flots/avx512_register * 2 avx units * 2[fma] = 4121 SP-GFlops/s
37+
38+
skl8180 = {
39+
'machine-peak': 4121,
40+
'linpack-peak': 3285,
41+
'dram-stream-bw': 104
42+
}

devito-compiler-paper/plot.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import os
2+
import sys
3+
from subprocess import call
4+
import re
5+
6+
#
7+
# Expected directory tree:
8+
#
9+
# root (eg: 'results')
10+
# | -- problemname (eg: acoustic, tti)
11+
# | | -- backend (eg: core, yask)
12+
# | | | -- benchmode (eg: O2, dse)
13+
# | | | | -- archname (eg: knl7250)
14+
# | | | | | -- grid512 -- files
15+
# | | | | | -- grid768 -- files
16+
# | | | | | -- grid1024 -- files
17+
#
18+
# E.g.: results/acoustic/core/bmO2/knl7250/grid512
19+
#
20+
21+
if len(sys.argv) != 2:
22+
print("Usage: python plot.py absolute/path/to/root")
23+
sys.exit(0)
24+
25+
machines = {}
26+
exec(open("machines.txt").read(), {}, machines)
27+
28+
subfolders = ['problemname', 'backend', 'benchmode', 'archname', 'grid']
29+
30+
benchmarkpy = os.path.join(os.environ['DEVITO_HOME'], 'examples', 'seismic', 'benchmark.py')
31+
32+
root = sys.argv[1]
33+
dirs = [x[0] for x in os.walk(root)]
34+
35+
root_depth = len(root.split('/'))
36+
plot_dirs = [i for i in dirs if len(i.split('/')) - len(subfolders) == root_depth]
37+
38+
for i in plot_dirs:
39+
problem, backend, benchmode, arch, _ = i.split('/')[root_depth:]
40+
files = [f for f in os.listdir(i) if f.endswith('json')]
41+
if not files:
42+
print("No data files?")
43+
sys.exit(0)
44+
45+
if arch not in machines:
46+
print("Don't own any information for %s architecture" % arch)
47+
sys.exit(0)
48+
machine = machines[arch]
49+
50+
grid = re.search(r"shape\[([A-Za-z0-9_,]+)\]", files[0]).group(1).split(',')
51+
space_orders = sorted(set([int(re.search(r"so\[(\w+)\]", j).group(1)) for j in files]))
52+
tn = re.search(r"tn\[(\w+)\]", files[0]).group(1)
53+
autotune = re.search(r"at\[([A-Za-z0-9_,]+)\]", files[0]).group(1)
54+
55+
args = ['python', benchmarkpy, 'plot', '-P', problem, '-bm', benchmode] # plot cmd
56+
args += ['-d'] + grid # grid shape
57+
for j in space_orders:
58+
args += ['-so', str(j)] # space orders tested
59+
args += ['-to', '2', '--tn', tn] # time-related simulation parameters
60+
args += ['-r', i] # plot dir
61+
args += ['--autotune', autotune]
62+
args += ['--backend', backend]
63+
args += ['--arch', arch, '--max-bw', str(machine['dram-stream-bw']), # arch params
64+
'--flop-ceil', str(machine['machine-peak']), 'ideal',
65+
'--flop-ceil', str(machine['linpack-peak']), 'linpack']
66+
call(' '.join(args), shell=True)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"timestamp": "2017-12-19T173234",
3+
"meta": {},
4+
"timings": {
5+
"section_1": {
6+
"gflopss": 0.03252665737772683,
7+
"oi": 0.9556932429272855,
8+
"timings": 0.001006666666666663
9+
},
10+
"section_2": {
11+
"gflopss": 0.07046860669290739,
12+
"oi": 2.0872340425531917,
13+
"timings": 0.41012200000000026
14+
},
15+
"main": {
16+
"gflopss": 81.42789336831197,
17+
"oi": 3.8401610815822664,
18+
"timings": 282.6686686666667
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"timestamp": "2017-12-19T181639",
3+
"meta": {},
4+
"timings": {
5+
"section_1": {
6+
"gflopss": 0.038109248439688805,
7+
"oi": 0.9556932429272855,
8+
"timings": 0.0008590000000000011
9+
},
10+
"section_2": {
11+
"gflopss": 0.18016600125446605,
12+
"oi": 2.0872340425531917,
13+
"timings": 0.16916000000000006
14+
},
15+
"main": {
16+
"gflopss": 106.3009996894279,
17+
"oi": 4.625986091905757,
18+
"timings": 260.666095
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"timestamp": "2017-12-19T161152",
3+
"meta": {},
4+
"timings": {
5+
"section_1": {
6+
"gflopss": 0.03284015156527247,
7+
"oi": 0.9556932429272855,
8+
"timings": 0.0009976666666666636
9+
},
10+
"section_2": {
11+
"gflopss": 0.12922868140724775,
12+
"oi": 2.0872340425531917,
13+
"timings": 0.22081933333333337
14+
},
15+
"main": {
16+
"gflopss": 101.18989127613413,
17+
"oi": 2.210715695954507,
18+
"timings": 130.89542566666665
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"timestamp": "2017-12-19T164724",
3+
"meta": {},
4+
"timings": {
5+
"section_1": {
6+
"gflopss": 0.03590832730122823,
7+
"oi": 0.9556932429272855,
8+
"timings": 0.0009110000000000004
9+
},
10+
"section_2": {
11+
"gflopss": 0.18436584718708884,
12+
"oi": 2.0872340425531917,
13+
"timings": 0.15367633333333328
14+
},
15+
"main": {
16+
"gflopss": 97.62280599879944,
17+
"oi": 3.035146417817541,
18+
"timings": 186.23167999999998
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)