code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def Run(benchmark_spec):
"""Kick off gartner boot script on launcher server vms.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of benchmark samples.
"""
launcher_vms = benchmark_spec.vm_groups['servers']
background... | Kick off gartner boot script on launcher server vms.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of benchmark samples.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec):
"""Clean up.
Launcher VMs and booter template VM are deleted by pkb resource management.
Boot VMs are self-destructing, but we will make a second attempt at destroying
them anyway for good hygene.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
... | Clean up.
Launcher VMs and booter template VM are deleted by pkb resource management.
Boot VMs are self-destructing, but we will make a second attempt at destroying
them anyway for good hygene.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark... | Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/large_scale_boot_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install Lmbench on the target vms.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
vms = benchmark_spec.vms
vm = vms[0]
_PrepareLmbench(vm)
_ConfigureRun(vm) | Install Lmbench on the target vms.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | Apache-2.0 |
def _ParseContextSwitching(lines, title, metadata, results):
"""Parse the context switching test results.
Context switching - times in microseconds - smaller is better.
Args:
lines: The lines following context switching title size=* ovr=*.
title: The context switching subset title.
metadata: A dicti... | Parse the context switching test results.
Context switching - times in microseconds - smaller is better.
Args:
lines: The lines following context switching title size=* ovr=*.
title: The context switching subset title.
metadata: A diction of metadata.
results: A list of samples to be published.
... | _ParseContextSwitching | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | Apache-2.0 |
def _ParseSections(lmbench_output, parse_section_func_dict, metadata, results):
"""Parse some sections from the output.
For different output sections, we may apply different parsing strategies.
Such that parse_section_func_dict is defined where the key is the section
name, the value is the corresponding functi... | Parse some sections from the output.
For different output sections, we may apply different parsing strategies.
Such that parse_section_func_dict is defined where the key is the section
name, the value is the corresponding function. All the associated parsing
functions take same parameters. So When we parse mor... | _ParseSections | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | Apache-2.0 |
def _AddProcessorMetricSamples(
lmbench_output, processor_metric_list, metadata, results
):
"""Parse results for "Processor, Processes - times in microseconds - smaller is better."
Args:
lmbench_output: A string containing the test results of lmbench.
processor_metric_list: A tuple of metrics.
meta... | Parse results for "Processor, Processes - times in microseconds - smaller is better."
Args:
lmbench_output: A string containing the test results of lmbench.
processor_metric_list: A tuple of metrics.
metadata: A dictionary of metadata.
results: A list of samples to be published.
Processor test out... | _AddProcessorMetricSamples | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | Apache-2.0 |
def _ParseOutput(lmbench_output):
"""Parse the output from lmbench.
Args:
lmbench_output: A string containing the test results of lmbench.
Returns:
A list of samples to be published (in the same format as Run() returns).
"""
results = []
metadata = dict()
# Updata metadata
_UpdataMetadata(lmb... | Parse the output from lmbench.
Args:
lmbench_output: A string containing the test results of lmbench.
Returns:
A list of samples to be published (in the same format as Run() returns).
| _ParseOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run LMBENCH on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
vms = benchmark_spec.vms
vm = vms[0]
# Use the current configuration to run the... | Run LMBENCH on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/lmbench_benchmark.py | Apache-2.0 |
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> list[sample.Sample]:
"""Runs the lockhammer benchmark and returns a dict of performance data.
Args:
benchmark_spec: The benchmark spec for this sample benchmark.
Returns:
A list of performance samples.
"""
vm = benchmark_spec.vms[0]
samples = []
... | Runs the lockhammer benchmark and returns a dict of performance data.
Args:
benchmark_spec: The benchmark spec for this sample benchmark.
Returns:
A list of performance samples.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/lockhammer_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/lockhammer_benchmark.py | Apache-2.0 |
def _GetMongoDbURL(benchmark_spec: bm_spec.BenchmarkSpec) -> str:
"""Returns the connection string used to connect to the instance."""
instance: _ManagedMongoDb = benchmark_spec.non_relational_db
read_preference = _READ_PREFERENCE.value
write_concern = _WRITE_CONCERN.value
return (
f'"{instance.GetConne... | Returns the connection string used to connect to the instance. | _GetMongoDbURL | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/managed_mongodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/managed_mongodb_ycsb_benchmark.py | Apache-2.0 |
def _GetCommonYcsbArgs(benchmark_spec: bm_spec.BenchmarkSpec) -> dict[str, Any]:
"""Returns the args to use for YCSB."""
instance: _ManagedMongoDb = benchmark_spec.non_relational_db
args = {
'mongodb.url': _GetMongoDbURL(benchmark_spec),
}
if instance.tls_enabled:
jvm_args = instance.GetJvmTrustStor... | Returns the args to use for YCSB. | _GetCommonYcsbArgs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/managed_mongodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/managed_mongodb_ycsb_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec) -> list[sample.Sample]:
"""Prepare the clients and load the database."""
clients = benchmark_spec.vm_groups['clients']
db: _ManagedMongoDb = benchmark_spec.non_relational_db
executor = ycsb.YCSBExecutor('mongodb', cp=ycsb.YCSB_DIR)
if db.tls_enabled:
db.... | Prepare the clients and load the database. | Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/managed_mongodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/managed_mongodb_ycsb_benchmark.py | Apache-2.0 |
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> list[sample.Sample]:
"""Run YCSB against MongoDB.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
clients = benchmark_spec.vm_groups['clie... | Run YCSB against MongoDB.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/managed_mongodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/managed_mongodb_ycsb_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Prepare the virtual machines to run memtier against memcached.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
clients = benchmark_spec.vm_groups['client']
server = benchmark_spec.vm_groups['server'][0]
... | Prepare the virtual machines to run memtier against memcached.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/memcached_memtier_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/memcached_memtier_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs memtier against memcached and gathers the results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample instances.
"""
client = benchmark_spec.vm_groups['client']
server =... | Runs memtier against memcached and gathers the results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample instances.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/memcached_memtier_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/memcached_memtier_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Prepare the virtual machines to run mutilate against memcached.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
clients = GetClients(benchmark_spec)
server = benchmark_spec.vm_groups['server'][0]
clien... | Prepare the virtual machines to run mutilate against memcached.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/memcached_mutilate_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/memcached_mutilate_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs mutilate against memcached and gathers the results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample instances.
"""
clients = GetClients(benchmark_spec)
server = bench... | Runs mutilate against memcached and gathers the results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample instances.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/memcached_mutilate_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/memcached_mutilate_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Prepare the virtual machines to run YCSB against memcached.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
clients = benchmark_spec.vm_groups['clients']
assert clients, benchmark_spec.vm_groups
hosts... | Prepare the virtual machines to run YCSB against memcached.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/memcached_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/memcached_ycsb_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install vms with necessary softwares.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the banchmark.
"""
vms = benchmark_spec.vms
logging.info('Preparing netperf on %s', vms[0])
vms[0].Install('netperf')
for vm in vms:... | Install vms with necessary softwares.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the banchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mesh_network_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mesh_network_benchmark.py | Apache-2.0 |
def RunNetperf(vm, benchmark_name, servers, result):
"""Spawns netperf on a remote VM, parses results.
Args:
vm: The VM running netperf.
benchmark_name: The netperf benchmark to run.
servers: VMs running netserver.
result: The result variable shared by all threads.
"""
cmd = ''
if FLAGS.durat... | Spawns netperf on a remote VM, parses results.
Args:
vm: The VM running netperf.
benchmark_name: The netperf benchmark to run.
servers: VMs running netserver.
result: The result variable shared by all threads.
| RunNetperf | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mesh_network_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mesh_network_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run netperf on target vms.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
Total throughput, average latency in the form of tuple. The tuple contains
the sample metric (string), value (float), ... | Run netperf on target vms.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
Total throughput, average latency in the form of tuple. The tuple contains
the sample metric (string), value (float), unit (string).
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mesh_network_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mesh_network_benchmark.py | Apache-2.0 |
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> List[sample.Sample]:
"""Measure the latency to publish, pull, or publish and pull messages.
Runs the run function from get_instance. It runs the benchmark specified with
the flag: 'messaging_service_benchmark' from the client VM.
Args:
benchmark_spec: The ... | Measure the latency to publish, pull, or publish and pull messages.
Runs the run function from get_instance. It runs the benchmark specified with
the flag: 'messaging_service_benchmark' from the client VM.
Args:
benchmark_spec: The benchmark specification.
Returns:
List of samples. Produced when runn... | Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/messaging_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/messaging_service_benchmark.py | Apache-2.0 |
def _DownloadData(data_dir, data_path, vm):
"""Download remote benchmark data to local.
Args:
data_dir: remote benchmark location
data_path: local benchmark location
vm: vm to download the data
"""
vm.Install('google_cloud_sdk')
vm.RemoteCommand(
'if [ ! -d "{data_path}" ]; then '
' ... | Download remote benchmark data to local.
Args:
data_dir: remote benchmark location
data_path: local benchmark location
vm: vm to download the data
| _DownloadData | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def PrepareBenchmark(benchmark_spec, vm=None):
"""Install and set up MLPerf on the target vm.
Args:
benchmark_spec: The benchmark specification
vm: The VM to work on
Raises:
errors.Config.InvalidValue upon both GPUs and TPUs appear in the config
"""
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
... | Install and set up MLPerf on the target vm.
Args:
benchmark_spec: The benchmark specification
vm: The VM to work on
Raises:
errors.Config.InvalidValue upon both GPUs and TPUs appear in the config
| PrepareBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def _GetChangesForMask(config_sed_input):
"""Get changes to config and run scripts for MaskRCNN.
Also update train_mlperf.py if nvprof is used.
Args:
config_sed_input: Input list of sed pairs for config_DGXA100.sh.
Returns:
config_sed_output: Output list of sed pairs for config_DGXA100.sh.
"""
co... | Get changes to config and run scripts for MaskRCNN.
Also update train_mlperf.py if nvprof is used.
Args:
config_sed_input: Input list of sed pairs for config_DGXA100.sh.
Returns:
config_sed_output: Output list of sed pairs for config_DGXA100.sh.
| _GetChangesForMask | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def _GetChangesForResnet(config_sed_input):
"""Get changes to config and run scripts for Resnet.
Args:
config_sed_input: Input list of sed pairs for config_DGXA100.sh.
Returns:
config_sed_output: Output list of sed pairs for config_DGXA100.sh.
"""
config_sed = config_sed_input
config_sed.append((
... | Get changes to config and run scripts for Resnet.
Args:
config_sed_input: Input list of sed pairs for config_DGXA100.sh.
Returns:
config_sed_output: Output list of sed pairs for config_DGXA100.sh.
| _GetChangesForResnet | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def _GetChangesForBert(config_sed_input):
"""Get changes to config and run scripts for BERT.
Args:
config_sed_input: Input list of sed pairs for config_DGXA100.sh.
Returns:
config_sed_output: Output list of sed pairs for config_DGXA100.sh.
"""
config_sed = config_sed_input
config_sed.append((
... | Get changes to config and run scripts for BERT.
Args:
config_sed_input: Input list of sed pairs for config_DGXA100.sh.
Returns:
config_sed_output: Output list of sed pairs for config_DGXA100.sh.
| _GetChangesForBert | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def SedPairsToString(pairs):
"""Convert a list of sed pairs to a string for the sed command.
Args:
pairs: a list of pairs, indicating the replacement requests
Returns:
a string to supply to the sed command
"""
sed_str = '; '.join(['s/%s/%s/g' % pair for pair in pairs])
if pairs:
sed_str += ';'... | Convert a list of sed pairs to a string for the sed command.
Args:
pairs: a list of pairs, indicating the replacement requests
Returns:
a string to supply to the sed command
| SedPairsToString | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def UpdateScriptForSmallGpuMem(vm: virtual_machine.BaseVirtualMachine) -> None:
"""Update the running script for small GPU memory.
Args:
vm: The VM to work on
"""
if (
nvidia_driver.GetGpuMem(vm) < 80000
and nvidia_driver.QueryNumberOfGpus(vm) >= 8
):
# A100 40G fails out of memory when c... | Update the running script for small GPU memory.
Args:
vm: The VM to work on
| UpdateScriptForSmallGpuMem | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def _UpdateScripts(benchmark_spec, vm):
"""Update the running scripts on the target vm.
Args:
benchmark_spec: The benchmark specification.
vm: The VM to work on
"""
benchmark = benchmark_spec.benchmark
vm = vm or benchmark_spec.vms[0]
config_sed = []
config_sed += [(r'DGXSYSTEM=.*', rf'DGXSYSTEM... | Update the running scripts on the target vm.
Args:
benchmark_spec: The benchmark specification.
vm: The VM to work on
| _UpdateScripts | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def MakeSamplesFromOutput(metadata, output, use_tpu=False, model=RESNET):
"""Create samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
use_tpu: bool, whether tpu is in use
model: string, model name
Example output:
perfkitbe... | Create samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
use_tpu: bool, whether tpu is in use
model: string, model name
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mlperf_benchmark_test.py
Returns:
Sampl... | MakeSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def MakeMLPerfSamplesFromOutput(metadata, output):
"""Create MLPerf log samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
Returns:
Samples containing training metrics.
"""
samples = []
for mllog in regex_util.ExtractAllMatch... | Create MLPerf log samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
Returns:
Samples containing training metrics.
| MakeMLPerfSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run MLPerf on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
vm = benchmark_spec.vms[0]
if bench... | Run MLPerf on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | Apache-2.0 |
def _CreateMetadataDict(
bm_spec: benchmark_spec.BenchmarkSpec,
) -> Dict[str, Any]:
"""Creates metadata dict to be used in run results.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
metadata dict
"""
metadata = {
'model... | Creates metadata dict to be used in run results.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
metadata dict
| _CreateMetadataDict | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | Apache-2.0 |
def MakePerformanceSamplesFromOutput(
base_metadata: Dict[str, Any], output: str
) -> List[sample.Sample]:
"""Creates performance samples containing metrics.
Args:
base_metadata: dict contains all the metadata that reports.
output: string, command output
Example output:
perfkitbenchmarker/tests/... | Creates performance samples containing metrics.
Args:
base_metadata: dict contains all the metadata that reports.
output: string, command output
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mlperf_inference_benchmark_test.py
Returns:
Samples containing training metrics.
| MakePerformanceSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | Apache-2.0 |
def _Run(bm_spec: benchmark_spec.BenchmarkSpec, target_qps: float) -> bool:
"""Runs MLPerf inference test under a server target QPS.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
target_qps: The load to generate.
Returns:
Whether the syste... | Runs MLPerf inference test under a server target QPS.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
target_qps: The load to generate.
Returns:
Whether the system under test passes under the serer target QPS.
| _Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | Apache-2.0 |
def _LastRunResults(bm_spec: benchmark_spec.BenchmarkSpec) -> str:
"""Finds the results of the last run.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
The detail log.
"""
vm = bm_spec.vms[0]
stdout, _ = vm.RobustRemoteCommand(
... | Finds the results of the last run.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
The detail log.
| _LastRunResults | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | Apache-2.0 |
def _FindStartingQps(
bm_spec: benchmark_spec.BenchmarkSpec,
) -> Tuple[float, float]:
"""Finds the QPS range to search.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
A tuple of passing QPS and failing QPS.
"""
# T4 QPS is gre... | Finds the QPS range to search.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
A tuple of passing QPS and failing QPS.
| _FindStartingQps | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | Apache-2.0 |
def _BinarySearch(bm_spec: benchmark_spec.BenchmarkSpec) -> None:
"""Finds the system under test QPS.
Uses binary search between to find the max GPU QPS while meet the latency
constraint. Stops searching when the absolute difference is less 1 samples
per second.
Args:
bm_spec: The benchmark specificatio... | Finds the system under test QPS.
Uses binary search between to find the max GPU QPS while meet the latency
constraint. Stops searching when the absolute difference is less 1 samples
per second.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
| _BinarySearch | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | Apache-2.0 |
def Run(bm_spec: benchmark_spec.BenchmarkSpec) -> List[sample.Sample]:
"""Runs MLPerf Inference on the cluster.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
A list of sample.Sample objects.
"""
_BinarySearch(bm_spec)
metadata ... | Runs MLPerf Inference on the cluster.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_benchmark.py | Apache-2.0 |
def ParseFromOutput(output: str) -> Dict[str, str]:
"""Creates samples containing metrics.
Args:
output: string, command output
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mlperf_inference_cpu_benchmark_test.py
Returns:
Samples containing training metrics.
"""
result = regex_uti... | Creates samples containing metrics.
Args:
output: string, command output
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mlperf_inference_cpu_benchmark_test.py
Returns:
Samples containing training metrics.
| ParseFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | Apache-2.0 |
def MakeSamplesFromOutput(
base_metadata: Dict[str, Any], output: str
) -> sample.Sample:
"""Creates samples containing metrics.
Args:
base_metadata: dict contains all the metadata that reports.
output: string, command output
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mlperf_infer... | Creates samples containing metrics.
Args:
base_metadata: dict contains all the metadata that reports.
output: string, command output
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mlperf_inference_cpu_benchmark_test.py
Returns:
Sample containing training metrics.
| MakeSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | Apache-2.0 |
def _IsValid(output: str) -> List[sample.Sample]:
"""Creates samples containing metrics.
Args:
output: string, command output
Returns:
whether the result is valid or invalid.
"""
results = regex_util.ExtractAllMatches(r'Result is : (\S+)', output)
return results[0] == 'VALID' | Creates samples containing metrics.
Args:
output: string, command output
Returns:
whether the result is valid or invalid.
| _IsValid | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | Apache-2.0 |
def _Run(
bm_spec: benchmark_spec.BenchmarkSpec, target_qps: float = 1.01
) -> str:
"""Runs MLPerf Inference on the cluster.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
target_qps: float, the scheduled samples per second.
Returns:
ml... | Runs MLPerf Inference on the cluster.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
target_qps: float, the scheduled samples per second.
Returns:
mlperf inference output.
| _Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | Apache-2.0 |
def _SearchQps(bm_spec: benchmark_spec.BenchmarkSpec) -> str:
"""Finds the system under test QPS.
Uses binary search between to find the max GPU QPS while meet the latency
constraint. Stops searching when the absolute difference is less 1 samples
per second.
Args:
bm_spec: The benchmark specification. C... | Finds the system under test QPS.
Uses binary search between to find the max GPU QPS while meet the latency
constraint. Stops searching when the absolute difference is less 1 samples
per second.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Re... | _SearchQps | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_inference_cpu_benchmark.py | Apache-2.0 |
def CheckPrerequisites(_):
"""Verify that the required prerequisites are met.
Args:
_: Unused.
Raises:
perfkitbenchmarker.errors.Setup.InvalidFlagConfigurationError:
On invalid flag configuration.
"""
if not FLAGS.openmpi_enable_shared:
raise errors.Setup.InvalidFlagConfigurationError(
... | Verify that the required prerequisites are met.
Args:
_: Unused.
Raises:
perfkitbenchmarker.errors.Setup.InvalidFlagConfigurationError:
On invalid flag configuration.
| CheckPrerequisites | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _DictToString(dictionary):
"""Convert a dictionary to a space separated 'key=value' string.
Args:
dictionary: the key-value dictionary to be convert
Returns:
a string representing the dictionary
"""
dict_str = ' '.join(
' {key}={value}'.format(key=key, value=value)
for key, value in ... | Convert a dictionary to a space separated 'key=value' string.
Args:
dictionary: the key-value dictionary to be convert
Returns:
a string representing the dictionary
| _DictToString | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _GetChangesForTransformer(
benchmark_spec,
vm,
script_path,
nvprof_flags,
config_sed_input,
run_sed_input,
run_and_time_sed_input,
):
"""Get changes to config and run scripts for Transformer.
Also updates run_training.sh on the vm.
Args:
benchmark_spec: The benchmark specific... | Get changes to config and run scripts for Transformer.
Also updates run_training.sh on the vm.
Args:
benchmark_spec: The benchmark specification.
vm: The target vm.
script_path: The location of scripts on vm.
nvprof_flags: The flags for nvprof.
config_sed_input: Input list of sed pairs for con... | _GetChangesForTransformer | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _GetChangesForSSD(
benchmark_spec,
nvprof_flags,
config_sed_input,
run_sed_input,
run_and_time_sed_input,
):
"""Get changes to config and run scripts for SSD.
Args:
benchmark_spec: The benchmark specification.
nvprof_flags: The flags for nvprof.
config_sed_input: Input list of s... | Get changes to config and run scripts for SSD.
Args:
benchmark_spec: The benchmark specification.
nvprof_flags: The flags for nvprof.
config_sed_input: Input list of sed pairs for config_DGXA100_multi.sh.
run_sed_input: Input list of sed pairs for run.sub.
run_and_time_sed_input: Input list of se... | _GetChangesForSSD | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _GetChangesForGNMT(
benchmark_spec,
nvprof_flags,
config_sed_input,
run_sed_input,
run_and_time_sed_input,
):
"""Get changes to config and run scripts for GNMT.
Args:
benchmark_spec: The benchmark specification.
nvprof_flags: The flags for nvprof.
config_sed_input: Input list of... | Get changes to config and run scripts for GNMT.
Args:
benchmark_spec: The benchmark specification.
nvprof_flags: The flags for nvprof.
config_sed_input: Input list of sed pairs for config_DGXA100_multi.sh.
run_sed_input: Input list of sed pairs for run.sub.
run_and_time_sed_input: Input list of s... | _GetChangesForGNMT | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _GetChangesForMask(
benchmark_spec,
node_rank,
script_path,
nvprof_flags,
config_sed_input,
run_sed_input,
run_and_time_sed_input,
):
"""Get changes to config and run scripts for MaskRCNN.
Also update train_mlperf.py if nvprof is used.
Args:
benchmark_spec: The benchmark spec... | Get changes to config and run scripts for MaskRCNN.
Also update train_mlperf.py if nvprof is used.
Args:
benchmark_spec: The benchmark specification.
node_rank: int, The rank of the node for multi-node distributed training
script_path: The location of scripts on vm.
nvprof_flags: The flags for nvp... | _GetChangesForMask | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _GetChangesForResnet(
benchmark_spec,
node_rank,
nvprof_flags,
config_sed_input,
run_sed_input,
run_and_time_sed_input,
):
"""Get changes to config and run scripts for Resnet.
Args:
benchmark_spec: The benchmark specification.
node_rank: int, The rank of the node for multi-node ... | Get changes to config and run scripts for Resnet.
Args:
benchmark_spec: The benchmark specification.
node_rank: int, The rank of the node for multi-node distributed training
nvprof_flags: The flags for nvprof.
config_sed_input: Input list of sed pairs for config_DGXA100_multi.sh.
run_sed_input: I... | _GetChangesForResnet | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _GetChangesForBert(
benchmark_spec,
node_rank,
nvprof_flags,
config_sed_input,
run_sed_input,
run_and_time_sed_input,
):
"""Get changes to config and run scripts for BERT.
Also update train_mlperf.py if nvprof is used.
Args:
benchmark_spec: The benchmark specification.
node_r... | Get changes to config and run scripts for BERT.
Also update train_mlperf.py if nvprof is used.
Args:
benchmark_spec: The benchmark specification.
node_rank: int, The rank of the node for multi-node distributed training
nvprof_flags: The flags for nvprof.
config_sed_input: Input list of sed pairs f... | _GetChangesForBert | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _UpdateScripts(benchmark_spec, node_rank):
"""Update the running scripts on the target vm.
Args:
benchmark_spec: The benchmark specification.
node_rank: int, The rank of the node for multi-node distributed training
"""
vm = benchmark_spec.vms[node_rank]
benchmark = benchmark_spec.benchmark
# T... | Update the running scripts on the target vm.
Args:
benchmark_spec: The benchmark specification.
node_rank: int, The rank of the node for multi-node distributed training
| _UpdateScripts | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def _PrepareBucket(benchmark_spec):
"""Prepare storage bucket for profiling results, if needed.
Args:
benchmark_spec: The benchmark specification
"""
if (
mlperf_benchmark.NONE in FLAGS.mlperf_profiler
and not FLAGS.mlperf_keep_nccl_log
):
return
if FLAGS.cloud != 'GCP':
return
... | Prepare storage bucket for profiling results, if needed.
Args:
benchmark_spec: The benchmark specification
| _PrepareBucket | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and set up MLPerf on multiple vms.
Args:
benchmark_spec: The benchmark specification
"""
vms = benchmark_spec.vms
background_tasks.RunThreaded(_PrepareWorker, vms)
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
list_params = [
((benchmark_spec, node_rank)... | Install and set up MLPerf on multiple vms.
Args:
benchmark_spec: The benchmark specification
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def MakeSamplesFromOutput(metadata, output, model=mlperf_benchmark.RESNET):
"""Create samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
model: string, model name
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mlperf... | Create samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
model: string, model name
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mlperf_benchmark_test.py
Returns:
Samples containing training metrics.
| MakeSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mlperf_multiworkers_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and set up MNIST on the target vm.
Args:
benchmark_spec: The benchmark specification
"""
benchmark_spec.always_call_cleanup = True
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
vm = benchmark_spec.vms[0]
if not benchmark_spec.tpus:
vm.Install('tensorflow')
... | Install and set up MNIST on the target vm.
Args:
benchmark_spec: The benchmark specification
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | Apache-2.0 |
def ExtractThroughput(regex, output, metadata, metric, unit):
"""Extract throughput from MNIST output.
Args:
regex: string. Regular expression.
output: MNIST output
metadata: dict. Additional metadata to include with the sample.
metric: string. Name of the metric within the benchmark.
unit: str... | Extract throughput from MNIST output.
Args:
regex: string. Regular expression.
output: MNIST output
metadata: dict. Additional metadata to include with the sample.
metric: string. Name of the metric within the benchmark.
unit: string. Units for 'value'.
Returns:
samples containing the thro... | ExtractThroughput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | Apache-2.0 |
def MakeSamplesFromTrainOutput(metadata, output, elapsed_seconds, step):
"""Create a sample containing training metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
elapsed_seconds: float, elapsed seconds from saved checkpoint.
step: int, the global s... | Create a sample containing training metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
elapsed_seconds: float, elapsed seconds from saved checkpoint.
step: int, the global steps in the training process.
Example output:
perfkitbenchmarker/tests/... | MakeSamplesFromTrainOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | Apache-2.0 |
def MakeSamplesFromEvalOutput(metadata, output, elapsed_seconds):
"""Create a sample containing evaluation metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
elapsed_seconds: float, elapsed seconds from saved checkpoint.
Example output:
perfkitbe... | Create a sample containing evaluation metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
elapsed_seconds: float, elapsed seconds from saved checkpoint.
Example output:
perfkitbenchmarker/tests/linux_benchmarks/mnist_benchmark_test.py
Returns:
... | MakeSamplesFromEvalOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run MNIST on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
vm = benchmark_spec.vms[0]
if bench... | Run MNIST on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mnist_benchmark.py | Apache-2.0 |
def _PrepareReplicaSet(
server_vms: Sequence[_LinuxVM], arbiter_vm: _LinuxVM
) -> None:
"""Prepares the replica set for the benchmark.
This benchmark currently uses a primary-secondary-arbiter replica set
configuration. The secondary keeps a full replica of the data while the
arbiter does not. The arbiter ... | Prepares the replica set for the benchmark.
This benchmark currently uses a primary-secondary-arbiter replica set
configuration. The secondary keeps a full replica of the data while the
arbiter does not. The arbiter is still able to vote. See
https://www.mongodb.com/docs/manual/core/replica-set-architecture-th... | _PrepareReplicaSet | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mongodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mongodb_ycsb_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec: bm_spec.BenchmarkSpec) -> None:
"""Remove MongoDB and YCSB.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
def CleanupServer(server: _LinuxVM) -> None:
server.RemoteCommand(
'sudo service %s stop... | Remove MongoDB and YCSB.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mongodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mongodb_ycsb_benchmark.py | Apache-2.0 |
def GetConfig(user_config: Dict[str, Any]) -> Dict[str, Any]:
"""Returns the benchmark config to use.
Args:
user_config: Pre-defined config.
Raises:
InvalidFlagConfigurationError if user supplied flags are incorrect.
"""
if _MSG_SIZES.value:
if FLAGS['mpi_msglog_min'].present or FLAGS['mpi_msgl... | Returns the benchmark config to use.
Args:
user_config: Pre-defined config.
Raises:
InvalidFlagConfigurationError if user supplied flags are incorrect.
| GetConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | Apache-2.0 |
def Run(spec: benchmark_spec.BenchmarkSpec) -> List[sample.Sample]:
"""Runs all of the MPI tests.
Args:
spec: The benchmark spec.
Returns:
List of sample.Samples
"""
vms = spec.vms
# for --mpi_threads=0 the threads per host is half of the number of vCPUs
samples = []
# The count of real CPUs o... | Runs all of the MPI tests.
Args:
spec: The benchmark spec.
Returns:
List of sample.Samples
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | Apache-2.0 |
def _RunTest(
vms: List[_BaseLinuxVirtualMachine],
total_processes: int,
ppn: int,
on_real_cpus: bool,
) -> List[sample.Sample]:
"""Runs the MPI test for this given number of processes per host.
Args:
vms: List of virtual machines to use in the test.
total_processes: The total number of pro... | Runs the MPI test for this given number of processes per host.
Args:
vms: List of virtual machines to use in the test.
total_processes: The total number of processes to run across all nodes.
ppn: Processes per node.
on_real_cpus: Whether the number of MPI processes is equal to the number of
rea... | _RunTest | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | Apache-2.0 |
def _CreateSamples(response: mpi.MpiResponse) -> Iterator[sample.Sample]:
"""Generates samples for each result in the response."""
for result in response.results:
for row in result.data:
for item in _MpiDataToSamples(row):
item.metadata.update({
'mpi_run': response.mpi_run,
... | Generates samples for each result in the response. | _CreateSamples | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | Apache-2.0 |
def _MpiDataToSamples(row: mpi.MpiData) -> List[sample.Sample]:
"""Returns the individual MPI result row as a list of Samples.
MpiData stores the results of a run for a given benchmark ("PingPong") that
specifies the:
bytes=(integer payload byte size for the run)
is_error=(whether this run was timed out)... | Returns the individual MPI result row as a list of Samples.
MpiData stores the results of a run for a given benchmark ("PingPong") that
specifies the:
bytes=(integer payload byte size for the run)
is_error=(whether this run was timed out)
and has one or both of the following if the run did not time out:
... | _MpiDataToSamples | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | Apache-2.0 |
def _CreateRequestWithFlagParameters(
vms: List[_BaseLinuxVirtualMachine],
total_processes: int,
suite: str,
tests: List[str],
ppn: int,
) -> Iterator[mpi.MpiRequest]:
"""Yields an MpiRequest using settings passed in as flags.
If told to record MPI latencies (--mpi_record_latency) then must cre... | Yields an MpiRequest using settings passed in as flags.
If told to record MPI latencies (--mpi_record_latency) then must create
individual runs for each byte length. Flags of --mpi_msglog_min=10,
--mpi_msglog_max=12 generates 3 MpiRequests of (msglog_min=10,msglog_max=10),
(msglog_min=11,msglog_max=11), (msgl... | _CreateRequestWithFlagParameters | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | Apache-2.0 |
def _GetTests(suite: str) -> List[str]:
"""Returns the tests to run for this benchmark run.
Args:
suite: The MPI suite to use.
Returns:
List of individual benchmarks to run.
"""
tests = _BENCHMARKS.value or _MPI_SUITE_TESTS[suite]
all_tests = set(_LowerList(_MPI_SUITE_TESTS[suite]))
return [test... | Returns the tests to run for this benchmark run.
Args:
suite: The MPI suite to use.
Returns:
List of individual benchmarks to run.
| _GetTests | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mpi_benchmark.py | Apache-2.0 |
def parse(self, inp):
"""Parse the input.
Args:
inp: string or units.Quantity.
Returns:
A units.Quantity.
Raises:
ValueError: If the input cannot be parsed, or if it parses to a value that
does not meet the requirements described in self.syntactic_help.
"""
size = ... | Parse the input.
Args:
inp: string or units.Quantity.
Returns:
A units.Quantity.
Raises:
ValueError: If the input cannot be parsed, or if it parses to a value that
does not meet the requirements described in self.syntactic_help.
| parse | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def _TranslateMemorySize(get_total_memory, size):
"""Translates a value parsed from a memory size flag to a byte count.
Args:
get_total_memory: Function that accepts no arguments and returns an integer
specifying the total amount of memory available in bytes.
size: units.Quantity specifying either an... | Translates a value parsed from a memory size flag to a byte count.
Args:
get_total_memory: Function that accepts no arguments and returns an integer
specifying the total amount of memory available in bytes.
size: units.Quantity specifying either an explicit memory size in a unit
convertible to by... | _TranslateMemorySize | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def _IterMemorySizes(get_total_memory, min_size, max_size):
"""Iterates over a range of memory sizes determined by a min and max.
Args:
get_total_memory: Function that accepts no arguments and returns an integer
specifying the total amount of memory available.
min_size: units.Quantity specifying eith... | Iterates over a range of memory sizes determined by a min and max.
Args:
get_total_memory: Function that accepts no arguments and returns an integer
specifying the total amount of memory available.
min_size: units.Quantity specifying either an explicit memory size in a unit
convertible to bytes o... | _IterMemorySizes | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def CheckPrerequisites(benchmark_config):
"""Performs input verification checks.
Raises:
ValueError: If an invalid combination of flag values is specified.
"""
chase_type = FLAGS.multichase_chase_type
if not _CHASES[chase_type] and FLAGS['multichase_chase_arg'].present:
raise ValueError(
'Can... | Performs input verification checks.
Raises:
ValueError: If an invalid combination of flag values is specified.
| CheckPrerequisites | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install multichase on the VM.
Args:
benchmark_spec: BenchmarkSpec.
"""
vm = benchmark_spec.vms[0]
vm_state = _MultichaseSpecificState()
setattr(vm, _BENCHMARK_SPECIFIC_VM_STATE_ATTR, vm_state)
vm.Install('multichase')
vm.Install('numactl')
remote_benchmark_dir = '_... | Install multichase on the VM.
Args:
benchmark_spec: BenchmarkSpec.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run multichase and multiload benchmarks on the VM.
Args:
benchmark_spec: BenchmarkSpec.
Returns:
A list of sample.Sample objects.
"""
samples = []
if _MULTICHASE in FLAGS.multichase_benchmarks:
samples.extend(RunMultichase(benchmark_spec))
if _MULTILOAD in FLAGS.m... | Run multichase and multiload benchmarks on the VM.
Args:
benchmark_spec: BenchmarkSpec.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def RunMultichase(benchmark_spec):
"""Run multichase on the VM.
Args:
benchmark_spec: BenchmarkSpec.
Returns:
A list of sample.Sample objects.
"""
samples = []
base_metadata = {
'additional_flags': FLAGS.multichase_additional_flags,
'chase_type': FLAGS.multichase_chase_type,
'mul... | Run multichase on the VM.
Args:
benchmark_spec: BenchmarkSpec.
Returns:
A list of sample.Sample objects.
| RunMultichase | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def RunMultiload(
benchmark_spec,
num_threads,
num_samples,
buffer_size,
delay,
traffic_pattern,
):
"""Run multiload on the VM.
Args:
benchmark_spec: BenchmarkSpec.
num_threads: Number of CPU threads to use for the benchmark. If None, use
number of CPUs on the machine.
num... | Run multiload on the VM.
Args:
benchmark_spec: BenchmarkSpec.
num_threads: Number of CPU threads to use for the benchmark. If None, use
number of CPUs on the machine.
num_samples: Number of multiload samples to collect.
buffer_size: Memory buffer size.
delay: Time delay.
traffic_pattern... | RunMultiload | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec):
"""Remove multichase from the VM.
Args:
benchmark_spec: BenchmarkSpec.
"""
vm = benchmark_spec.vms[0]
vm_state = getattr(vm, _BENCHMARK_SPECIFIC_VM_STATE_ATTR)
if vm_state.dir:
# Directory has been created on the VM. Delete it.
vm.RemoteCommand('rm -rf ' + vm_state.... | Remove multichase from the VM.
Args:
benchmark_spec: BenchmarkSpec.
| Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/multichase_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and set up MXNet on the target vm.
Args:
benchmark_spec: The benchmark specification
"""
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
vm = benchmark_spec.vms[0]
vm.Install('mxnet')
vm.Install('mxnet_cnn')
benchmark_spec.mxnet_version = mxnet.GetMXNetVersion(... | Install and set up MXNet on the target vm.
Args:
benchmark_spec: The benchmark specification
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mxnet_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mxnet_benchmark.py | Apache-2.0 |
def _ExtractThroughput(output):
"""Extract throughput from MXNet output.
Sample output:
INFO:root:Epoch[0] Batch [460-480] Speed: 50.42 samples/sec accuracy=1.000000
INFO:root:Epoch[0] Batch [480-500] Speed: 50.47 samples/sec accuracy=1.000000
INFO:root:Epoch[0] Train-accuracy=1.000000
INFO:root:Epoch[0] T... | Extract throughput from MXNet output.
Sample output:
INFO:root:Epoch[0] Batch [460-480] Speed: 50.42 samples/sec accuracy=1.000000
INFO:root:Epoch[0] Batch [480-500] Speed: 50.47 samples/sec accuracy=1.000000
INFO:root:Epoch[0] Train-accuracy=1.000000
INFO:root:Epoch[0] Time cost=634.243
Args:
output:... | _ExtractThroughput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mxnet_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mxnet_benchmark.py | Apache-2.0 |
def _MakeSamplesFromOutput(benchmark_spec, output):
"""Create a sample continaing the measured MXNet throughput.
Args:
benchmark_spec: benchmark spec
output: MXNet output
Returns:
a Sample containing the MXNet throughput in samples/sec
"""
metadata = _CreateMetadataDict(benchmark_spec)
mx_thro... | Create a sample continaing the measured MXNet throughput.
Args:
benchmark_spec: benchmark spec
output: MXNet output
Returns:
a Sample containing the MXNet throughput in samples/sec
| _MakeSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mxnet_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mxnet_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run MXNet on the cluster for each model specified.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
vm = benchmar... | Run MXNet on the cluster for each model specified.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/mxnet_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/mxnet_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and set up NCCL on the target vm.
Args:
benchmark_spec: The benchmark specification
"""
benchmark_spec.always_call_cleanup = True
if _NCCL_TESTS.value:
background_tasks.RunThreaded(PrepareVm, benchmark_spec.vms)
hpc_util.CreateMachineFile(
benchmark_spe... | Install and set up NCCL on the target vm.
Args:
benchmark_spec: The benchmark specification
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | Apache-2.0 |
def CreateMetadataDict():
"""Create metadata dict to be used in run results.
Returns:
metadata dict
"""
extra_params = FLAGS.nccl_extra_params + FLAGS.nccl_extra_params_spaceseplist
metadata = {
'slots': FLAGS.nccl_slots,
'minbytes': FLAGS.nccl_minbytes,
'maxbytes': FLAGS.nccl_maxbytes,... | Create metadata dict to be used in run results.
Returns:
metadata dict
| CreateMetadataDict | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | Apache-2.0 |
def MakeSamplesFromOutput(metadata, output):
"""Create samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
Example output:
perfkitbenchmarker/tests/linux_benchmarks/nccl_benchmark_test.py
Returns:
Samples containing training ... | Create samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
Example output:
perfkitbenchmarker/tests/linux_benchmarks/nccl_benchmark_test.py
Returns:
Samples containing training metrics, and the bandwidth
| MakeSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | Apache-2.0 |
def TuningParameters(params):
"""Get all NCCL tuning parameters combination.
For example:
params = [
('NCCL_NSOCKS_PERTHREAD', ['DEFAULT', '2']),
('NCCL_SOCKET_NTHREADS', ['DEFAULT', '8']),
]
result = [
[],
[('NCCL_NSOCKS_PERTHREAD', '2')],
[('NCCL_SOCKET_NTHREADS', '8')],
... | Get all NCCL tuning parameters combination.
For example:
params = [
('NCCL_NSOCKS_PERTHREAD', ['DEFAULT', '2']),
('NCCL_SOCKET_NTHREADS', ['DEFAULT', '8']),
]
result = [
[],
[('NCCL_NSOCKS_PERTHREAD', '2')],
[('NCCL_SOCKET_NTHREADS', '8')],
[('NCCL_NSOCKS_PERTHREAD', '2'), ... | TuningParameters | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run NCCL on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
master = benchmark_spec.vms[0]
env = []
if FLAGS.nccl_cuda_visible_devices:
env... | Run NCCL on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nccl_benchmark.py | Apache-2.0 |
def ParseNetperfAggregateOutput(stdout, test_type):
"""Parses the stdout of a single netperf process.
Args:
stdout: the stdout of the netperf process
test_type: the type of test
Returns:
A tuple containing (throughput_sample, latency_samples, latency_histogram)
"""
# Don't modify the metadata di... | Parses the stdout of a single netperf process.
Args:
stdout: the stdout of the netperf process
test_type: the type of test
Returns:
A tuple containing (throughput_sample, latency_samples, latency_histogram)
| ParseNetperfAggregateOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_aggregate_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_aggregate_benchmark.py | Apache-2.0 |
def RunNetperfAggregate(vm, server_ips):
"""Spawns netperf on a remote VM, parses results.
Args:
vm: The VM that the netperf TCP_RR benchmark will be run upon.
server_ips: Machines that are running netserver.
Returns:
A sample.Sample object with the result.
"""
# setup remote hosts file
vm.Re... | Spawns netperf on a remote VM, parses results.
Args:
vm: The VM that the netperf TCP_RR benchmark will be run upon.
server_ips: Machines that are running netserver.
Returns:
A sample.Sample object with the result.
| RunNetperfAggregate | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_aggregate_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_aggregate_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run netperf TCP_RR on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
# set client and server vms
vm_dict = benchmark_spec.vm_groups
client_... | Run netperf TCP_RR on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_aggregate_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_aggregate_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Extracts the first two VM's from benchmark_spec and prepares the VMs for executing netperf.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
client_vm, server_vm = benchmark_spec.vms[:2]
background_tasks.... | Extracts the first two VM's from benchmark_spec and prepares the VMs for executing netperf.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def PrepareClientVM(client_vm):
"""Install netperf and copy remote test script to client_vm.
Args:
client_vm: The VM that runs the netperf binary.
"""
# Copy remote test script to client
path = data.ResourcePath(os.path.join(REMOTE_SCRIPTS_DIR, REMOTE_SCRIPT))
logging.info('Uploading %s to %s', path, c... | Install netperf and copy remote test script to client_vm.
Args:
client_vm: The VM that runs the netperf binary.
| PrepareClientVM | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def PrepareServerVM(server_vm, client_vm_internal_ips, client_vm_ip_address):
"""Install netperf and start netserver processes on server_vm.
Args:
server_vm: The VM that runs the netserver binary.
client_vm_internal_ips: Internal IP addresses of client_vm.
client_vm_ip_address: All IP addresses of clie... | Install netperf and start netserver processes on server_vm.
Args:
server_vm: The VM that runs the netserver binary.
client_vm_internal_ips: Internal IP addresses of client_vm.
client_vm_ip_address: All IP addresses of client_vm.
| PrepareServerVM | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def _SetupHostFirewall(server_vm, client_vm_internal_ip, client_vm_ip_address):
"""Set up host firewall to allow incoming traffic.
Args:
server_vm: The VM that runs the netserver binary.
client_vm_internal_ip: Internal IP address of client_vm.
client_vm_ip_address: All IP addresses of client_vm.
"""
... | Set up host firewall to allow incoming traffic.
Args:
server_vm: The VM that runs the netserver binary.
client_vm_internal_ip: Internal IP address of client_vm.
client_vm_ip_address: All IP addresses of client_vm.
| _SetupHostFirewall | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def _HistogramStatsCalculator(histogram):
"""Computes values at percentiles in a distribution as well as stddev.
Args:
histogram: A dict mapping values to the number of samples with that value.
Returns:
A dict mapping stat names to their values.
"""
stats = {}
# Histogram data in list form sorted... | Computes values at percentiles in a distribution as well as stddev.
Args:
histogram: A dict mapping values to the number of samples with that value.
Returns:
A dict mapping stat names to their values.
| _HistogramStatsCalculator | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def ParseNetperfOutput(
stdout, metadata, benchmark_name, enable_latency_histograms
):
"""Parses the stdout of a single netperf process.
Args:
stdout: the stdout of the netperf process
metadata: metadata for any sample.Sample objects we create
benchmark_name: the name of the netperf benchmark
e... | Parses the stdout of a single netperf process.
Args:
stdout: the stdout of the netperf process
metadata: metadata for any sample.Sample objects we create
benchmark_name: the name of the netperf benchmark
enable_latency_histograms: bool indicating if latency histograms are
included in stdout
... | ParseNetperfOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def RunNetperf(vm, benchmark_name, server_ips, num_streams, client_ips):
"""Spawns netperf on a remote VM, parses results.
Args:
vm: The VM that the netperf TCP_RR benchmark will be run upon.
benchmark_name: The netperf benchmark to run, see the documentation.
server_ips: A list of ips for a machine th... | Spawns netperf on a remote VM, parses results.
Args:
vm: The VM that the netperf TCP_RR benchmark will be run upon.
benchmark_name: The netperf benchmark to run, see the documentation.
server_ips: A list of ips for a machine that is running netserver.
num_streams: The number of netperf client threads... | RunNetperf | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Extracts the first two VM's from benchmark_spec and runs netperf.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
client_vm, server_vm = benchmark_spec.vms[:2]
... | Extracts the first two VM's from benchmark_spec and runs netperf.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.