def _CreateMetadataDict(benchmark_spec):
    """Create metadata dict to be used in run results.

  Args:
    benchmark_spec: benchmark spec

  Returns:
    metadata dict
  """
    vm = benchmark_spec.vms[0]
    metadata = dict()
    if benchmark_spec.device == GPU:
        metadata.update(cuda_toolkit_8.GetMetadata(vm))
        metadata['num_gpus'] = benchmark_spec.num_gpus
    metadata['forward_only'] = benchmark_spec.forward_only
    metadata['model'] = benchmark_spec.model
    metadata['data_name'] = benchmark_spec.data_name
    metadata['batch_size'] = benchmark_spec.batch_size
    metadata['variable_update'] = benchmark_spec.variable_update
    metadata['local_parameter_device'] = benchmark_spec.local_parameter_device
    metadata['device'] = benchmark_spec.device
    metadata['data_format'] = benchmark_spec.data_format
    metadata['use_nccl'] = benchmark_spec.use_nccl
    metadata['distortions'] = benchmark_spec.distortions
    return metadata
def Run(benchmark_spec):
    """Runs the Stencil2D benchmark. GPU clock speeds must be set already.

  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
    num_gpus = benchmark_spec.num_gpus
    master_vm = vms[0]
    num_iterations = FLAGS.stencil2d_iterations
    problem_sizes = FLAGS.stencil2d_problem_sizes
    num_processes = len(vms) * num_gpus

    metadata = {}
    metadata.update(cuda_toolkit_8.GetMetadata(master_vm))
    metadata['benchmark_version'] = BENCHMARK_VERSION
    metadata['num_iterations'] = num_iterations
    metadata['num_nodes'] = len(vms)
    metadata['num_processes'] = num_processes

    results = []
    for problem_size in problem_sizes:
        results.extend(
            _RunSingleIteration(master_vm, problem_size, num_processes,
                                num_iterations, metadata))
    return results
예제 #3
0
def _CreateMetadataDict(benchmark_spec, model, batch_size, num_gpus):
    """Create metadata dict to be used in run results.

  Args:
    benchmark_spec: benchmark spec
    model: model which was run
    batch_size: batch sized used
    num_gpus: number of GPUs used

  Returns:
    metadata dict
  """
    vm = benchmark_spec.vms[0]
    metadata = dict()
    if benchmark_spec.device == GPU:
        metadata.update(cuda_toolkit_8.GetMetadata(vm))
        metadata['num_gpus'] = num_gpus
    metadata['model'] = model
    metadata['batch_size'] = batch_size
    metadata['forward_only'] = benchmark_spec.forward_only
    metadata['data_name'] = benchmark_spec.data_name
    metadata['variable_update'] = benchmark_spec.variable_update
    metadata['local_parameter_device'] = benchmark_spec.local_parameter_device
    metadata['device'] = benchmark_spec.device
    metadata['data_format'] = benchmark_spec.data_format
    metadata['use_nccl'] = benchmark_spec.use_nccl
    metadata['distortions'] = benchmark_spec.distortions
    metadata['benchmarks_commit_hash'] = benchmark_spec.benchmarks_commit_hash
    metadata['tensorflow_version'] = benchmark_spec.tensorflow_version
    return metadata
def Run(benchmark_spec):
    """Sets the GPU clock speed and runs the CUDA PCIe benchmark.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.

  Returns:
    A list of sample.Sample objects.
  """
    vm = benchmark_spec.vms[0]
    # Note:  The clock speed is set in this function rather than Prepare()
    # so that the user can perform multiple runs with a specified
    # clock speed without having to re-prepare the VM.
    cuda_toolkit_8.SetAndConfirmGpuClocks(vm)
    num_iterations = FLAGS.gpu_pcie_bandwidth_iterations
    raw_results = []
    metadata = {}
    metadata.update(cuda_toolkit_8.GetMetadata(vm))
    metadata['num_iterations'] = num_iterations
    metadata['num_gpus'] = cuda_toolkit_8.QueryNumberOfGpus(vm)
    run_command = ('%s/extras/demo_suite/bandwidthTest --device=all' %
                   cuda_toolkit_8.CUDA_TOOLKIT_INSTALL_DIR)
    for i in range(num_iterations):
        stdout, _ = vm.RemoteCommand(run_command, should_log=True)
        raw_results.append(_ParseOutputFromSingleIteration(stdout))
        if 'device_info' not in metadata:
            metadata['device_info'] = _ParseDeviceInfo(stdout)
    return _CalculateMetricsOverAllIterations(raw_results, metadata)
예제 #5
0
def _CreateMetadataDict(benchmark_spec):
    """Create metadata dict to be used in run results.

  Args:
    benchmark_spec: benchmark spec

  Returns:
    metadata dict
  """
    vm = benchmark_spec.vms[0]
    metadata = dict()
    if benchmark_spec.device == GPU:
        metadata.update(cuda_toolkit_8.GetMetadata(vm))
    metadata['batch_size'] = benchmark_spec.batch_size
    metadata['num_epochs'] = benchmark_spec.num_epochs
    metadata['device'] = benchmark_spec.device
    metadata['num_layers'] = benchmark_spec.num_layers
    metadata['model'] = benchmark_spec.model
    metadata['mxnet_version'] = benchmark_spec.mxnet_version
    metadata['commit'] = mxnet_cnn.GetCommit(vm)
    return metadata
def _CreateMetadataDict(benchmark_spec):
    """Create metadata dict to be used in run results.

  Args:
    benchmark_spec: benchmark spec

  Returns:
    metadata dict
  """
    vm = benchmark_spec.vms[0]
    metadata = dict()
    metadata.update(cuda_toolkit_8.GetMetadata(vm))
    metadata['num_nodes'] = len(benchmark_spec.vms)
    metadata['cpus_per_rank'] = int(benchmark_spec.cpus_per_rank)
    metadata['total_gpus'] = int(benchmark_spec.total_gpus)
    metadata['benchmark_version'] = BENCHMARK_VERSION
    metadata['runtime'] = int(benchmark_spec.hpcg_runtime)
    metadata['problem_size'] = '%s,%s,%s' % (
        benchmark_spec.hpcg_problem_size[0],
        benchmark_spec.hpcg_problem_size[1],
        benchmark_spec.hpcg_problem_size[2])

    return metadata