cli.md 8.46 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
35
36
37
---
id: cli
---

# CLI

SuperBench provides a command line interface to help you use, deploy and run benchmarks.
```
$ sb

   _____                       ____                  _
  / ____|                     |  _ \                | |
 | (___  _   _ _ __   ___ _ __| |_) | ___ _ __   ___| |__
  \___ \| | | | '_ \ / _ \ '__|  _ < / _ \ '_ \ / __| '_ \
  ____) | |_| | |_) |  __/ |  | |_) |  __/ | | | (__| | | |
 |_____/ \__,_| .__/ \___|_|  |____/ \___|_| |_|\___|_| |_|
              | |
              |_|

Welcome to the SB CLI!
```

## SuperBench CLI commands

The following lists `sb` commands usages and examples:

### `sb deploy`

Deploy the SuperBench environments to all managed nodes.
```bash title="SB CLI"
sb deploy [--docker-image]
          [--docker-password]
          [--docker-username]
          [--host-file]
          [--host-list]
          [--host-password]
          [--host-username]
38
          [--output-dir]
39
40
41
42
43
          [--private-key]
```

#### Optional arguments

44
45
46
47
48
49
50
51
52
53
54
| Name                  | Default                 | Description                                                                   |
|-----------------------|-------------------------|-------------------------------------------------------------------------------|
| `--docker-image` `-i` | `superbench/superbench` | Docker image URI, [here](./user-tutorial/container-images) listed all images. |
| `--docker-password`   | `None`                  | Docker registry password if authentication is needed.                         |
| `--docker-username`   | `None`                  | Docker registry username if authentication is needed.                         |
| `--host-file` `-f`    | `None`                  | Path to Ansible inventory host file.                                          |
| `--host-list` `-l`    | `None`                  | Comma separated host list.                                                    |
| `--host-password`     | `None`                  | Host password or key passphase if needed.                                     |
| `--host-username`     | `None`                  | Host username if needed.                                                      |
| `--output-dir`        | `None`                  | Path to output directory, outputs/{datetime} will be used if not specified.   |
| `--private-key`       | `None`                  | Path to private key if needed.                                                |
55
56
57

#### Global arguments

58
59
60
| Name          | Default | Description        |
|---------------|---------|--------------------|
| `--help` `-h` | N/A     | Show help message. |
61
62
63

#### Examples

64
Deploy default image on local GPU node:
65
```bash title="SB CLI"
66
67
68
69
70
71
sb deploy --host-list localhost
```

Deploy image `superbench/cuda:11.1` to all nodes in `./host.ini`:
```bash title="SB CLI"
sb deploy --docker-image superbench/cuda:11.1 --host-file ./host.ini
72
73
74
75
76
77
78
79
```

### `sb exec`

Execute the SuperBench benchmarks locally.
```bash title="SB CLI"
sb exec [--config-file]
        [--config-override]
80
        [--output-dir]
81
82
83
84
```

#### Optional arguments

85
86
87
88
89
| Name                     | Default | Description                                                                 |
|--------------------------|---------|-----------------------------------------------------------------------------|
| `--config-file` `-c`     | `None`  | Path to SuperBench config file.                                             |
| `--config-override` `-C` | `None`  | Extra arguments to override config_file.                                    |
| `--output-dir`           | `None`  | Path to output directory, outputs/{datetime} will be used if not specified. |
90
91
92

#### Global arguments

93
94
95
| Name          | Default | Description        |
|---------------|---------|--------------------|
| `--help` `-h` | N/A     | Show help message. |
96
97
98
99
100
101
102
103

#### Examples

Execute GPT2 model benchmark in default configuration:
```bash title="SB CLI"
sb exec --config-override superbench.enable="['gpt2_models']"
```

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
### `sb result diagnosis`

Filter the defective machines automatically from benchmarking results according to rules defined in rule file.

