-
Notifications
You must be signed in to change notification settings - Fork 2
Benchpress/gap benchmark #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Copyright (c) 2017-present, Facebook, Inc. | ||
| # All rights reserved. | ||
| # | ||
| # This source code is licensed under the BSD-style license found in the | ||
| # LICENSE file in the root directory of this source tree. An additional grant | ||
| # of patent rights can be found in the PATENTS file in the same directory. | ||
|
|
||
| import re | ||
|
|
||
| from benchpress.lib.parser import Parser | ||
|
|
||
| TIME_REGEX = r'(\w+\sTime):\s+(\d+\.?\d*)' | ||
|
|
||
|
|
||
| class GAPBSParser(Parser): | ||
|
|
||
| def parse(self, stdout, stderr, returncode): | ||
| output = ' '.join(stdout) | ||
| metrics = {} | ||
| times = re.findall(TIME_REGEX, output) | ||
| for t in times: | ||
| key = self.snakeify_name(t[0]) | ||
| metrics[key] = float(t[1]) | ||
| return metrics | ||
|
|
||
| def snakeify_name(self, s): | ||
| return '_'.join(s.strip().lower().split()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
|
|
||
| GAP_GIT_REPO="https://github.com/sbeamer/gapbs.git" | ||
| GAP_GIT_TAG="tags/v1.1" | ||
|
|
||
| BENCHMARKS_DIR="$(pwd)/benchmarks/gapbs" | ||
| mkdir -p "$BENCHMARKS_DIR" | ||
|
|
||
| rm -rf build | ||
| mkdir -p build | ||
| cd build | ||
|
|
||
| git clone "$GAP_GIT_REPO" | ||
| cd gapbs | ||
| git checkout -b gapbs_benchpress "$GAP_GIT_TAG" | ||
| make | ||
|
|
||
| mv tc sssp pr converter cc bfs bc "$BENCHMARKS_DIR" | ||
| cd ../../ | ||
| rm -rf build | ||
|
|
||
| echo "GAP benchmark suite installed into ${BENCHMARKS_DIR}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| - benchmark: schbench | ||
| name: schbench default | ||
| name: schbench default | ||
| description: defaults for schbench | ||
| args: | ||
| message-threads: 2 | ||
|
|
@@ -72,3 +72,23 @@ | |
| scale-factor: 1 | ||
| runtime: 1 | ||
|
|
||
| - benchmark: gapbs_bc | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This benchmark uses OpenMP. Do you think we should let it default OMP threads or we should specify that as one of the benchmark inputs?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Today, the user can set the Example: But to be more explicit, we could potentially add support for environment variables, perhaps something like: benchmark: gapbs_bc
name: gapbs_bc
description: GAP bc benchmark
env:
OMP_NUM_THREADS: 4
args:
- -u 21
- -n 1 |
||
| name: gapbs_bc | ||
| description: GAP bc benchmark | ||
| args: | ||
| - -u 21 | ||
| - -n 1 | ||
|
|
||
| - benchmark: gapbs_bfs | ||
| name: gapbs_bfs | ||
| description: GAP bfs benchmark | ||
| args: | ||
| - -u 21 | ||
| - -n 1 | ||
|
|
||
| - benchmark: gapbs_tc | ||
| name: gapbs_tc | ||
| description: GAP tc benchmark | ||
| args: | ||
| - -u 21 | ||
| - -n 1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # Copyright (c) 2017-present, Facebook, Inc. | ||
| # All rights reserved. | ||
| # | ||
| # This source code is licensed under the BSD-style license found in the | ||
| # LICENSE file in the root directory of this source tree. An additional grant | ||
| # of patent rights can be found in the PATENTS file in the same directory. | ||
|
|
||
| import unittest | ||
|
|
||
| from benchpress.plugins.parsers.gapbs import GAPBSParser | ||
|
|
||
|
|
||
| class TestGAPBSParser(unittest.TestCase): | ||
|
|
||
| def setUp(self): | ||
| self.parser = GAPBSParser() | ||
|
|
||
| def test_bc_sample_output(self): | ||
| output = [ | ||
| 'Generate Time: 0.41289', | ||
| 'Build Time: 1.89460', | ||
| 'Graph has 1048576 nodes and 16776968 undirected edges for degree: 15', | ||
| ' a 0.00035', | ||
| 'source: 209629', | ||
| ' b 0.45253', | ||
| ' p 0.31504', | ||
| 'Trial Time: 0.76991', | ||
| 'Average Time: 0.76991', | ||
| ] | ||
| metrics = self.parser.parse(output, None, 0) | ||
| self.assertDictEqual({ | ||
| 'generate_time': 0.41289, | ||
| 'build_time': 1.89460, | ||
| 'trial_time': 0.76991, | ||
| 'average_time': 0.76991, | ||
| }, metrics) | ||
|
|
||
| def test_bfs_sample_ouput(self): | ||
| output = [ | ||
| 'Generate Time: 0.41075', | ||
| 'Build Time: 1.89220', | ||
| 'Graph has 1048576 nodes and 16776968 undirected edges for degree: 15', | ||
| 'Source: 209629', | ||
| ' i 0.00086', | ||
| ' td 29 0.00003', | ||
| ' td 872 0.00002', | ||
| ' td 27534 0.00049', | ||
| ' td 579473 0.01030', | ||
| ' e 0.00445', | ||
| ' bu 440667 0.01020', | ||
| ' bu 0 0.00044', | ||
| ' c 0.00073', | ||
| 'Trial Time: 0.02800', | ||
| 'Average Time: 0.02800', | ||
| ] | ||
| metrics = self.parser.parse(output, None, 0) | ||
| self.assertDictEqual({ | ||
| 'generate_time': 0.41075, | ||
| 'build_time': 1.89220, | ||
| 'trial_time': 0.02800, | ||
| 'average_time': 0.02800, | ||
| }, metrics) | ||
|
|
||
| def test_tc_sample_output(self): | ||
| output = [ | ||
| 'Generate Time: 0.40949', | ||
| 'Build Time: 1.88401', | ||
| 'Graph has 1048576 nodes and 16776968 undirected edges for degree: 15', | ||
| 'Trial Time: 2.45414', | ||
| 'Average Time: 2.45414', | ||
| ] | ||
| metrics = self.parser.parse(output, None, 0) | ||
| self.assertDictEqual({ | ||
| 'generate_time': 0.40949, | ||
| 'build_time': 1.88401, | ||
| 'trial_time': 2.45414, | ||
| 'average_time': 2.45414, | ||
| }, metrics) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are you providing the compile commands for the 3 gap benchmarks ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
makecommand on line 16 builds all benchmarks. By default it compiles with-O3flag, I think in the script you shared with me you compiled with-O2. Do you want to switch to-O2?