a26fa88ae02e8db7ff51924735f57d95e57d26d5,benchmarking/harness.py,,,#,30

Before Change


// for backward compatible purpose
getParser().add_argument("--backend",
    help="Specify the backend the test runs on.")
getParser().add_argument("-b", "--benchmark_file", required=True,
    help="Specify the json file for the benchmark or a number of benchmarks")
getParser().add_argument("--command_args",
    help="Specify optional command arguments that would go with the "

After Change


from utils.custom_logger import getLogger
from utils.utilities import parse_kwarg, getRunStatus

parser = argparse.ArgumentParser()
parser.add_argument("--android_dir", default="/data/local/tmp/",
    help="The directory in the android device all files are pushed to.")
// for backward compatible purpose
parser.add_argument("--backend",
    help="Specify the backend the test runs on.")
parser.add_argument("-b", "--benchmark_file", required=True,
    help="Specify the json file for the benchmark or a number of benchmarks")
parser.add_argument("--command_args",
    help="Specify optional command arguments that would go with the "
    "main benchmark command")
parser.add_argument("--cooldown", default=0, type=float,
    help = "Specify the time interval between two test runs.")
parser.add_argument("--debug", action="store_true",
    help="Debug mode to retain all the running binaries and models.")
parser.add_argument("--device",
    help="The single device to run this benchmark on")
parser.add_argument("-d", "--devices",
    help="Specify the devices to run the benchmark, in a comma separated "
    "list. The value is the device or device_hash field of the meta info.")
parser.add_argument("--env", help="environment variables passed to runtime binary.",
    nargs="*", type=parse_kwarg, default=[])
parser.add_argument("--excluded_devices",
    help="Specify the devices that skip the benchmark, in a comma separated "
    "list. The value is the device or device_hash field of the meta info.")
parser.add_argument("--framework", required=True,
    choices=["caffe2", "generic", "oculus", "tflite"],
    help="Specify the framework to benchmark on.")
parser.add_argument("--info", required=True,
    help="The json serialized options describing the control and treatment.")
parser.add_argument("--ios_dir", default="/tmp",
    help="The directory in the ios device all files are pushed to.")
parser.add_argument("--local_reporter",
    help="Save the result to a directory specified by this argument.")
parser.add_argument("--monsoon_map",
    help="Map the phone hash to the monsoon serial number.")
parser.add_argument("--simple_local_reporter",
    help="Same as local reporter, but the directory hierarchy is reduced.")
parser.add_argument("--model_cache", required=True,
    help="The local directory containing the cached models. It should not "
    "be part of a git directory.")
parser.add_argument("-p", "--platform", required=True,
    help="Specify the platform to benchmark on. Use this flag if the framework"
    " needs special compilation scripts. The scripts are called build.sh "
    "saved in " + os.path.join("specifications",
    "frameworks", "<framework>", "<platform>") + " directory")
parser.add_argument("--platform_sig",
    help="Specify the platform signature")
parser.add_argument("--program",
    help="The program to run on the platform.")
parser.add_argument("--reboot", action="store_true",
    help="Tries to reboot the devices before launching benchmarks for one "
    "commit.")
parser.add_argument("--regressed_types",
    help="A json string that encodes the types of the regressed tests.")
parser.add_argument("--remote_reporter",
    help="Save the result to a remote server. "
    "The style is <domain_name>/<endpoint>|<category>")
parser.add_argument("--remote_access_token",
    help="The access token to access the remote server")
parser.add_argument("--root_model_dir",
    help="The root model directory if the meta data of the model uses "
    "relative directory, i.e. the location field starts with //")
parser.add_argument("--run_type", default="benchmark",
    choices=["benchmark", "verify", "regress"],
    help="The type of the current run. The allowed values are: "
    "benchmark, the normal benchmark run."
    "verify, the benchmark is re-run to confirm a suspicious regression."
    "regress, the regression is confirmed.")
parser.add_argument("--screen_reporter", action="store_true",
    help="Display the summary of the benchmark result on screen.")
parser.add_argument("--simple_screen_reporter", action="store_true",
    help="Display the result on screen with no post processing.")
parser.add_argument("--set_freq",
    help="On rooted android phones, set the frequency of the cores. "
    "The supported values are: "
    "max: set all cores to the maximum frquency. "
    "min: set all cores to the minimum frequency. "
    "mid: set all cores to the median frequency. ")
parser.add_argument("--shared_libs",
    help="Pass the shared libs that the framework depends on, "
    "in a comma separated list.")
parser.add_argument("--string_map",
    help="A json string mapping tokens to replacement strings. "
    "The tokens, surrended by {}, when appearing in the test fields of "
    "the json file, are to be replaced with the mapped values.")
parser.add_argument("--timeout", default=300, type=float,
    help="Specify a timeout running the test on the platforms. "
    "The timeout value needs to be large enough so that the low end devices "
    "can safely finish the execution in normal conditions. ")
parser.add_argument("--user_identifier",
    help="User can specify an identifier and that will be passed to the "
    "output so that the result can be easily identified.")
// for backward compabile purpose
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: facebook/FAI-PEP
Commit Name: a26fa88ae02e8db7ff51924735f57d95e57d26d5
Time: 2019-01-29
Author: huaminli@fb.com
File Name: benchmarking/harness.py
Class Name:
Method Name:


Project Name: facebook/FAI-PEP
Commit Name: a26fa88ae02e8db7ff51924735f57d95e57d26d5
Time: 2019-01-29
Author: huaminli@fb.com
File Name: benchmarking/get_connected_devices.py
Class Name:
Method Name:


Project Name: facebook/FAI-PEP
Commit Name: a26fa88ae02e8db7ff51924735f57d95e57d26d5
Time: 2019-01-29
Author: huaminli@fb.com
File Name: benchmarking/reboot_device.py
Class Name:
Method Name: