Nnictl.md 20.7 KB
Newer Older
QuanluZhang's avatar
QuanluZhang committed
1
# nnictl
Chi Song's avatar
Chi Song committed
2

QuanluZhang's avatar
QuanluZhang committed
3
## Introduction
Chi Song's avatar
Chi Song committed
4

QuanluZhang's avatar
QuanluZhang committed
5
6
7
__nnictl__ is a command line tool, which can be used to control experiments, such as start/stop/resume an experiment, start/stop NNIBoard, etc.

## Commands
Chi Song's avatar
Chi Song committed
8

QuanluZhang's avatar
QuanluZhang committed
9
nnictl support commands:
Chi Song's avatar
Chi Song committed
10

11
12
* [nnictl create](#create)
* [nnictl resume](#resume)
SparkSnail's avatar
SparkSnail committed
13
* [nnictl view](#view)
14
15
16
17
18
* [nnictl stop](#stop)
* [nnictl update](#update)
* [nnictl trial](#trial)
* [nnictl top](#top)
* [nnictl experiment](#experiment)
SparkSnail's avatar
SparkSnail committed
19
* [nnictl platform](#platform)
20
21
22
23
24
* [nnictl config](#config)
* [nnictl log](#log)
* [nnictl webui](#webui)
* [nnictl tensorboard](#tensorboard)
* [nnictl package](#package)
25
* [nnictl ss_gen](#ss_gen)
26
* [nnictl --version](#version)
Chi Song's avatar
Chi Song committed
27

Yan Ni's avatar
Yan Ni committed
28
### Manage an experiment
29

Yan Ni's avatar
Yan Ni committed
30
<a name="create"></a>
Tab Zhang's avatar
Tab Zhang committed
31
### nnictl create
32

33
* Description
34

35
  You can use this command to create a new experiment, using the configuration specified in config file.
36

37
  After this command is successfully done, the context will be set as this experiment, which means the following command you issued is associated with this experiment, unless you explicitly changes the context(not supported yet).
38

39
* Usage
40

41
42
43
  ```bash
  nnictl create [OPTIONS]
  ```
44

45
* Options
46

Chi Song's avatar
Chi Song committed
47
48
49
50
  |Name, shorthand|Required|Default|Description|
  |------|------|------|------|
  |--config, -c|  True| |YAML configure file of the experiment|
  |--port, -p|False| |the port of restful server|
51
  |--debug, -d|False||set debug mode|
52
  |--foreground, -f|False||set foreground mode, print log content to terminal|
53

54
* Examples
55

56
  > create a new experiment with the default port: 8080
57

58
  ```bash
59
  nnictl create --config nni/examples/trials/mnist-tfv1/config.yml
60
  ```
61

62
  > create a new experiment with specified port 8088
63

64
  ```bash
65
  nnictl create --config nni/examples/trials/mnist-tfv1/config.yml --port 8088
66
  ```
67

68
  > create a new experiment with specified port 8088 and debug mode
69

70
  ```bash
71
  nnictl create --config nni/examples/trials/mnist-tfv1/config.yml --port 8088 --debug
72
  ```
73

74
75
76
77
78
79
Note:

```text
Debug mode will disable version check function in Trialkeeper.
```

Yan Ni's avatar
Yan Ni committed
80
<a name="resume"></a>
81

Tab Zhang's avatar
Tab Zhang committed
82
### nnictl resume
QuanluZhang's avatar
QuanluZhang committed
83

84
* Description
Chi Song's avatar
Chi Song committed
85

86
  You can use this command to resume a stopped experiment.
Chi Song's avatar
Chi Song committed
87

88
* Usage
Chi Song's avatar
Chi Song committed
89

90
91
92
  ```bash
  nnictl resume [OPTIONS]
  ```
Chi Song's avatar
Chi Song committed
93

94
* Options
95

Chi Song's avatar
Chi Song committed
96
97
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
98
  |id|  True| |The id of the experiment you want to resume|
Chi Song's avatar
Chi Song committed
99
  |--port, -p|  False| |Rest port of the experiment you want to resume|
100
  |--debug, -d|False||set debug mode|
101
  |--foreground, -f|False||set foreground mode, print log content to terminal|
Chi Song's avatar
Chi Song committed
102

103
* Example
104

105
  > resume an experiment with specified port 8088
106

107
108
109
  ```bash
  nnictl resume [experiment_id] --port 8088
  ```
110

SparkSnail's avatar
SparkSnail committed
111
112
<a name="view"></a>

Tab Zhang's avatar
Tab Zhang committed
113
### nnictl view
SparkSnail's avatar
SparkSnail committed
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

* Description

  You can use this command to view a stopped experiment.

* Usage

  ```bash
  nnictl view [OPTIONS]
  ```

* Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  True| |The id of the experiment you want to view|
  |--port, -p|  False| |Rest port of the experiment you want to view|

* Example

  > view an experiment with specified port 8088

  ```bash
  nnictl view [experiment_id] --port 8088
  ```

Yan Ni's avatar
Yan Ni committed
140
<a name="stop"></a>
Tab Zhang's avatar
Tab Zhang committed
141
### nnictl stop
142

143
* Description
Chi Song's avatar
Chi Song committed
144

145
  You can use this command to stop a running experiment or multiple experiments.
Chi Song's avatar
Chi Song committed
146

147
* Usage
Chi Song's avatar
Chi Song committed
148

149
  ```bash
150
  nnictl stop [Options]
151
  ```
152

153
154
155
156
157
158
* Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |The id of the experiment you want to stop|
  |--port, -p|  False| |Rest port of the experiment you want to stop|
159
  |--all, -a|  False| |Stop all of experiments|
160

161
* Details & Examples
162

163
  1. If there is no id specified, and there is an experiment running, stop the running experiment, or print error message.
164
165
166
167
168

      ```bash
      nnictl stop
      ```

169
  2. If there is an id specified, and the id matches the running experiment, nnictl will stop the corresponding experiment, or will print error message.
170
171
172
173
174

      ```bash
      nnictl stop [experiment_id]
      ```

175
176
177
178
179
180
  3. If there is a port specified, and an experiment is running on that port, the experiment will be stopped.

      ```bash
      nnictl stop --port 8080
      ```

181
  4. Users could use 'nnictl stop --all' to stop all experiments.
182
183

      ```bash
184
      nnictl stop --all
185
      ```
186

187
188
189
  5. If the id ends with *, nnictl will stop all experiments whose ids matchs the regular.
  6. If the id does not exist but match the prefix of an experiment id, nnictl will stop the matched experiment.
  7. If the id does not exist but match multiple prefix of the experiment ids, nnictl will give id information.
190

Yan Ni's avatar
Yan Ni committed
191
<a name="update"></a>
192

Tab Zhang's avatar
Tab Zhang committed
193
### nnictl update
194

195
196
* __nnictl update searchspace__
  * Description
197

198
    You can use this command to update an experiment's search space.
199

200
  * Usage
201

202
203
204
    ```bash
    nnictl update searchspace [OPTIONS]
    ```
205

206
  * Options
207

208
209
210
211
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
  |--filename, -f|  True| |the file storing your new search space|
212

213
  * Example
214

215
    `update experiment's new search space with file dir 'examples/trials/mnist-tfv1/search_space.json'`
216

217
    ```bash
218
    nnictl update searchspace [experiment_id] --filename examples/trials/mnist-tfv1/search_space.json
219
    ```
220

221
* __nnictl update concurrency__
222

223
  * Description
224

225
     You can use this command to update an experiment's concurrency.
226

227
  * Usage
228

229
230
231
    ```bash
    nnictl update concurrency [OPTIONS]
    ```
232

233
  * Options
234

235
236
237
238
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
  |--value, -v|  True| |the number of allowed concurrent trials|
239

240
  * Example
241

242
    > update experiment's concurrency
243

244
245
246
    ```bash
    nnictl update concurrency [experiment_id] --value [concurrency_number]
    ```
247

248
* __nnictl update duration__
249

250
  * Description
251

252
    You can use this command to update an experiment's duration.
253

254
  * Usage
255

256
257
258
    ```bash
    nnictl update duration [OPTIONS]
    ```
259

260
  * Options
261

262
263
264
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
Junwei Sun's avatar
Junwei Sun committed
265
  |--value, -v|  True| | Strings like '1m' for one minute or '2h' for two hours. SUFFIX may be 's' for seconds, 'm' for minutes, 'h' for hours or 'd' for days.|
266

267
  * Example
268

269
    > update experiment's duration
270

271
272
273
    ```bash
    nnictl update duration [experiment_id] --value [duration]
    ```
274

275
* __nnictl update trialnum__
276
  * Description
277

278
    You can use this command to update an experiment's maxtrialnum.
279

280
  * Usage
281

282
283
284
    ```bash
    nnictl update trialnum [OPTIONS]
    ```
285

286
  * Options
287

288
289
290
291
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
  |--value, -v|  True| |the new number of maxtrialnum you want to set|
292

293
  * Example
294

295
    > update experiment's trial num
296

297
    ```bash
Junwei Sun's avatar
Junwei Sun committed
298
    nnictl update trialnum [experiment_id] --value [trial_num]
299
    ```
300

301
<a name="trial"></a>
Tab Zhang's avatar
Tab Zhang committed
302
### nnictl trial
Chi Song's avatar
Chi Song committed
303

304
* __nnictl trial ls__
Chi Song's avatar
Chi Song committed
305

306
  * Description
Chi Song's avatar
Chi Song committed
307

308
    You can use this command to show trial's information. Note that if `head` or `tail` is set, only complete trials will be listed.
Chi Song's avatar
Chi Song committed
309

310
  * Usage
311

312
313
    ```bash
    nnictl trial ls
314
315
    nnictl trial ls --head 10
    nnictl trial ls --tail 10
316
    ```
QuanluZhang's avatar
QuanluZhang committed
317

318
  * Options
Chi Song's avatar
Chi Song committed
319

320
321
322
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
323
324
  |--head|False||the number of items to be listed with the highest default metric|
  |--tail|False||the number of items to be listed with the lowest default metric|
SparkSnail's avatar
SparkSnail committed
325

326
* __nnictl trial kill__
327

328
  * Description
329

330
    You can use this command to kill a trial job.
331

332
  * Usage
333

334
335
336
    ```bash
    nnictl trial kill [OPTIONS]
    ```
337

338
  * Options
339

340
341
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
342
343
  |id|  False| |Experiment ID of the trial|
  |--trial_id, -T|  True| |ID of the trial you want to kill.|
344

345
  * Example
346

347
    > kill trail job
348

349
    ```bash
Junwei Sun's avatar
Junwei Sun committed
350
    nnictl trial kill [experiment_id] --trial_id [trial_id]
351
352
    ```

Yan Ni's avatar
Yan Ni committed
353
<a name="top"></a>
354

Tab Zhang's avatar
Tab Zhang committed
355
### nnictl top
SparkSnail's avatar
SparkSnail committed
356

357
* Description
358

359
  Monitor all of running experiments.
360

361
* Usage
362

363
364
365
  ```bash
  nnictl top
  ```
366

367
* Options
368

Chi Song's avatar
Chi Song committed
369
370
371
372
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
  |--time, -t|  False| |The interval to update the experiment status, the unit of time is second, and the default value is 3 second.|
373

Yan Ni's avatar
Yan Ni committed
374
<a name="experiment"></a>
Tab Zhang's avatar
Tab Zhang committed
375
### Manage experiment information
QuanluZhang's avatar
QuanluZhang committed
376
377

* __nnictl experiment show__
Chi Song's avatar
Chi Song committed
378

QuanluZhang's avatar
QuanluZhang committed
379
  * Description
SparkSnail's avatar
SparkSnail committed
380

Chi Song's avatar
Chi Song committed
381
382
383
384
385
386
387
388
    Show the information of experiment.

  * Usage

    ```bash
    nnictl experiment show
    ```

389
  * Options
Chi Song's avatar
Chi Song committed
390

Chi Song's avatar
Chi Song committed
391
392
393
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
SparkSnail's avatar
SparkSnail committed
394
395

* __nnictl experiment status__
Chi Song's avatar
Chi Song committed
396

SparkSnail's avatar
SparkSnail committed
397
398
  * Description

Chi Song's avatar
Chi Song committed
399
400
401
402
403
404
405
406
    Show the status of experiment.

  * Usage

    ```bash
    nnictl experiment status
    ```

407
  * Options
Chi Song's avatar
Chi Song committed
408

Chi Song's avatar
Chi Song committed
409
410
411
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
SparkSnail's avatar
SparkSnail committed
412
413

* __nnictl experiment list__
414

SparkSnail's avatar
SparkSnail committed
415
  * Description
QuanluZhang's avatar
QuanluZhang committed
416

Chi Song's avatar
Chi Song committed
417
418
419
    Show the information of all the (running) experiments.

  * Usage
420

Chi Song's avatar
Chi Song committed
421
    ```bash
SparkSnail's avatar
SparkSnail committed
422
    nnictl experiment list [OPTIONS]
Chi Song's avatar
Chi Song committed
423
    ```
SparkSnail's avatar
SparkSnail committed
424
425
426
427
428
429
  
  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |--all|  False| |list all of experiments|
Chi Song's avatar
Chi Song committed
430

SparkSnail's avatar
SparkSnail committed
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
* __nnictl experiment delete__

  * Description

    Delete one or all experiments, it includes log, result, environment information and cache. It uses to delete useless experiment result, or save disk space.

  * Usage

    ```bash
    nnictl experiment delete [OPTIONS]
    ```
  
  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment|
SparkSnail's avatar
SparkSnail committed
448
  |--all|  False| |delete all of experiments|
SparkSnail's avatar
SparkSnail committed
449
450


451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
* __nnictl experiment export__
  * Description

    You can use this command to export reward & hyper-parameter of trial jobs to a csv file.

  * Usage

    ```bash
    nnictl experiment export [OPTIONS]
    ```

  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment    |
467
  |--filename, -f|  True| |File path of the output file     |
468
  |--type|  True| |Type of output file, only support "csv" and "json"|
469
  |--intermediate, -i|False||Are intermediate results included|
470
471
472
473
474
475

  * Examples

  > export all trial data in an experiment as json format

  ```bash
476
  nnictl experiment export [experiment_id] --filename [file_path] --type json --intermediate
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
  ```

* __nnictl experiment import__
  * Description

    You can use this command to import several prior or supplementary trial hyperparameters & results for NNI hyperparameter tuning. The data are fed to the tuning algorithm (e.g., tuner or advisor).

  * Usage

    ```bash
    nnictl experiment import [OPTIONS]
    ```

  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------|------|
  |id|  False| |The id of the experiment you want to import data into|
495
  |--filename, -f|  True| |a file with data you want to import in json format|
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512

  * Details

    NNI supports users to import their own data, please express the data in the correct format. An example is shown below:

    ```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}
    ]
    ```

    Every element in the top level list is a sample. For our built-in tuners/advisors, each sample should have at least two keys: `parameter` and `value`. The `parameter` must match this experiment's search space, that is, all the keys (or hyperparameters) in `parameter` must match the keys in the search space. Otherwise, tuner/advisor may have unpredictable behavior. `Value` should follow the same rule of the input in `nni.report_final_result`, that is, either a number or a dict with a key named `default`. For your customized tuner/advisor, the file could have any json content depending on how you implement the corresponding methods (e.g., `import_data`).

    You also can use [nnictl experiment export](#export) to export a valid json file including previous experiment trial hyperparameters and results.

Chi Song's avatar
Chi Song committed
513
    Currently, following tuner and advisor support import data:
514

515
    ```yaml
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
    builtinTunerName: TPE, Anneal, GridSearch, MetisTuner
    builtinAdvisorName: BOHB
    ```

    *If you want to import data to BOHB advisor, user are suggested to add "TRIAL_BUDGET" in parameter as NNI do, otherwise, BOHB will use max_budget as "TRIAL_BUDGET". Here is an example:*

    ```json
    [
      {"parameter": {"x": 0.5, "y": 0.9, "TRIAL_BUDGET": 27}, "value": 0.03}
    ]
    ```

  * Examples

    > import data to a running experiment

    ```bash
533
    nnictl experiment import [experiment_id] -f experiment_data.json
534
535
    ```

536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
* __nnictl experiment save__
  * Description

    Save nni experiment metadata and code data.

  * Usage

    ```bash
    nnictl experiment save [OPTIONS]
    ```

  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  True| |The id of the experiment you want to save|
  |--path, -p|  False| |the folder path to store nni experiment data, default current working directory|
  |--saveCodeDir, -s| False| |save codeDir data of the experiment, default False|

  * Examples

  > save an expeirment

  ```bash
  nnictl experiment save [experiment_id] --saveCodeDir
  ```

* __nnictl experiment load__
  * Description

    Load an nni experiment.

  * Usage

    ```bash
    nnictl experiment load [OPTIONS]
    ```

  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |--path, -p|  True| |the file path of nni package|
  |--codeDir, -c| True| |the path of codeDir for loaded experiment, this path will also put the code in the loaded experiment package|
  |--logDir, -l| False| |the path of logDir for loaded experiment|

  * Examples

  > load an expeirment

  ```bash
  nnictl experiment load --path [path] --codeDir [codeDir]
  ```



SparkSnail's avatar
SparkSnail committed
592
<a name="platform"></a>
Tab Zhang's avatar
Tab Zhang committed
593
### Manage platform information
SparkSnail's avatar
SparkSnail committed
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617

* __nnictl platform clean__

  * Description

    It uses to clean up disk on a target platform. The provided YAML file includes the information of target platform, and it follows the same schema as the NNI configuration file.

  * Note
   
    if the target platform is being used by other users, it may cause unexpected errors to others.

  * Usage

    ```bash
    nnictl platform clean [OPTIONS]
    ```

  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |--config|  True| |the path of yaml config file used when create an experiment|


Yan Ni's avatar
Yan Ni committed
618
<a name="config"></a>
Tab Zhang's avatar
Tab Zhang committed
619
### nnictl config show
620

621
* Description
622

623
  Display the current context information.
624

625
* Usage
626

627
628
629
  ```bash
  nnictl config show
  ```
630

Yan Ni's avatar
Yan Ni committed
631
<a name="log"></a>
632

Tab Zhang's avatar
Tab Zhang committed
633
### Manage log
Chi Song's avatar
Chi Song committed
634

QuanluZhang's avatar
QuanluZhang committed
635
* __nnictl log stdout__
Chi Song's avatar
Chi Song committed
636
637
638
639
640
641
642
643
644
645
646

  * Description

    Show the stdout log content.

  * Usage

    ```bash
    nnictl log stdout [options]
    ```

647
  * Options
Chi Song's avatar
Chi Song committed
648

Chi Song's avatar
Chi Song committed
649
650
651
652
653
654
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
  |--head, -h| False| |show head lines of stdout|
  |--tail, -t|  False| |show tail lines of stdout|
  |--path, -p|  False| |show the path of stdout file|
Chi Song's avatar
Chi Song committed
655

656
657
658
659
660
661
662
663
  * Example

    > Show the tail of stdout log content

    ```bash
    nnictl log stdout [experiment_id] --tail [lines_number]
    ```

QuanluZhang's avatar
QuanluZhang committed
664
665
* __nnictl log stderr__
  * Description
Chi Song's avatar
Chi Song committed
666
667

    Show the stderr log content.
668

QuanluZhang's avatar
QuanluZhang committed
669
  * Usage
Chi Song's avatar
Chi Song committed
670
671
672
673
674

    ```bash
    nnictl log stderr [options]
    ```

675
  * Options
Chi Song's avatar
Chi Song committed
676

Chi Song's avatar
Chi Song committed
677
678
679
680
681
682
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
  |--head, -h| False| |show head lines of stderr|
  |--tail, -t|  False| |show tail lines of stderr|
  |--path, -p|  False| |show the path of stderr file|
683
684

* __nnictl log trial__
685

686
  * Description
687

Chi Song's avatar
Chi Song committed
688
    Show trial log path.
689

690
  * Usage
SparkSnail's avatar
SparkSnail committed
691

692
    ```bash
693
694
695
696
697
    nnictl log trial [options]
    ```

  * Options

Chi Song's avatar
Chi Song committed
698
699
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
700
701
  |id|  False| |Experiment ID of the trial|
  |--trial_id, -T|  False| |ID of the trial to be found the log path, required when id is not empty.|
702

Yan Ni's avatar
Yan Ni committed
703
<a name="webui"></a>
Tab Zhang's avatar
Tab Zhang committed
704
### Manage webui
Chi Song's avatar
Chi Song committed
705

SparkSnail's avatar
SparkSnail committed
706
* __nnictl webui url__
Junwei Sun's avatar
Junwei Sun committed
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
  * Description

    Show an experiment's webui url

  * Usage

    ```bash
    nnictl webui url [options]
    ```

  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |Experiment ID|
SparkSnail's avatar
SparkSnail committed
722

Yan Ni's avatar
Yan Ni committed
723
<a name="tensorboard"></a>
Tab Zhang's avatar
Tab Zhang committed
724
### Manage tensorboard
Chi Song's avatar
Chi Song committed
725

SparkSnail's avatar
SparkSnail committed
726
* __nnictl tensorboard start__
Chi Song's avatar
Chi Song committed
727
728
729
730

  * Description

    Start the tensorboard process.
731

Chi Song's avatar
Chi Song committed
732
733
734
735
736
737
  * Usage

    ```bash
    nnictl tensorboard start
    ```

738
  * Options
Chi Song's avatar
Chi Song committed
739

Chi Song's avatar
Chi Song committed
740
741
742
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
743
  |--trial_id, -T|  False| |ID of the trial|
Chi Song's avatar
Chi Song committed
744
  |--port|  False| 6006|The port of the tensorboard process|
Chi Song's avatar
Chi Song committed
745
746
747

  * Detail

748
749
    1. NNICTL support tensorboard function in local and remote platform for the moment, other platforms will be supported later.
    2. If you want to use tensorboard, you need to write your tensorboard log data to environment variable [NNI_OUTPUT_DIR] path.
Chi Song's avatar
Chi Song committed
750
751
    3. In local mode, nnictl will set --logdir=[NNI_OUTPUT_DIR] directly and start a tensorboard process.
    4. In remote mode, nnictl will create a ssh client to copy log data from remote machine to local temp directory firstly, and then start a tensorboard process in your local machine. You need to notice that nnictl only copy the log data one time when you use the command, if you want to see the later result of tensorboard, you should execute nnictl tensorboard command again.
752
    5. If there is only one trial job, you don't need to set trial id. If there are multiple trial jobs running, you should set the trial id, or you could use [nnictl tensorboard start --trial_id all] to map --logdir to all trial log paths.
SparkSnail's avatar
SparkSnail committed
753
754

* __nnictl tensorboard stop__
755
756
  * Description

757
    Stop all of the tensorboard process.
758
759
760
761
762
763
764
765
766

  * Usage

    ```bash
    nnictl tensorboard stop
    ```

  * Options

Chi Song's avatar
Chi Song committed
767
768
769
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |id|  False| |ID of the experiment you want to set|
Yan Ni's avatar
Yan Ni committed
770
771

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

Tab Zhang's avatar
Tab Zhang committed
773
### Manage package
774

Yan Ni's avatar
Yan Ni committed
775
* __nnictl package install__
776
777
  * Description

chicm-ms's avatar
chicm-ms committed
778
    Install a package (customized algorithms or nni provided algorithms) as builtin tuner/assessor/advisor.
779
780
781
782

  * Usage

    ```bash
chicm-ms's avatar
chicm-ms committed
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
    nnictl package install --name <package name>
    ```

    The available `<package name>` can be checked via `nnictl package list` command.

    or

    ```bash
    nnictl package install <installation source>
    ```

    Reference [Install customized algorithms](InstallCustomizedAlgos.md) to prepare the installation source.

  * Example

    > Install SMAC tuner

    ```bash
    nnictl package install --name SMAC
    ```

    > Install a customized tuner

    ```bash
    nnictl package install nni/examples/tuners/customized_tuner/dist/demo_tuner-0.1-py3-none-any.whl
    ```


* __nnictl package show__

  * Description

    Show the detailed information of specified packages.

  * Usage

    ```bash
    nnictl package show <package name>
    ```

  * Example

    ```bash
    nnictl package show SMAC
    ```

* __nnictl package list__
  * Description

    List the installed/all packages.

  * Usage

    ```bash
    nnictl package list [OPTIONS]
838
839
840
841
    ```

  * Options

Chi Song's avatar
Chi Song committed
842
843
  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
chicm-ms's avatar
chicm-ms committed
844
  |--all|  False| |List all packages|
Yan Ni's avatar
Yan Ni committed
845

846
847
  * Example

chicm-ms's avatar
chicm-ms committed
848
    > List installed packages
849
850

    ```bash
chicm-ms's avatar
chicm-ms committed
851
    nnictl package list
852
853
    ```

chicm-ms's avatar
chicm-ms committed
854
855
856
857
858
859
860
    > List all packages

    ```bash
    nnictl package list --all
    ```

* __nnictl package uninstall__
861
862
863

  * Description

chicm-ms's avatar
chicm-ms committed
864
    Uninstall a package.
865
866
867
868

  * Usage

    ```bash
chicm-ms's avatar
chicm-ms committed
869
    nnictl package uninstall <package name>
870
871
    ```

chicm-ms's avatar
chicm-ms committed
872
873
874
875
876
877
878
879
  * Example
    Uninstall SMAC package

    ```bash
    nnictl package uninstall SMAC
    ```


880
881
<a name="ss_gen"></a>

Tab Zhang's avatar
Tab Zhang committed
882
### Generate search space
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910

* __nnictl ss_gen__
  * Description

    Generate search space from user trial code which uses NNI NAS APIs.

  * Usage

    ```bash
    nnictl ss_gen [OPTIONS]
    ```

  * Options

  |Name, shorthand|Required|Default|Description|
  |------|------|------ |------|
  |--trial_command|  True| |The command of the trial code|
  |--trial_dir|  False| ./ |The directory of the trial code|
  |--file|  False| nni_auto_gen_search_space.json |The file for storing generated search space|

  * Example

    > Generate a search space

    ```bash
    nnictl ss_gen --trial_command="python3 mnist.py" --trial_dir=./ --file=ss.json
    ```

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

Tab Zhang's avatar
Tab Zhang committed
913
### Check NNI version
914
915
916
917
918
919
920
921
922
923
924

* __nnictl --version__

  * Description

    Describe the current version of NNI installed.

  * Usage

    ```bash
    nnictl --version
925
    ```