コード例 #1
0
                        '--num-runs',
                        default=10,
                        type=int,
                        help='Number of times to run each test.')
    parser.add_argument('--data-types',
                        default=data_type_classes.keys(),
                        nargs='+',
                        choices=data_type_classes.keys(),
                        help='Types of data to generate plots for.')
    parser.add_argument('-I',
                        '--input-yaml',
                        required=True,
                        help='rocBLAS input yaml config.')
    user_args = cr.parse_input_arguments(parser)

    command_runner = cr.CommandRunner(user_args)

    command_runner.setup_system()

    #load yaml then create fig for every test
    with open(user_args.input_yaml, 'r') as f:
        data = YamlData(f)
        f.close()

    comparisons = []

    #setup tests sorted by their respective figures
    for test_yaml in data.test_cases:
        for data_type in user_args.data_types:
            print(data_type)
            data_type_cls = data_type_classes[data_type]
コード例 #2
0
def main(argv):
    def str2bool(v):
        if isinstance(v, bool):
            return v
        if v.lower() in ('yes', 'true', 't', 'y', '1'):
            return True
        elif v.lower() in ('no', 'false', 'f', 'n', '0'):
            return False
        else:
            raise argparse.ArgumentTypeError(
                'Boolean value or next flag expected.')

    # WARNING: The approach to using booleans is not compatible with purely positional arguments
    #    because `--bool-option <positional arg>` would attempt to convert the positional argument
    #    to a boolean. Otherwise, it is more intuitive and flexible than enable/disable flags.

    parser = argparse.ArgumentParser()

    parser.add_argument('-s',
                        '--is-short-run',
                        type=str2bool,
                        nargs='?',
                        const=True,
                        default=False,
                        help='Run a shorter test.')
    parser.add_argument('-D',
                        '--dimension',
                        default=[1, 2, 3],
                        type=int,
                        nargs='+',
                        help='Space separated list of dimensions to run.')
    parser.add_argument('-N',
                        '--num-runs',
                        default=10,
                        type=int,
                        help='Number of times to run each test.')
    parser.add_argument(
        '-b',
        '--dload-binary',
        default=None,
        help=
        'Optional binary for combining different dynamic libraries into a single executable using dload.'
    )
    parser.add_argument('-S',
                        '--speedup',
                        type=str2bool,
                        nargs='?',
                        const=True,
                        default=True,
                        help='Plot speedup with respect to the first run.')
    parser.add_argument('-t',
                        '--data-type',
                        default='time',
                        choices=['time', 'gflops', 'roofline'],
                        help='Primary axis dataype.')
    parser.add_argument('-y',
                        '--second-type',
                        default='none',
                        choices=['none', 'gflops'],
                        help='Secondary axis dataype.')
    parser.add_argument('-R',
                        '--run-type',
                        default=['benchmark'],
                        nargs='+',
                        choices=['report', 'benchmark', 'efficiency'],
                        help='Secondary axis dataype.')
    parser.add_argument('-f',
                        '--doc-format',
                        default='pdf',
                        choices=['pdf', 'docx'],
                        help='Documentation output format.')
    user_args = cr.parse_input_arguments(parser)

    command_runner = cr.CommandRunner(user_args, RocFftRunConfiguration)

    if user_args.num_repititions > 1 and command_runner.is_make_document():
        print(
            "WARNING - document generation does not support multiple coarse grained runs"
        )
        import time
        time.sleep(5)

    rundims = user_args.dimension
    print("rundims:")
    print(rundims)

    indirlist = command_runner.executable_directories
    outdirlist = command_runner.output_directories
    labellist = command_runner.labels

    # if command_runner.is_run_tool():
    #     for indir in indirlist:
    #         if not binaryisok(indir, "rocfft-rider"):
    #             print("unable to find " + "rocfft-rider" + " in " + indir)
    #             print("please specify with -i")
    #             sys.exit(1)

    if user_args.is_short_run:
        print("short run")
    print("output format: " + user_args.doc_format)
    print("device number: " + str(user_args.device_num))

    command_runner.setup_system()

    figs = []

    dynarider = user_args.dload_binary is not None
    if "benchmark" in user_args.run_type:
        figs += benchfigs(rundims, user_args.is_short_run, dynarider)
    if "report" in user_args.run_type:
        figs += reportfigs(rundims, user_args.is_short_run, dynarider)
    if "efficiency" in user_args.run_type:
        figs += efficiencyfigs(rundims, user_args.is_short_run, dynarider)
    just1dc2crad2 = user_args.run_type == "efficiency"

    for idx, fig in enumerate(figs):
        for idx2, fig2 in enumerate(figs):
            if idx != idx2 and fig.get_name() == fig2.get_name():
                print("figures have the same name!")
                print(fig.get_name())
                print(fig.runs)
                print(fig2.get_name())
                print(fig2.runs)
                sys.exit(1)

    command_runner.add_comparisons(figs)

    command_runner.execute()

    command_runner.show_plots()
    command_runner.output_summary()