Skip to content

Commit

Permalink
Merge branch 'master' into nc-stable-sort
Browse files Browse the repository at this point in the history
  • Loading branch information
natecook1000 committed Nov 3, 2018
2 parents 8e2da05 + eea96a3 commit aa4229e
Show file tree
Hide file tree
Showing 119 changed files with 4,013 additions and 1,490 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
|**[Ubuntu 16.04 (TensorFlow)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_tensorflow.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow)|
|**[macOS 10.13 (TensorFlow)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_macos_high_sierra_tensorflow.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-macOS-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-macOS-tensorflow)|
|**[Ubuntu 16.04 (TensorFlow with GPU)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_tensorflow_gpu.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu)|
|**[Debian 9.5](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_debian_9.5.json)** | x86_64 | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_5/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_5)|


## Welcome to Swift
Expand Down
34 changes: 16 additions & 18 deletions benchmark/scripts/compare_perf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,10 @@ class ReportFormatter(object):
GitHub), `git` and `html`.
"""

def __init__(self, comparator, old_branch, new_branch, changes_only,
def __init__(self, comparator, changes_only,
single_table=False):
"""Initialize with `TestComparator` and names of branches."""
self.comparator = comparator
self.old_branch = old_branch
self.new_branch = new_branch
self.changes_only = changes_only
self.single_table = single_table

Expand Down Expand Up @@ -663,7 +661,6 @@ def table(title, results, is_strong=False, is_open=False):
])

return ''.join([
# FIXME print self.old_branch, self.new_branch
table('Regression', self.comparator.decreased, True, True),
table('Improvement', self.comparator.increased, True),
('' if self.changes_only else
Expand Down Expand Up @@ -738,7 +735,6 @@ def table(title, results, speedup_color):

return self.HTML.format(
''.join([
# FIXME print self.old_branch, self.new_branch
table('Regression', self.comparator.decreased, 'red'),
table('Improvement', self.comparator.increased, 'green'),
('' if self.changes_only else
Expand Down Expand Up @@ -768,31 +764,33 @@ def parse_args(args):
'--single-table',
help='Combine data in a single table in git and markdown formats',
action='store_true')
parser.add_argument('--new-branch',
help='Name of the new branch', default='NEW_MIN')
parser.add_argument('--old-branch',
help='Name of the old branch', default='OLD_MIN')
parser.add_argument('--delta-threshold',
help='Delta threshold. Default 0.05.',
type=float, default=0.05)
return parser.parse_args(args)


def main():
"""Compare benchmarks for changes in a formatted report."""
args = parse_args(sys.argv[1:])
comparator = TestComparator(LogParser.results_from_file(args.old_file),
LogParser.results_from_file(args.new_file),
args.delta_threshold)
formatter = ReportFormatter(comparator, args.old_branch, args.new_branch,
args.changes_only, args.single_table)
def create_report(old_results, new_results, delta_threshold, format,
changes_only=True, single_table=True):
comparator = TestComparator(old_results, new_results, delta_threshold)
formatter = ReportFormatter(comparator, changes_only, single_table)
formats = {
'markdown': formatter.markdown,
'git': formatter.git,
'html': formatter.html
}

report = formats[args.format]()
report = formats[format]()
return report


def main():
"""Compare benchmarks for changes in a formatted report."""
args = parse_args(sys.argv[1:])
report = create_report(LogParser.results_from_file(args.old_file),
LogParser.results_from_file(args.new_file),
args.delta_threshold, args.format,
args.changes_only, args.single_table)
print(report)

if args.output:
Expand Down
Loading

0 comments on commit aa4229e

Please sign in to comment.