Example #1
0
def collect_results(root, pipeline):
    with open(PLAN_PATH) as file_:
        plan = yaml.safe_load(file_)
    gpu_flops = plan['CONST']['gpu_flops']
    baseline_name = plan['CONST']['efficiency_baseline']
    for info in util.iterate_tests(plan, pipeline):
        if info.platform_name == baseline_name:
            continue
        path = info.path(root) / 'report.json'
        print(path)
        if path.exists():
            with path.open() as fp:
                data = json.load(fp)
        else:
            data = {
                'compare': False,
                'ratio': None,
                'compile_duration': None,
                'cur.execution_duration': None,
                'ref.execution_duration': None,
                'status': 'ERROR',
                'failures': [],
                'errors': [],
                'reason': 'Result not found',
                'build_url': DEFAULT_BUILD_URL,
            }
        data['info'] = info
        yield data
Example #2
0
def cmd_pipeline(args, remainder):
    import pystache
    import yaml

    with open('ci/plan.yml') as file_:
        plan = yaml.safe_load(file_)

    variants = []
    for variant in plan['VARIANTS'].keys():
        variants.append(
            dict(
                name=variant,
                python=get_python(variant),
                emoji=get_emoji(variant),
            ))

    tests = []
    for test in util.iterate_tests(plan, args.pipeline):
        if test.shards > 1:
            shard = dict(id=test.shard_id, count=test.shards)
            shard_emoji = get_shard_emoji(test.shard_id)
        else:
            shard = None
            shard_emoji = ''
        tests.append(
            dict(suite=test.suite_name,
                 workload=test.workload_name,
                 platform=test.platform_name,
                 batch_size=test.batch_size,
                 variant=test.variant,
                 timeout=test.timeout,
                 retry=test.retry,
                 soft_fail=test.soft_fail,
                 python=get_python(test.variant),
                 shard=shard,
                 shard_emoji=shard_emoji,
                 emoji=get_emoji(test.variant),
                 engine=get_engine(test.platform_name)))

    if args.count:
        util.printf('variants: {}'.format(len(variants)))
        util.printf('tests   : {}'.format(len(tests)))
        util.printf('total   : {}'.format(len(variants) + len(tests)))
    else:
        ctx = dict(variants=variants, tests=tests)
        yml = pystache.render(load_template('pipeline.yml'), ctx)
        util.printf(yml)