"vscode:/vscode.git/clone" did not exist on "d3d142ef1cc4956307d3a248e52b9f826f305048"
_help.py 6.32 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

"""SuperBench CLI help."""

from knack.help import CLIHelp
from knack.help_files import helps

CLI_NAME = 'sb'
WELCOME_MESSAGE = r"""
   _____                       ____                  _
  / ____|                     |  _ \                | |
 | (___  _   _ _ __   ___ _ __| |_) | ___ _ __   ___| |__
  \___ \| | | | '_ \ / _ \ '__|  _ < / _ \ '_ \ / __| '_ \
  ____) | |_| | |_) |  __/ |  | |_) |  __/ | | | (__| | | |
 |_____/ \__,_| .__/ \___|_|  |____/ \___|_| |_|\___|_| |_|
              | |
              |_|

Welcome to the SB CLI!
"""

helps['version'] = """
    type: command
    short-summary: Print the current SuperBench CLI version.
    examples:
        - name: print version
          text: {cli_name} version
""".format(cli_name=CLI_NAME)

helps['deploy'] = """
    type: command
    short-summary: Deploy the SuperBench environments to all given nodes.
    examples:
35
36
37
38
        - name: deploy default image on local GPU node
          text: {cli_name} deploy --host-list localhost
        - name: deploy image "superbench/cuda:11.1" to all nodes in ./host.ini
          text: {cli_name} deploy --docker-image superbench/cuda:11.1 --host-file ./host.ini
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
        - name: deploy image "superbench/rocm:4.0" to node-0 and node-2, using key file id_rsa for ssh
          text: {cli_name} deploy --docker-image superbench/rocm:4.0 --host-list node-0,node-2 --private-key id_rsa
""".format(cli_name=CLI_NAME)

helps['exec'] = """
    type: command
    short-summary: Execute the SuperBench benchmarks locally.
    examples:
        - name: execute all benchmarks using image "superbench/cuda:11.1" and default benchmarking configuration
          text: {cli_name} exec --docker-image superbench/cuda:11.1
        - name: execute all benchmarks using image "superbench/rocm:4.0" and custom config file ./config.yaml
          text: {cli_name} exec --docker-image superbench/rocm:4.0 --config-file ./config.yaml
""".format(cli_name=CLI_NAME)

helps['run'] = """
    type: command
    short-summary: Run the SuperBench benchmarks distributedly.
    examples:
57
58
59
        - name: run all benchmarks on local GPU node
          text: {cli_name} run --host-list localhost
        - name: run all benchmarks on all nodes in ./host.ini using image "superbench/cuda:11.1"
60
            and default benchmarking configuration
61
          text: {cli_name} run --docker-image superbench/cuda:11.1 --host-file ./host.ini
62
63
""".format(cli_name=CLI_NAME)

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
helps['benchmark'] = """
    type: group
    short-summary: Commands to manage benchmarks.
"""

helps['benchmark list'] = """
    type: command
    examples:
        - name: list all benchmarks
          text: {cli_name} benchmark list
        - name: list all benchmarks ending with "-bw"
          text: {cli_name} benchmark list --name [a-z]+-bw
""".format(cli_name=CLI_NAME)

helps['benchmark list-parameters'] = """
    type: command
    examples:
        - name: list parameters for all benchmarks
          text: {cli_name} benchmark list-parameters
        - name: list parameters for all benchmarks which starts with "pytorch-"
          text: {cli_name} benchmark list-parameters --name pytorch-[a-z]+
""".format(cli_name=CLI_NAME)

87
helps['node'] = """
88
    type: group
89
90
91
92
93
94
95
96
97
98
99
100
    short-summary: Get detailed information or configurations on the local node.
"""

helps['node info'] = """
    type: command
    short-summary: Get system info.
    examples:
        - name: get system info of the local node
          text: {cli_name} node info
""".format(cli_name=CLI_NAME)

helps['result'] = """
101
    type: group
102
103
104
105
106
    short-summary: Process or analyze the results of SuperBench benchmarks.
"""

helps['result diagnosis'] = """
    type: command
107
108
109
    short-summary: >
        Filter the defective machines automatically from benchmarking results
        according to rules defined in rule file.
110
111
    examples:
        - name: run data diagnosis and output the results in excel format
112
113
114
115
116
          text: >
            {cli_name} result diagnosis
            --data-file outputs/results-summary.jsonl
            --rule-file rule.yaml
            --baseline-file baseline.json
117
            --output-file-format excel
118
        - name: run data diagnosis and output the results in jsonl format
119
120
121
122
123
          text: >
            {cli_name} result diagnosis
            --data-file outputs/results-summary.jsonl
            --rule-file rule.yaml
            --baseline-file baseline.json
124
            --output-file-format json
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
        - name: run data diagnosis and output the results in markdown format
          text: >
            {cli_name} result diagnosis
            --data-file outputs/results-summary.jsonl
            --rule-file rule.yaml
            --baseline-file baseline.json
            --output-file-format md
        - name: run data diagnosis and output the results in html format
          text: >
            {cli_name} result diagnosis
            --data-file outputs/results-summary.jsonl
            --rule-file rule.yaml
            --baseline-file baseline.json
            --output-file-format html
""".format(cli_name=CLI_NAME)

helps['result summary'] = """
    type: command
    short-summary: >
        Generate the readable summary of benchmarking results
        according to rules defined in rule file.
    examples:
        - name: run result summary and output the results in excel format
          text: >
            {cli_name} result summary
            --data-file outputs/results-summary.jsonl
            --rule-file rule.yaml
            --output-file-format excel
        - name: run result summary and output the results in markdown format
          text: >
            {cli_name} result summary
            --data-file outputs/results-summary.jsonl
            --rule-file rule.yaml
            --output-file-format md
        - name: run result summary and output the results in html format
          text: >
            {cli_name} result summary
            --data-file outputs/results-summary.jsonl
            --rule-file rule.yaml
            --output-file-format html
165
""".format(cli_name=CLI_NAME)
166

167
168
169
170
171
172
173
174
175
176

class SuperBenchCLIHelp(CLIHelp):
    """SuperBench CLI help loader."""
    def __init__(self, cli_ctx=None):
        """Init CLI help loader.

        Args:
            cli_ctx (knack.cli.CLI, optional): CLI Context. Defaults to None.
        """
        super().__init__(cli_ctx=cli_ctx, welcome_message=WELCOME_MESSAGE)