7b4291717410b3ce7f0c572481e5de226a76bd9c,perfkitbenchmarker/linux_packages/nvidia_driver.py,,GetGpuType,#,160

Before Change


  
  stdout, _ = vm.RemoteCommand("nvidia-smi -L", should_log=True)
  try:
    gpu_types = [line.split(" ")[3] for line in stdout.splitlines() if line]
  except:
    raise NvidiaSmiParseOutputError("Unable to parse gpu type from {}"
                                    .format(stdout))
  if any(gpu_type != gpu_types[0] for gpu_type in gpu_types):

After Change


  
  stdout, _ = vm.RemoteCommand("nvidia-smi -L", should_log=True)
  try:
    gpu_types = []
    for line in stdout.splitlines():
      if not line:
        continue
      splitted = line.split(" ")
      if splitted[2] == "Tesla":
        gpu_types.append(splitted[3])
      else:
        gpu_types.append(splitted[2])
  except:
    raise NvidiaSmiParseOutputError("Unable to parse gpu type from {}"
                                    .format(stdout))
  if any(gpu_type != gpu_types[0] for gpu_type in gpu_types):
    raise HeterogeneousGpuTypesError(
        "PKB only supports one type of gpu per VM")

  if "K80" in gpu_types[0]:
    return NVIDIA_TESLA_K80
  if "P4" in gpu_types[0]:
    return NVIDIA_TESLA_P4
  if "P100" in gpu_types[0]:
    return NVIDIA_TESLA_P100
  if "V100" in gpu_types[0]:
    return NVIDIA_TESLA_V100
  if "T4" in gpu_types[0]:
    return NVIDIA_TESLA_T4
  if "A100" in gpu_types[0]:
    return NVIDIA_TESLA_A100
  raise UnsupportedClockSpeedError(
      "Gpu type {0} is not supported by PKB".format(gpu_types[0]))

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 7b4291717410b3ce7f0c572481e5de226a76bd9c
Time: 2020-07-06
Author: p3rf@google.com
File Name: perfkitbenchmarker/linux_packages/nvidia_driver.py
Class Name:
Method Name: GetGpuType


Project Name: ylongqi/openrec
Commit Name: 93f84bee4d0c9e082c5ef04fa5f4a0886cdad2db
Time: 2018-09-26
Author: ylongqi@gmail.com
File Name: openrec/recommenders/recommender.py
Class Name: Recommender
Method Name: _optimistic_restore


Project Name: bambinos/bambi
Commit Name: e2502957ebe993c13fd84af53dea1a9e71c0d5ae
Time: 2020-10-30
Author: aloctavodia@gmail.com
File Name: bambi/models.py
Class Name: Model
Method Name: plot_priors