-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1545 from GoogleCloudPlatform/moe
Rollup changes with MOE
- Loading branch information
Showing
35 changed files
with
1,054 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
perfkitbenchmarker/data/nvidia_unrestricted_permissions_daemonset.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This file defines a daemonset which runs automatically on all | ||
# kubernetes nodes. It is used like so: kubectl create -f <this file_path>. | ||
# The daemonset does the following: | ||
# - waits until nvidia-smi is mounted and available on PATH | ||
# - enables persistence mode on the nvidia driver | ||
# - allows all users to set the GPU clock speed | ||
# In effect, this allows pods created without a privileged security context to | ||
# set the GPU clock speeds | ||
# This daemonset config does not define GPU resources, because otherwise it | ||
# would consume them, leaving them unavailable to pods. Instead, it runs in | ||
# privileged mode (so it can see all GPUs), and manually mounts the CUDA | ||
# lib and bin directories. | ||
|
||
apiVersion: apps/v1beta2 | ||
kind: DaemonSet | ||
metadata: | ||
name: nvidia-add-unrestricted-permissions-dameon-set | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: nvidia-add-unrestricted-permissions | ||
template: | ||
metadata: | ||
labels: | ||
name: nvidia-add-unrestricted-permissions | ||
spec: | ||
containers: | ||
- name: nvidia-add-unrestricted-permissions | ||
image: nvidia/cuda:8.0-devel-ubuntu16.04 | ||
securityContext: | ||
privileged: true | ||
command: [ "/bin/bash", "-c", "export PATH=$PATH:/usr/local/bin/nvidia/ && while [ ! $(type -p nvidia-smi) ]; do echo waiting for nvidia-smi to mount...; sleep 2; done && nvidia-smi -pm 1 && nvidia-smi --applications-clocks-permission=UNRESTRICTED && nvidia-smi --auto-boost-permission=UNRESTRICTED && tail -f /dev/null" ] | ||
volumeMounts: | ||
- name: nvidia-debug-tools | ||
mountPath: /usr/local/bin/nvidia | ||
- name: nvidia-libraries | ||
mountPath: /usr/local/nvidia/lib64 | ||
volumes: | ||
- name: nvidia-debug-tools | ||
hostPath: | ||
path: /home/kubernetes/bin/nvidia/bin | ||
- name: nvidia-libraries | ||
hostPath: | ||
path: /home/kubernetes/bin/nvidia/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Copyright 2016 PerfKitBenchmarker Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Runs DaCapo benchmarks. | ||
This benchmark runs the various DaCapo benchmarks. More information can be found | ||
at: http://dacapobench.org/ | ||
""" | ||
|
||
import os | ||
import re | ||
|
||
from perfkitbenchmarker import configs | ||
from perfkitbenchmarker import errors | ||
from perfkitbenchmarker import flags | ||
from perfkitbenchmarker import linux_packages | ||
from perfkitbenchmarker import sample | ||
|
||
flags.DEFINE_string('dacapo_jar_filename', 'dacapo-9.12-bach.jar', | ||
'Filename of DaCapo jar file.') | ||
flags.DEFINE_enum('dacapo_benchmark', 'luindex', ['luindex', 'lusearch'], | ||
'Name of specific DaCapo benchmark to execute.') | ||
flags.DEFINE_integer('dacapo_num_iters', 1, 'Number of iterations to execute.') | ||
|
||
FLAGS = flags.FLAGS | ||
|
||
BENCHMARK_NAME = 'dacapo' | ||
BENCHMARK_CONFIG = """ | ||
dacapo: | ||
description: Runs DaCapo benchmarks | ||
vm_groups: | ||
default: | ||
vm_spec: *default_single_core | ||
""" | ||
_PASS_PATTERN = re.compile(r'^=====.*PASSED in (\d+) msec =====$') | ||
|
||
|
||
def GetConfig(user_config): | ||
return configs.LoadConfig(BENCHMARK_CONFIG, user_config, BENCHMARK_NAME) | ||
|
||
|
||
def Prepare(benchmark_spec): | ||
"""Install the DaCapo benchmark suite on the vms. | ||
Args: | ||
benchmark_spec: The benchmark specification. Contains all data that is | ||
required to run the benchmark. | ||
""" | ||
benchmark_spec.vms[0].Install('dacapo') | ||
|
||
|
||
def Run(benchmark_spec): | ||
"""Run the DaCapo benchmark on the vms. | ||
Args: | ||
benchmark_spec: The benchmark specification. Contains all data that is | ||
required to run the benchmark. | ||
Returns: | ||
A singleton list of sample.Sample objects containing the DaCapo benchmark | ||
run time (in msec). | ||
Raises: | ||
errors.Benchmarks.RunError if the DaCapo benchmark didn't succeed. | ||
""" | ||
_, stderr = benchmark_spec.vms[0].RemoteCommand( | ||
'java -jar %s %s -n %i --scratch-directory=%s' % | ||
(os.path.join(linux_packages.INSTALL_DIR, FLAGS.dacapo_jar_filename), | ||
FLAGS.dacapo_benchmark, FLAGS.dacapo_num_iters, | ||
os.path.join(linux_packages.INSTALL_DIR, 'dacapo_scratch'))) | ||
for line in stderr.splitlines(): | ||
m = _PASS_PATTERN.match(line) | ||
if m: | ||
return [sample.Sample('run_time', float(m.group(1)), 'ms')] | ||
raise errors.Benchmarks.RunError( | ||
'DaCapo benchmark %s failed.' % FLAGS.dacapo_benchmark) | ||
|
||
|
||
def Cleanup(benchmark_spec): | ||
"""Cleanup the DaCapo benchmark on the target vm (by uninstalling). | ||
Args: | ||
benchmark_spec: The benchmark specification. Contains all data that is | ||
required to run the benchmark. | ||
""" | ||
benchmark_spec.vms[0].RemoteCommand( | ||
'rm -rf %s' % os.path.join(linux_packages.INSTALL_DIR, 'dacapo_scratch')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.