Skip to content

Commit

Permalink
update nnicli (microsoft#2713)
Browse files Browse the repository at this point in the history
(cherry picked from commit f82ef62)
  • Loading branch information
JunweiSUN authored and LovPe committed Aug 14, 2020
1 parent c313248 commit f7c6ef3
Show file tree
Hide file tree
Showing 10 changed files with 520 additions and 101 deletions.
2 changes: 1 addition & 1 deletion docs/en_US/Tutorial/Nnictl.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Debug mode will disable version check function in Trialkeeper.
|Name, shorthand|Required|Default|Description|
|------|------|------ |------|
|id| False| |ID of the experiment you want to set|
|--value, -v| True| |the experiment duration will be NUMBER seconds. SUFFIX may be 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days.|
|--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.|
* Example
Expand Down
1 change: 1 addition & 0 deletions docs/en_US/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('../../src/sdk/pynni'))
sys.path.insert(1, os.path.abspath('../../src/sdk/pycli'))


# -- Project information ---------------------------------------------------
Expand Down
41 changes: 41 additions & 0 deletions docs/en_US/nnicli_ref.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# NNI Client

NNI client is a python API of `nnictl`, which implements the most commonly used commands. Users can use this API to control their experiments, collect experiment results and conduct advanced analyses based on experiment results in python code directly instead of using command line. Here is an example:

```
from nnicli import Experiment
# create an experiment instance
exp = Experiment()
# start an experiment, then connect the instance to this experiment
# you can also use `resume_experiment`, `view_experiment` or `connect_experiment`
# only one of them should be called in one instance
exp.start_experiment('nni/examples/trials/mnist-pytorch/config.yml', port=9090)
# update the experiment's concurrency
exp.update_concurrency(3)
# get some information about the experiment
print(exp.get_experiment_status())
print(exp.get_job_statistics())
print(exp.list_trial_jobs())
# stop the experiment, then disconnect the instance from the experiment.
exp.stop_experiment()
```

## References

```eval_rst
.. autoclass:: nnicli.Experiment
:members:
.. autoclass:: nnicli.TrialJob
:members:
.. autoclass:: nnicli.TrialHyperParameters
:members:
.. autoclass:: nnicli.TrialMetricData
:members:
.. autoclass:: nnicli.TrialResult
:members:
```
3 changes: 2 additions & 1 deletion docs/en_US/sdk_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Python API Reference

Auto Tune <autotune_ref>
NAS <NAS/NasReference>
Compression Utilities <Compressor/CompressionReference>
Compression Utilities <Compressor/CompressionReference>
NNI Client <nnicli_ref>
Loading

0 comments on commit f7c6ef3

Please sign in to comment.