```bash title="SB CLI"
sb result diagnosis [--baseline-file]
       [--data-file]
       [--rule-file]
       [--output-dir]
       [--output-file-format]
```

#### Required arguments

| Name                   | Description            |
|------------------------|------------------------|
| `--baseline-file` `-b` | Path to baseline file. |
| `--data-file` `-d`     | Path to raw data file. |
| `--rule-file` `-r`     | Path to rule file.     |

#### Optional arguments

| Name                   | Default | Description                                                                 |
|------------------------|---------|-----------------------------------------------------------------------------|
| `--output-dir`         | `None`  | Path to output directory, outputs/{datetime} will be used if not specified. |
| `--output-file-format` | `excel` | Format of output file, excel or json. Default: excel.                       |

#### Global arguments

| Name          | Default | Description        |
|---------------|---------|--------------------|
| `--help` `-h` | N/A     | Show help message. |

#### Examples

Run data diagnosis and output the results in excel format:
```bash title="SB CLI"
sb result diagnosis --data-file outputs/results-summary.jsonl --rule-file rule.yaml --baseline-file baseline.json --output-file-foramt excel
```

Run data diagnosis and output the results in jsonl format:
```bash title="SB CLI"
sb result diagnosis --data-file outputs/results-summary.jsonl --rule-file rule.yaml --baseline-file baseline.json --output-file-foramt json
```

149
150
151
152
153
154
155
156
157
158
159
160
161
### `sb run`

Run the SuperBench benchmarks distributedly.
```bash title="SB CLI"
sb run [--config-file]
       [--config-override]
       [--docker-image]
       [--docker-password]
       [--docker-username]
       [--host-file]
       [--host-list]
       [--host-password]
       [--host-username]
162
       [--output-dir]
163
164
165
166
167
       [--private-key]
```

#### Optional arguments

168
169
170
171
172
173
174
175
176
177
178
179
180
| Name                     | Default                 | Description                                                                 |
|--------------------------|-------------------------|-----------------------------------------------------------------------------|
| `--config-file` `-c`     | `None`                  | Path to SuperBench config file.                                             |
| `--config-override` `-C` | `None`                  | Extra arguments to override config_file.                                    |
| `--docker-image` `-i`    | `superbench/superbench` | Docker image URI.                                                           |
| `--docker-password`      | `None`                  | Docker registry password if authentication is needed.                       |
| `--docker-username`      | `None`                  | Docker registry username if authentication is needed.                       |
| `--host-file` `-f`       | `None`                  | Path to Ansible inventory host file.                                        |
| `--host-list` `-l`       | `None`                  | Comma separated host list.                                                  |
| `--host-password`        | `None`                  | Host password or key passphase if needed.                                   |
| `--host-username`        | `None`                  | Host username if needed.                                                    |
| `--output-dir`           | `None`                  | Path to output directory, outputs/{datetime} will be used if not specified. |
| `--private-key`          | `None`                  | Path to private key if needed.                                              |
181
182
183

#### Global arguments

184
185
186
| Name          | Default | Description        |
|---------------|---------|--------------------|
| `--help` `-h` | N/A     | Show help message. |
187
188
189

#### Examples

190
191
192
193
194
195
Run all benchmarks on local GPU node:
```bash title="SB CLI"
sb run --host-list localhost
```

Run all benchmarks on all managed nodes in `./host.ini` using image `superbench/cuda:11.1`
196
197
and default benchmarking configuration:
```bash title="SB CLI"
198
sb run --docker-image superbench/cuda:11.1 --host-file ./host.ini
199
200
201
202
203
204
205
206
207
208
209
```

### `sb version`

Print the current SuperBench CLI version.
```bash title="SB CLI"
sb version
```

#### Global arguments

210
211
212
| Name          | Default | Description        |
|---------------|---------|--------------------|
| `--help` `-h` | N/A     | Show help message. |
213
214
215
216
217
218
219

#### Examples

Print version:
```bash title="SB CLI"
sb version
```
220