NNICTLDOC.md 17.1 KB
Newer Older
Chi Song's avatar
Chi Song committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# nnictl

## 介绍

**nnictl** 是一个命令行工具,用来控制 NNI Experiment,如启动、停止、继续 Experiment,启动、停止 NNIBoard 等等。

## 命令

nnictl 支持的命令:

* [nnictl create](#create)
* [nnictl resume](#resume)
* [nnictl stop](#stop)
* [nnictl update](#update)
* [nnictl trial](#trial)
* [nnictl top](#top)
17
* [nnictl experiment](#experiment)
Chi Song's avatar
Chi Song committed
18
19
20
21
22
23
24
25
26
27
* [nnictl config](#config)
* [nnictl log](#log)
* [nnictl webui](#webui)
* [nnictl tensorboard](#tensorboard)
* [nnictl package](#package)
* [nnictl --version](#version)

### 管理 Experiment

<a name="create"></a>
Chi Song's avatar
Chi Song committed
28
![](https://placehold.it/15/1589F0/000000?text=+) `nnictl create`
Chi Song's avatar
Chi Song committed
29

Chi Song's avatar
Chi Song committed
30
* 说明
Chi Song's avatar
Chi Song committed
31
  
Chi Song's avatar
Chi Song committed
32
  此命令使用参数中的配置文件,来创建新的 Experiment。
Chi Song's avatar
Chi Song committed
33
  
Chi Song's avatar
Chi Song committed
34
35
36
  此命令成功完成后,上下文会被设置为此 Experiment。这意味着如果不显式改变上下文(暂不支持),输入的以下命令,都作用于此 Experiment。

* 用法
Chi Song's avatar
Chi Song committed
37
  
Chi Song's avatar
Chi Song committed
38
39
40
41
42
  ```bash
  nnictl create [OPTIONS]
  ```

* 选项
Chi Song's avatar
Chi Song committed
43
44
45
46
47
  
  | 参数及缩写        | 是否必需  | 默认值 | 说明                     |
  | ------------ | ----- | --- | ---------------------- |
  | --config, -c | True  |     | Experiment 的 YAML 配置文件 |
  | --port, -p   | False |     | RESTful 服务的端口          |
Chi Song's avatar
Chi Song committed
48
  | --debug, -d  | False |     | 设置为调试模式                |
Chi Song's avatar
Chi Song committed
49
50
51
52

* 样例
  
  > 在默认端口 8080 上创建一个新的 Experiment
Chi Song's avatar
Chi Song committed
53
  
Chi Song's avatar
Chi Song committed
54
55
56
  ```bash
  nnictl create --config nni/examples/trials/mnist/config.yml
  ```
Chi Song's avatar
Chi Song committed
57
  
Chi Song's avatar
Chi Song committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  > 在指定的端口 8088 上创建新的 Experiment
  
  ```bash
  nnictl create --config nni/examples/trials/mnist/config.yml --port 8088
  ```
  
  > 在指定的端口 8088 上创建新的 Experiment,并启用调试模式
  
  ```bash
  nnictl create --config nni/examples/trials/mnist/config.yml --port 8088 --debug
  ```

注意:

```text
调试模式会禁用 Trialkeeper 中的版本校验功能。
```
Chi Song's avatar
Chi Song committed
75
76
77

<a name="resume"></a>

Chi Song's avatar
Chi Song committed
78
79
80
![](https://placehold.it/15/1589F0/000000?text=+) `nnictl resume`

* 说明
Chi Song's avatar
Chi Song committed
81
  
Chi Song's avatar
Chi Song committed
82
83
84
  使用此命令恢复已停止的 Experiment。

* 用法
Chi Song's avatar
Chi Song committed
85
  
Chi Song's avatar
Chi Song committed
86
87
88
89
90
  ```bash
  nnictl resume [OPTIONS]
  ```

* 选项
Chi Song's avatar
Chi Song committed
91
  
Chi Song's avatar
Chi Song committed
92
93
  | 参数及缩写       | 是否必需  | 默认值 | 说明                               |
  | ----------- | ----- | --- | -------------------------------- |
Chi Song's avatar
Chi Song committed
94
  | id          | True  |     | 要恢复的 Experiment 标识               |
Chi Song's avatar
Chi Song committed
95
96
  | --port, -p  | False |     | 要恢复的 Experiment 使用的 RESTful 服务端口 |
  | --debug, -d | False |     | 设置为调试模式                          |
Chi Song's avatar
Chi Song committed
97

Chi Song's avatar
Chi Song committed
98
99
100
101
102
103
104
105
* 样例
  
  > 在指定的端口 8088 上恢复 Experiment
  
  ```bash
  nnictl resume [experiment_id] --port 8088
  ```

Chi Song's avatar
Chi Song committed
106
<a name="stop"></a>
Chi Song's avatar
Chi Song committed
107
![](https://placehold.it/15/1589F0/000000?text=+) `nnictl stop`
Chi Song's avatar
Chi Song committed
108

Chi Song's avatar
Chi Song committed
109
* 说明
Chi Song's avatar
Chi Song committed
110
  
Chi Song's avatar
Chi Song committed
111
112
113
114
115
116
117
118
119
120
121
  使用此命令来停止正在运行的单个或多个 Experiment。

* 用法
  
  ```bash
  nnictl stop [id]
  ```

* 详细信息及样例
  
  1. 如果没有指定 id,并且当前有运行的 Experiment,则会停止该 Experiment,否则会输出错误信息。
Chi Song's avatar
Chi Song committed
122
    
Chi Song's avatar
Chi Song committed
123
124
125
126
        ```bash
        nnictl stop
        ```
        
Chi Song's avatar
Chi Song committed
127
  
Chi Song's avatar
Chi Song committed
128
  2. 如果指定了 id,并且此 id 匹配正在运行的 Experiment,nnictl 会停止相应的 Experiment,否则会输出错误信息。
Chi Song's avatar
Chi Song committed
129
    
Chi Song's avatar
Chi Song committed
130
131
132
133
        ```bash
        nnictl stop [experiment_id]
        ```
        
Chi Song's avatar
Chi Song committed
134
  
Chi Song's avatar
Chi Song committed
135
  3. 可使用 'nnictl stop all' 来停止所有的 Experiment。
Chi Song's avatar
Chi Song committed
136
    
Chi Song's avatar
Chi Song committed
137
138
139
140
141
142
143
144
145
        ```bash
        nnictl stop all
        ```
        
  
  4. 如果 id 以 * 结尾,nnictl 会停止所有匹配此通配符的 Experiment。
  
  5. 如果 id 不存在,但匹配了某个Experiment 的 id 前缀,nnictl 会停止匹配的Experiment 。
  6. 如果 id 不存在,但匹配了多个 Experiment id 的前缀,nnictl 会输出这些 id 的信息。
Chi Song's avatar
Chi Song committed
146
147
148

<a name="update"></a>

Chi Song's avatar
Chi Song committed
149
150
151
![](https://placehold.it/15/1589F0/000000?text=+) `nnictl update`

* **nnictl update searchspace**
Chi Song's avatar
Chi Song committed
152
  
Chi Song's avatar
Chi Song committed
153
  * 说明
Chi Song's avatar
Chi Song committed
154
    
Chi Song's avatar
Chi Song committed
155
156
157
    可以用此命令来更新 Experiment 的搜索空间。
  
  * 用法
Chi Song's avatar
Chi Song committed
158
    
Chi Song's avatar
Chi Song committed
159
160
161
162
163
    ```bash
    nnictl update searchspace [OPTIONS]
    ```
  
  * 选项
Chi Song's avatar
Chi Song committed
164
165
166
167
168
169
  
  | 参数及缩写          | 是否必需  | 默认值 | 说明                    |
  | -------------- | ----- | --- | --------------------- |
  | id             | False |     | 需要设置的 Experiment 的 id |
  | --filename, -f | True  |     | 新的搜索空间文件名             |
  
Chi Song's avatar
Chi Song committed
170
  * 样例
Chi Song's avatar
Chi Song committed
171
    
Chi Song's avatar
Chi Song committed
172
    `使用 'examples/trials/mnist/search_space.json' 来更新 Experiment 的搜索空间`
Chi Song's avatar
Chi Song committed
173
    
Chi Song's avatar
Chi Song committed
174
175
176
177
178
179
180
    ```bash
    nnictl update searchspace [experiment_id] --file examples/trials/mnist/search_space.json
    ```

* **nnictl update concurrency**
  
  * 说明
Chi Song's avatar
Chi Song committed
181
    
Chi Song's avatar
Chi Song committed
182
183
184
185
186
187
188
189
190
    可以用此命令来更新 Experiment 的并发设置。
  
  * 用法
    
    ```bash
    nnictl update concurrency [OPTIONS]
    ```
  
  * 选项
Chi Song's avatar
Chi Song committed
191
192
193
194
195
196
  
  | 参数及缩写       | 是否必需  | 默认值 | 说明                    |
  | ----------- | ----- | --- | --------------------- |
  | id          | False |     | 需要设置的 Experiment 的 id |
  | --value, -v | True  |     | 允许同时运行的 Trial 的数量     |
  
Chi Song's avatar
Chi Song committed
197
  * 样例
Chi Song's avatar
Chi Song committed
198
    
Chi Song's avatar
Chi Song committed
199
    > 更新 Experiment 的并发数量
Chi Song's avatar
Chi Song committed
200
    
Chi Song's avatar
Chi Song committed
201
202
203
204
205
206
207
    ```bash
    nnictl update concurrency [experiment_id] --value [concurrency_number]
    ```

* **nnictl update duration**
  
  * 说明
Chi Song's avatar
Chi Song committed
208
    
Chi Song's avatar
Chi Song committed
209
210
211
212
213
214
215
216
217
218
    可以用此命令来更新 Experiment 的运行时间。
  
  * 用法
    
    ```bash
    nnictl update duration [OPTIONS]
    ```
  
  * 选项
  
Chi Song's avatar
Chi Song committed
219
220
221
222
223
  | 参数及缩写       | 是否必需  | 默认值 | 说明                                                                      |
  | ----------- | ----- | --- | ----------------------------------------------------------------------- |
  | id          | False |     | 需要设置的 Experiment 的 id                                                   |
  | --value, -v | True  |     | Experiment 持续时间如没有单位,则为秒。 后缀可以为 's' 即秒 (默认值), 'm' 即分钟, 'h' 即小时或 'd' 即天。 |
  
Chi Song's avatar
Chi Song committed
224
225
226
  * 样例
    
    > 修改 Experiment 的执行时间
Chi Song's avatar
Chi Song committed
227
    
Chi Song's avatar
Chi Song committed
228
229
230
231
232
233
234
    ```bash
    nnictl update duration [experiment_id] --value [duration]
    ```

* **nnictl update trialnum**
  
  * 说明
Chi Song's avatar
Chi Song committed
235
    
Chi Song's avatar
Chi Song committed
236
237
238
    可以用此命令来更新 Experiment 的最大 Trial 数量。
  
  * 用法
Chi Song's avatar
Chi Song committed
239
    
Chi Song's avatar
Chi Song committed
240
241
242
243
244
    ```bash
    nnictl update trialnum [OPTIONS]
    ```
  
  * 选项
Chi Song's avatar
Chi Song committed
245
246
247
248
249
  
  | 参数及缩写       | 是否必需  | 默认值 | 说明                    |
  | ----------- | ----- | --- | --------------------- |
  | id          | False |     | 需要设置的 Experiment 的 id |
  | --value, -v | True  |     | 需要设置的 maxtrialnum 的数量 |
Chi Song's avatar
Chi Song committed
250
251
252
253
254
255
256
257
  
  * 样例
    
    > 更新 Experiment 的 Trial 数量
    
    ```bash
    nnictl update trialnum --id [experiment_id] --value [trial_num]
    ```
Chi Song's avatar
Chi Song committed
258
259

<a name="trial"></a>
Chi Song's avatar
Chi Song committed
260
![](https://placehold.it/15/1589F0/000000?text=+) `nnictl trial`
Chi Song's avatar
Chi Song committed
261

Chi Song's avatar
Chi Song committed
262
* **nnictl trial ls**
Chi Song's avatar
Chi Song committed
263
  
Chi Song's avatar
Chi Song committed
264
  * 说明
Chi Song's avatar
Chi Song committed
265
    
Chi Song's avatar
Chi Song committed
266
267
268
    使用此命令来查看 Trial 的信息。
  
  * 用法
Chi Song's avatar
Chi Song committed
269
    
Chi Song's avatar
Chi Song committed
270
271
272
273
274
    ```bash
    nnictl trial ls
    ```
  
  * 选项
Chi Song's avatar
Chi Song committed
275
276
277
278
279
  
  | 参数及缩写 | 是否必需  | 默认值 | 说明                    |
  | ----- | ----- | --- | --------------------- |
  | id    | False |     | 需要设置的 Experiment 的 id |

Chi Song's avatar
Chi Song committed
280
* **nnictl trial kill**
Chi Song's avatar
Chi Song committed
281
282
283
  
  * 说明
    
Chi Song's avatar
Chi Song committed
284
    此命令用于终止 Trial。
Chi Song's avatar
Chi Song committed
285
286
287
288
  
  * 用法
    
    ```bash
Chi Song's avatar
Chi Song committed
289
    nnictl trial kill [OPTIONS]
Chi Song's avatar
Chi Song committed
290
291
292
293
    ```
  
  * 选项
  
Chi Song's avatar
Chi Song committed
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
  | 参数及缩写          | 是否必需  | 默认值 | 说明                    |
  | -------------- | ----- | --- | --------------------- |
  | id             | False |     | Trial 的 Experiment ID |
  | --trial_id, -T | True  |     | 需要终止的 Trial 的 ID。     |
  
  * 样例
    
    > 结束 Trial 任务
    
    ```bash
    nnictl trial [trial_id] --experiment [experiment_id]
    ```

<a name="top"></a>

![](https://placehold.it/15/1589F0/000000?text=+) `nnictl top`

* 说明
  
  查看正在运行的 Experiment。

* 用法
  
  ```bash
  nnictl top
  ```

* 选项
  
Chi Song's avatar
Chi Song committed
323
324
325
326
327
328
  | 参数及缩写      | 是否必需  | 默认值 | 说明                                   |
  | ---------- | ----- | --- | ------------------------------------ |
  | id         | False |     | 需要设置的 Experiment 的 id                |
  | --time, -t | False |     | 刷新 Experiment 状态的时间间隔,单位为秒,默认值为 3 秒。 |

<a name="experiment"></a>
Chi Song's avatar
Chi Song committed
329
![](https://placehold.it/15/1589F0/000000?text=+) `管理 Experiment 的信息`
Chi Song's avatar
Chi Song committed
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378

* **nnictl experiment show**
  
  * 说明
    
    显示 Experiment 的信息。
  
  * 用法
    
    ```bash
    nnictl experiment show
    ```
  
  * 选项
  
  | 参数及缩写 | 是否必需  | 默认值 | 说明                    |
  | ----- | ----- | --- | --------------------- |
  | id    | False |     | 需要设置的 Experiment 的 id |

* **nnictl experiment status**
  
  * 说明
    
    显示 Experiment 的状态。
  
  * 用法
    
    ```bash
    nnictl experiment status
    ```
  
  * 选项
  
  | 参数及缩写 | 是否必需  | 默认值 | 说明                    |
  | ----- | ----- | --- | --------------------- |
  | id    | False |     | 需要设置的 Experiment 的 id |

* **nnictl experiment list**
  
  * 说明
    
    显示正在运行的 Experiment 的信息
  
  * 用法
    
    ```bash
    nnictl experiment list
    ```

Chi Song's avatar
Chi Song committed
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<a name="export"></a>

* **nnictl experiment export**
  
  * 说明
    
    使用此命令,可将 Trial 的 reward 和超参导出为 csv 文件。
  
  * 用法
    
    ```bash
    nnictl experiment export [OPTIONS]
    ```
  
  * 选项
  
  | 参数及缩写  | 是否必需  | 默认值 | 说明                        |
  | ------ | ----- | --- | ------------------------- |
  | id     | False |     | Experiment ID             |
  | --file | True  |     | 文件的输出路径                   |
  | --type | True  |     | 输出文件类型,仅支持 "csv" 和 "json" |
  
  * 样例
  
  > 将 Experiment 中所有 Trial 数据导出为 JSON 格式
  
  ```bash
  nnictl experiment export [experiment_id] --file [file_path] --type json
  ```
Chi Song's avatar
Chi Song committed
408

Chi Song's avatar
Chi Song committed
409
* **nnictl experiment import**
Chi Song's avatar
Chi Song committed
410
411
412
  
  * 说明
    
Chi Song's avatar
Chi Song committed
413
    可使用此命令将以前的 Trial 超参和结果导入到 Tuner 中。 数据会传入调参算法中(即 Tuner 或 Advisor)。
Chi Song's avatar
Chi Song committed
414
415
416
417
  
  * 用法
    
    ```bash
Chi Song's avatar
Chi Song committed
418
    nnictl experiment import [OPTIONS]
Chi Song's avatar
Chi Song committed
419
    ```
Chi Song's avatar
Chi Song committed
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
  
  * 选项
  
  | 参数及缩写      | 是否必需  | 默认值 | 说明                       |
  | ---------- | ----- | --- | ------------------------ |
  | id         | False |     | 需要将数据导入的 Experiment 的 ID |
  | --file, -f | True  |     | 需要导入的 JSON 格式的数据文件       |
  
  * 详细说明
    
    NNI 支持导入用户的数据,确保数据格式正确。 样例如下:
    
    ```json
    [
      {"parameter": {"x": 0.5, "y": 0.9}, "value": 0.03},
      {"parameter": {"x": 0.4, "y": 0.8}, "value": 0.05},
      {"parameter": {"x": 0.3, "y": 0.7}, "value": 0.04}
    ]
    ```
    
    最顶层列表的每个元素都是一个样例。 对于内置的 Tuner 和 Advisor,每个样本至少需要两个主键:`parameter``value``parameter` 必须与 Experiment 的搜索空间相匹配,`parameter` 中的所有的主键(或超参)都必须与搜索空间中的主键相匹配。 否则, Tuner 或 Advisor 可能会有无法预期的行为。 `Value` 应当遵循与 `nni.report_final_result` 的输入值一样的规则,即要么时一个数字,或者是包含 `default` 主键的 dict。 对于自定义的 Tuner 或 Advisor,根据实现的不同,此文件可以是任意的 JSON 内容(例如,`import_data`)。
    
    也可以用 [nnictl experiment export](#export) 命令导出 Experiment 已经运行过的 Trial 超参和结果。
    
    当前,以下 Tuner 和 Advisor 支持导入数据:
    
    ```yml
    内置 Tuner: TPE, Anneal, GridSearch, MetisTuner
    内置 Advisor: BOHB
    ```
    
    *如果要将数据导入到 BOHB Advisor,建议像 NNI 一样,增加 "TRIAL_BUDGET" 参数,否则,BOHB 会使用 max_budget 作为 "TRIAL_BUDGET"。 样例如下:*
    
    ```json
    [
      {"parameter": {"x": 0.5, "y": 0.9, "TRIAL_BUDGET": 27}, "value": 0.03}
    ]
    ```
  
  * 样例
    
    > 将数据导入运行中的 Experiment
    
    ```bash
    nnictl experiment [experiment_id] -f experiment_data.json
    ```

<a name="config"></a>
![](https://placehold.it/15/1589F0/000000?text=+) `nnictl config show`

* 说明
  
  显示当前上下文信息。

* 用法
  
  ```bash
  nnictl config show
  ```
Chi Song's avatar
Chi Song committed
479
480
481

<a name="log"></a>

Chi Song's avatar
Chi Song committed
482
![](https://placehold.it/15/1589F0/000000?text=+) `管理日志`
Chi Song's avatar
Chi Song committed
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503

* **nnictl log stdout**
  
  * 说明
    
    显示 stdout 日志内容。
  
  * 用法
    
    ```bash
    nnictl log stdout [options]
    ```
  
  * 选项
  
  | 参数及缩写      | 是否必需  | 默认值 | 说明                    |
  | ---------- | ----- | --- | --------------------- |
  | id         | False |     | 需要设置的 Experiment 的 id |
  | --head, -h | False |     | 显示 stdout 开始的若干行      |
  | --tail, -t | False |     | 显示 stdout 结尾的若干行      |
  | --path, -p | False |     | 显示 stdout 文件的路径       |
Chi Song's avatar
Chi Song committed
504
505
506
507
508
509
510
511
  
  * 样例
    
    > 显示 stdout 结尾的若干行
    
    ```bash
    nnictl log stdout [experiment_id] --tail [lines_number]
    ```
Chi Song's avatar
Chi Song committed
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547

* **nnictl log stderr**
  
  * 说明
    
    显示 stderr 日志内容。
  
  * 用法
    
    ```bash
    nnictl log stderr [options]
    ```
  
  * 选项
  
  | 参数及缩写      | 是否必需  | 默认值 | 说明                    |
  | ---------- | ----- | --- | --------------------- |
  | id         | False |     | 需要设置的 Experiment 的 id |
  | --head, -h | False |     | 显示 stderr 开始的若干行      |
  | --tail, -t | False |     | 显示 stderr 结尾的若干行      |
  | --path, -p | False |     | 显示 stderr 文件的路径       |

* **nnictl log trial**
  
  * 说明
    
    显示 Trial 日志的路径。
  
  * 用法
    
    ```bash
    nnictl log trial [options]
    ```
  
  * 选项
  
Chi Song's avatar
Chi Song committed
548
549
550
551
  | 参数及缩写          | 是否必需  | 默认值 | 说明                                     |
  | -------------- | ----- | --- | -------------------------------------- |
  | id             | False |     | Trial 的 Experiment ID                  |
  | --trial_id, -T | False |     | 所需要找日志路径的 Trial 的 ID,当 id 不为空时,此值也为必需。 |
Chi Song's avatar
Chi Song committed
552
553

<a name="webui"></a>
Chi Song's avatar
Chi Song committed
554
![](https://placehold.it/15/1589F0/000000?text=+) `管理 Web 界面`
Chi Song's avatar
Chi Song committed
555
556
557
558

* **nnictl webui url**

<a name="tensorboard"></a>
Chi Song's avatar
Chi Song committed
559
![](https://placehold.it/15/1589F0/000000?text=+) `管理 TensorBoard`
Chi Song's avatar
Chi Song committed
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574

* **nnictl tensorboard start**
  
  * 说明
    
    启动 tensorboard 进程。
  
  * 用法
    
    ```bash
    nnictl tensorboard start
    ```
  
  * 选项
  
Chi Song's avatar
Chi Song committed
575
576
577
578
579
  | 参数及缩写          | 是否必需  | 默认值  | 说明                    |
  | -------------- | ----- | ---- | --------------------- |
  | id             | False |      | 需要设置的 Experiment 的 ID |
  | --trial_id, -T | False |      | Trial 的 id            |
  | --port         | False | 6006 | Tensorboard 进程的端口     |
Chi Song's avatar
Chi Song committed
580
581
582
583
584
585
586
  
  * 详细说明
    
    1. NNICTL 当前仅支持本机和远程平台的 tensorboard,其它平台暂不支持。 
    2. 如果要使用 tensorboard,需要将 tensorboard 日志输出到环境变量 [NNI_OUTPUT_DIR] 路径下。 
    3. 在 local 模式中,nnictl 会直接设置 --logdir=[NNI_OUTPUT_DIR] 并启动 tensorboard 进程。
    4. 在 remote 模式中,nnictl 会创建一个 ssh 客户端来将日志数据从远程计算机复制到本机临时目录中,然后在本机开始 tensorboard 进程。 需要注意的是,nnictl 只在使用此命令时复制日志数据,如果要查看最新的 tensorboard 结果,需要再次执行 nnictl tensorboard 命令。
Chi Song's avatar
Chi Song committed
587
    5. 如果只有一个 Trial 任务,不需要设置 Trial ID。 如果有多个运行的 Trial 作业,需要设置 Trial ID,或使用 [nnictl tensorboard start --trial_id all] 来将 --logdir 映射到所有 Trial 的路径。
Chi Song's avatar
Chi Song committed
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602

* **nnictl tensorboard stop**
  
  * 说明
    
    停止所有 tensorboard 进程。
  
  * 用法
    
    ```bash
    nnictl tensorboard stop
    ```
  
  * 选项
  
603
604
605
  | 参数及缩写 | 是否必需  | 默认值 | 说明                    |
  | ----- | ----- | --- | --------------------- |
  | id    | False |     | 需要设置的 Experiment 的 id |
Chi Song's avatar
Chi Song committed
606
607
608

<a name="package"></a>

Chi Song's avatar
Chi Song committed
609
![](https://placehold.it/15/1589F0/000000?text=+) `管理包`
Chi Song's avatar
Chi Song committed
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627

* **nnictl package install**
  
  * 说明
    
    安装 NNI 实验所需要的包。
  
  * 用法
    
    ```bash
    nnictl package install [OPTIONS]
    ```
  
  * 选项
  
  | 参数及缩写  | 是否必需 | 默认值 | 说明      |
  | ------ | ---- | --- | ------- |
  | --name | True |     | 要安装的包名称 |
Chi Song's avatar
Chi Song committed
628
629
630
631
632
633
634
635
  
  * 样例
    
    > 安装 SMAC Tuner 所需要的包
    
    ```bash
    nnictl package install --name=SMAC
    ```
Chi Song's avatar
Chi Song committed
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650

* **nnictl package show**
  
  * 说明
    
    列出支持的安装包
  
  * 用法
    
    ```bash
    nnictl package show
    ```

<a name="version"></a>

Chi Song's avatar
Chi Song committed
651
![](https://placehold.it/15/1589F0/000000?text=+) `检查 NNI 版本`
Chi Song's avatar
Chi Song committed
652
653
654
655
656
657
658
659
660
661
662
663

* **nnictl --version**
  
  * 说明
    
    显示当前安装的 NNI 的版本。
  
  * 用法
    
    ```bash
    nnictl --version
    ```