pytorch

Форк
0
45 строк · 1.3 Кб
1
"""Basic runner for the instruction count microbenchmarks.
2

3
The contents of this file are placeholders, and will be replaced by more
4
expressive and robust components (e.g. better runner and result display
5
components) in future iterations. However this allows us to excercise the
6
underlying benchmark generation infrastructure in the mean time.
7
"""
8
import argparse
9
import sys
10
from typing import List
11

12
from applications import ci
13
from core.expand import materialize
14
from definitions.standard import BENCHMARKS
15
from execution.runner import Runner
16
from execution.work import WorkOrder
17

18

19
def main(argv: List[str]) -> None:
20
    work_orders = tuple(
21
        WorkOrder(label, autolabels, timer_args, timeout=600, retries=2)
22
        for label, autolabels, timer_args in materialize(BENCHMARKS)
23
    )
24

25
    results = Runner(work_orders).run()
26
    for work_order in work_orders:
27
        print(
28
            work_order.label,
29
            work_order.autolabels,
30
            work_order.timer_args.num_threads,
31
            results[work_order].instructions,
32
        )
33

34

35
if __name__ == "__main__":
36
    modes = {
37
        "debug": main,
38
        "ci": ci.main,
39
    }
40

41
    parser = argparse.ArgumentParser()
42
    parser.add_argument("--mode", type=str, choices=list(modes.keys()), default="debug")
43

44
    args, remaining_args = parser.parse_known_args(sys.argv)
45
    modes[args.mode](remaining_args[1:])
46

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.