README.md 17.4 KB
Newer Older
1
<p align="center">
2
<img src="docs/img/nni_logo.png" width="300"/>
3
4
5
</p>

-----------
6

7
[![MIT licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
8
[![Build Status](https://msrasrg.visualstudio.com/NNIOpenSource/_apis/build/status/Microsoft.nni)](https://msrasrg.visualstudio.com/NNIOpenSource/_build/latest?definitionId=6)
Gems Guo's avatar
Gems Guo committed
9
10
11
[![Issues](https://img.shields.io/github/issues-raw/Microsoft/nni.svg)](https://github.com/Microsoft/nni/issues?q=is%3Aissue+is%3Aopen)
[![Bugs](https://img.shields.io/github/issues/Microsoft/nni/bug.svg)](https://github.com/Microsoft/nni/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
[![Pull Requests](https://img.shields.io/github/issues-pr-raw/Microsoft/nni.svg)](https://github.com/Microsoft/nni/pulls?q=is%3Apr+is%3Aopen)
The Gitter Badger's avatar
The Gitter Badger committed
12
[![Version](https://img.shields.io/github/release/Microsoft/nni.svg)](https://github.com/Microsoft/nni/releases) [![Join the chat at https://gitter.im/Microsoft/nni](https://badges.gitter.im/Microsoft/nni.svg)](https://gitter.im/Microsoft/nni?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Yan Ni's avatar
Yan Ni committed
13
[![Documentation Status](https://readthedocs.org/projects/nni/badge/?version=latest)](https://nni.readthedocs.io/en/latest/?badge=latest)
Microsoft Open Source's avatar
Microsoft Open Source committed
14

15
[简体中文](README_zh_CN.md)
Chi Song's avatar
Chi Song committed
16

17
NNI (Neural Network Intelligence) is a toolkit to help users run automated machine learning (AutoML) experiments.
Irene Tenison's avatar
Irene Tenison committed
18
The tool dispatches and runs trial jobs generated by tuning algorithms to search the best neural architecture and/or hyper-parameters in different environments like local machine, remote servers and cloud.
19

20

rabbit008's avatar
rabbit008 committed
21
### **NNI [v1.0](https://github.com/Microsoft/nni/blob/master/docs/en_US/Release_v1.0.md) has been released! &nbsp;<a href="#nni-released-reminder"><img width="48" src="docs/img/release_icon.png"></a>**
22

QuanluZhang's avatar
QuanluZhang committed
23
<p align="center">
Lijiao's avatar
Lijiao committed
24
  <a href="#nni-has-been-released"><img src="docs/img/overview.svg" /></a>
QuanluZhang's avatar
QuanluZhang committed
25
</p>
26

QuanluZhang's avatar
QuanluZhang committed
27
28
<table>
  <tbody>
29
    <tr align="center" valign="bottom">
30
31
    <td>
      </td>
QuanluZhang's avatar
QuanluZhang committed
32
      <td>
33
        <b>Frameworks & Libraries</b>
34
        <img src="docs/img/bar.png"/>
QuanluZhang's avatar
QuanluZhang committed
35
36
      </td>
      <td>
37
        <b>Tuning Algorithms</b>
38
        <img src="docs/img/bar.png"/>
QuanluZhang's avatar
QuanluZhang committed
39
40
      </td>
      <td>
Gems's avatar
Gems committed
41
        <b>Training Services</b>
42
        <img src="docs/img/bar.png"/>
QuanluZhang's avatar
QuanluZhang committed
43
44
      </td>
    </tr>
45
    </tr>
QuanluZhang's avatar
QuanluZhang committed
46
    <tr valign="top">
47
48
49
    <td align="center" valign="middle">
    <b>Built-in</b>
      </td>
QuanluZhang's avatar
QuanluZhang committed
50
      <td>
51
      <ul><li><b>Supported Frameworks</b></li>
52
53
54
        <ul>
          <li>PyTorch</li>
          <li>Keras</li>
55
          <li>TensorFlow</li>
56
57
          <li>MXNet</li>
          <li>Caffe2</li>
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
          <a href="docs/en_US/SupportedFramework_Library.md">More...</a><br/>
        </ul>
        </ul>
      <ul>
        <li><b>Supported Libraries</b></li>
          <ul>
           <li>Scikit-learn</li>
           <li>XGBoost</li>
           <li>LightGBM</li>
           <a href="docs/en_US/SupportedFramework_Library.md">More...</a><br/>
          </ul>
      </ul>
        <ul>
        <li><b>Examples</b></li>
         <ul>
Guoxin's avatar
Guoxin committed
73
74
           <li><a href="examples/trials/mnist-pytorch">MNIST-pytorch</li></a>
           <li><a href="examples/trials/mnist">MNIST-tensorflow</li></a>
75
76
77
78
79
80
           <li><a href="examples/trials/mnist-keras">MNIST-keras</li></a>
           <li><a href="docs/en_US/TrialExample/GbdtExample.md">Auto-gbdt</a></li>
           <li><a href="docs/en_US/TrialExample/Cifar10Examples.md">Cifar10-pytorch</li></a>
           <li><a href="docs/en_US/TrialExample/SklearnExamples.md">Scikit-learn</a></li>
              <a href="docs/en_US/SupportedFramework_Library.md">More...</a><br/>
          </ul>
QuanluZhang's avatar
QuanluZhang committed
81
82
        </ul>
      </td>
83
      <td align="left" >
84
        <a href="docs/en_US/Tuner/BuiltinTuner.md">Tuner</a>
QuanluZhang's avatar
QuanluZhang committed
85
        <ul>
86
87
          <li><b>General Tuner</b></li>
          <ul>
88
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#Random">Random Search</a></li>
89
90
91
92
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#Evolution">Naïve Evolution</a></li>
          </ul>    
          <li><b>Tuner for <a href="docs/en_US/CommunitySharings/HpoComparision.md">HPO</a></b></li>
          <ul>
93
94
95
96
97
98
99
100
101
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#TPE">TPE</a></li>
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#Anneal">Anneal</a></li>
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#SMAC">SMAC</a></li>
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#Batch">Batch</a></li>
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#GridSearch">Grid Search</a></li>
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#Hyperband">Hyperband</a></li>
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#MetisTuner">Metis Tuner</a></li>
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#BOHB">BOHB</a></li>
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#GPTuner">GP Tuner</a></li>
102
          </ul>
rabbit008's avatar
rabbit008 committed
103
          <li><b>Tuner for <a href="docs/en_US/AdvancedFeature/GeneralNasInterfaces.md">NAS</a></b></li>
104
          <ul>
105
106
107
          <li><a href="docs/en_US/Tuner/BuiltinTuner.md#NetworkMorphism">Network Morphism</a></li>
          <li><a href="examples/tuners/enas_nni/README.md">ENAS</a></li>
          </ul>
108
        </ul>
109
          <a href="docs/en_US/Assessor/BuiltinAssessor.md">Assessor</a>
110
          <ul>
111
          <ul>
112
113
          <li><a href="docs/en_US/Assessor/BuiltinAssessor.md#Medianstop">Median Stop</a></li>
          <li><a href="docs/en_US/Assessor/BuiltinAssessor.md#Curvefitting">Curve Fitting</a></li>   
114
          </ul>
115
          </ul>  
QuanluZhang's avatar
QuanluZhang committed
116
117
118
      </td>
      <td>
      <ul>
119
120
121
122
123
124
125
        <li><a href="docs/en_US/TrainingService/LocalMode.md">Local Machine</a></li>
        <li><a href="docs/en_US/TrainingService/RemoteMachineMode.md">Remote Servers</a></li>
        <li><b>Kubernetes based services</b></li>
            <ul><li><a href="docs/en_US/TrainingService/PaiMode.md">OpenPAI</a></li>
            <li><a href="docs/en_US/TrainingService/KubeflowMode.md">Kubeflow</a></li>
            <li><a href="docs/en_US/TrainingService/FrameworkControllerMode.md">FrameworkController on K8S (AKS etc.)</a></li>
            </ul>
QuanluZhang's avatar
QuanluZhang committed
126
127
      </ul>
      </td>
128
    </tr> 
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
      <tr align="center" valign="bottom">
      </td>
      </tr>
      <tr valign="top">
       <td valign="middle">
    <b>References</b>
      </td>
     <td style="border-top:#FF0000 solid 0px;">
      <ul>
        <li><a href="docs/en_US/sdk_reference.rst">Python API</a></li>
        <li><a href="docs/en_US/Tutorial/AnnotationSpec.md">NNI Annotation</a></li>
         <li><a href="docs/en_US/Tutorial/Installation.md">Supported OS</a></li>
      </ul>
      </td>
       <td style="border-top:#FF0000 solid 0px;">
      <ul>
        <li><a href="docs/en_US/Tuner/CustomizeTuner.md">CustomizeTuner</a></li>
        <li><a href="docs/en_US/Assessor/CustomizeAssessor.md">CustomizeAssessor</a></li>
      </ul>
      </td>
        <td style="border-top:#FF0000 solid 0px;">
      <ul>
        <li><a href="docs/en_US/TrainingService/SupportTrainingService.md">Support TrainingService</li>
        <li><a href="docs/en_US/TrainingService/HowToImplementTrainingService.md">Implement TrainingService</a></li>
      </ul>
      </td>     
    </tr> 
QuanluZhang's avatar
QuanluZhang committed
156
157
  </tbody>
</table>
158
159


QuanluZhang's avatar
QuanluZhang committed
160

161
162


163
## **Who should consider using NNI**
Chi Song's avatar
Chi Song committed
164

Irene Tenison's avatar
Irene Tenison committed
165
166
167
168
* Those who want to try different AutoML algorithms in their training code (model) at their local machine.
* Those who want to run AutoML trial jobs in different environments to speed up search (e.g. remote servers and cloud).
* Researchers and data scientists who want to implement their own AutoML algorithms and compare it with other algorithms.
* ML Platform owners who want to support AutoML in their platform.
169

170
## Related Projects
Chi Song's avatar
Chi Song committed
171

172
Targeting at openness and advancing state-of-art technology, [Microsoft Research (MSR)](https://www.microsoft.com/en-us/research/group/systems-research-group-asia/) had also released few other open source projects.
Chi Song's avatar
Chi Song committed
173

174
175
176
* [OpenPAI](https://github.com/Microsoft/pai) : an open source platform that provides complete AI model training and resource management capabilities, it is easy to extend and supports on-premise, cloud and hybrid environments in various scale.
* [FrameworkController](https://github.com/Microsoft/frameworkcontroller) : an open source general-purpose Kubernetes Pod Controller that orchestrate all kinds of applications on Kubernetes by a single controller.
* [MMdnn](https://github.com/Microsoft/MMdnn) : A comprehensive, cross-framework solution to convert, visualize and diagnose deep neural network models. The "MM" in MMdnn stands for model management and "dnn" is an acronym for deep neural network.
Scarlett Li's avatar
Scarlett Li committed
177
178
* [SPTAG](https://github.com/Microsoft/SPTAG) : Space Partition Tree And Graph (SPTAG) is an open source library for large scale vector approximate nearest neighbor search scenario.

179
180
We encourage researchers and students leverage these projects to accelerate the AI development and research.

Scarlett Li's avatar
Scarlett Li committed
181
## **Install & Verify**
Chi Song's avatar
Chi Song committed
182

183
**Install through pip**
Chi Song's avatar
Chi Song committed
184

185
* We support Linux, MacOS and Windows (local, remote and pai mode) in current stage, Ubuntu 16.04 or higher, MacOS 10.14.1 along with Windows 10.1809 are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`.
Zejun Lin's avatar
Zejun Lin committed
186

187
Linux and MacOS
Chi Song's avatar
Chi Song committed
188

Zejun Lin's avatar
Zejun Lin committed
189
```bash
Chi Song's avatar
Chi Song committed
190
python3 -m pip install --upgrade nni
191
```
Chi Song's avatar
Chi Song committed
192

193
Windows
Chi Song's avatar
Chi Song committed
194

195
```bash
Chi Song's avatar
Chi Song committed
196
python -m pip install --upgrade nni
197
```
Chi Song's avatar
Chi Song committed
198

Zejun Lin's avatar
Zejun Lin committed
199
200
201
Note:

* `--user` can be added if you want to install NNI in your home directory, which does not require any special privileges.
202
* Currently NNI on Windows support local, remote and pai mode. Anaconda or Miniconda is highly recommended to install NNI on Windows.
203
* If there is any error like `Segmentation fault`, please refer to [FAQ](docs/en_US/Tutorial/FAQ.md)
Gems Guo's avatar
Gems Guo committed
204
205

**Install through source code**
Chi Song's avatar
Chi Song committed
206

207
* We support Linux (Ubuntu 16.04 or higher), MacOS (10.14.1) and Windows (10.1809) in our current stage.
208
209

Linux and MacOS
Chi Song's avatar
Chi Song committed
210

Gems Guo's avatar
Gems Guo committed
211
* Run the following commands in an environment that has `python >= 3.5`, `git` and `wget`.
Chi Song's avatar
Chi Song committed
212
213

```bash
214
    git clone -b v1.0 https://github.com/Microsoft/nni.git
Chi Song's avatar
Chi Song committed
215
216
    cd nni
    source install.sh
217
```
Chi Song's avatar
Chi Song committed
218

219
Windows
Chi Song's avatar
Chi Song committed
220
221
222

* Run the following commands in an environment that has `python >=3.5`, `git` and `PowerShell`

223
```bash
224
  git clone -b v1.0 https://github.com/Microsoft/nni.git
225
  cd nni
226
  powershell -ExecutionPolicy Bypass -file install.ps1
227
```
228

229
For the system requirements of NNI, please refer to [Install NNI](docs/en_US/Tutorial/Installation.md)
Chi Song's avatar
Chi Song committed
230

231
For NNI on Windows, please refer to [NNI on Windows](docs/en_US/Tutorial/NniOnWindows.md)
232

Chi Song's avatar
Chi Song committed
233
234
235
236
237
238
239
**Verify install**

The following example is an experiment built on TensorFlow. Make sure you have **TensorFlow installed** before running it.

* Download the examples via clone the source code.

```bash
240
    git clone -b v1.0 https://github.com/Microsoft/nni.git
Gems Guo's avatar
Gems Guo committed
241
```
Chi Song's avatar
Chi Song committed
242

243
Linux and MacOS
Chi Song's avatar
Chi Song committed
244
245
246

* Run the MNIST example.

247
```bash
Gems Guo's avatar
Gems Guo committed
248
    nnictl create --config nni/examples/trials/mnist/config.yml
249
```
Chi Song's avatar
Chi Song committed
250

251
Windows
Chi Song's avatar
Chi Song committed
252
253
254

* Run the MNIST example.

255
```bash
256
    nnictl create --config nni\examples\trials\mnist\config_windows.yml
257
```
Chi Song's avatar
Chi Song committed
258

259
* Wait for the message `INFO: Successfully started experiment!` in the command line. This message indicates that your experiment has been successfully started. You can explore the experiment using the `Web UI url`.
260

Chi Song's avatar
Chi Song committed
261
```text
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
INFO: Starting restful server...
INFO: Successfully started Restful server!
INFO: Setting local config...
INFO: Successfully set local config!
INFO: Starting experiment...
INFO: Successfully started experiment!
-----------------------------------------------------------------------
The experiment id is egchD4qy
The Web UI urls are: http://223.255.255.1:8080   http://127.0.0.1:8080
-----------------------------------------------------------------------

You can use these commands to get more information about the experiment
-----------------------------------------------------------------------
         commands                       description
1. nnictl experiment show        show the information of experiments
2. nnictl trial ls               list all of trial jobs
SparkSnail's avatar
SparkSnail committed
278
279
280
281
282
283
3. nnictl top                    monitor the status of running experiments
4. nnictl log stderr             show stderr log content
5. nnictl log stdout             show stdout log content
6. nnictl stop                   stop an experiment
7. nnictl trial kill             kill a trial job by id
8. nnictl --help                 get help information about nnictl
284
-----------------------------------------------------------------------
Scarlett Li's avatar
Scarlett Li committed
285
```
Scarlett Li's avatar
Scarlett Li committed
286

287
* Open the `Web UI url` in your browser, you can view detail information of the experiment and all the submitted trial jobs as shown below. [Here](docs/en_US/Tutorial/WebUI.md) are more Web UI pages.
288
289
290
291
292
293

<table style="border: none">
    <th><img src="./docs/img/webui_overview_page.png" alt="drawing" width="395"/></th>
    <th><img src="./docs/img/webui_trialdetail_page.png" alt="drawing" width="410"/></th>
</table>

Scarlett Li's avatar
Scarlett Li committed
294
## **Documentation**
295
296
Our primary documentation is at [here](https://nni.readthedocs.io/en/latest/Overview.html) and is generated from this repository.<br/>
Maybe you want to read:
Chi Song's avatar
Chi Song committed
297

Yan Ni's avatar
Yan Ni committed
298
* [NNI overview](docs/en_US/Overview.md)
299
300
* [Quick start](docs/en_US/Tutorial/QuickStart.md)
* [WebUI tutorial](docs/en_US/Tutorial/WebUI.md)
301
302
* [Contributing](docs/en_US/Tutorial/Contributing.md)

303

Scarlett Li's avatar
Scarlett Li committed
304
## **How to**
Chi Song's avatar
Chi Song committed
305

306
307
* [Install NNI](docs/en_US/Tutorial/Installation.md)
* [Use command line tool nnictl](docs/en_US/Tutorial/Nnictl.md)
308
* [Define a trial](docs/en_US/TrialExample/Trials.md)
309
* [Config an experiment](docs/en_US/Tutorial/ExperimentConfig.md)
310
311
312
313
314
* [Define search space](docs/en_US/Tutorial/SearchSpaceSpec.md)
* [choose tuner/search-algorithm](docs/en_US/Tuner/BuiltinTuner.md)
* [Use annotation](docs/en_US/TrialExample/Trials.md#nni-python-annotation)
* [Use NNIBoard](docs/en_US/Tutorial/WebUI.md)

Chi Song's avatar
Chi Song committed
315

316

Scarlett Li's avatar
Scarlett Li committed
317
## **Tutorials**
Chi Song's avatar
Chi Song committed
318

319
* [Run an experiment on local (with multiple GPUs)](docs/en_US/TrainingService/LocalMode.md)
320
321
322
323
324
* [Run an experiment on OpenPAI](docs/en_US/TrainingService/PaiMode.md)
* [Run an experiment on Kubeflow](docs/en_US/TrainingService/KubeflowMode.md)
* [Run an experiment on multiple machines](docs/en_US/TrainingService/RemoteMachineMode.md)
* [Try different tuners](docs/en_US/Tuner/BuiltinTuner.md)
* [Try different assessors](docs/en_US/Assessor/BuiltinAssessor.md)
325
* [Implement a customized tuner](docs/en_US/Tuner/CustomizeTuner.md)
326
* [Implement a customized assessor](docs/en_US/Assessor/CustomizeAssessor.md)
327
* [Implement TrainingService in NNI](docs/en_US/TrainingService/HowToImplementTrainingService.md)
328
* [Use Genetic Algorithm to find good model architectures for Reading Comprehension task](docs/en_US/TrialExample/SquadEvolutionExamples.md)
329
330
* [Advanced Neural Architecture Search](docs/en_US/AdvancedFeature/AdvancedNas.md)

Scarlett Li's avatar
Scarlett Li committed
331
332

## **Contribute**
333
This project welcomes contributions and there are many ways in which you can participate in the project, for example:
334
335
336
* Open [bug reports](https://github.com/microsoft/nni/issues/new/choose).
* Request a [new feature](https://github.com/microsoft/nni/issues/new/choose).
* Suggest or ask some questions on the [How to Debug](docs/en_US/Tutorial/HowToDebug.md) guidance document.
337
338
* Find the issues tagged with ['good first issue'](https://github.com/Microsoft/nni/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or ['help-wanted'](https://github.com/microsoft/nni/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22), these are simple and easy to start , we recommend new contributors to start with.

339
340
341

Before providing your hacks, you can review the [Contributing Instruction](docs/en_US/Tutorial/Contributing.md) to get more information. In addition, we also provide you with the following documents:
* [NNI developer environment installation tutorial](docs/en_US/Tutorial/SetupNniDeveloperEnvironment.md)
342
* [How to debug](docs/en_US/Tutorial/HowToDebug.md)
343
344
345
346
* [Customize Your Own Advisor](docs/en_US/Tuner/CustomizeAdvisor.md)
* [Customize Your Own Tuner](docs/en_US/Tuner/CustomizeTuner.md)
* [Implement customized TrainingService](docs/en_US/TrainingService/HowToImplementTrainingService.md)

347

rabbit008's avatar
rabbit008 committed
348
349
## **External Repositories and References**
With authors' permission, we listed a set of NNI usage examples and relevant articles.
350
351
352
353
354
355
356
357
358
359
360
361
362
363
* ### **External Repositories** ###
   * Run [ENAS](examples/tuners/enas_nni/README.md) with NNI
   * Run [Neural Network Architecture Search](examples/trials/nas_cifar10/README.md) with NNI 
   * [Automatic Feature Engineering](examples/trials/auto-feature-engineering/README.md) with NNI 
   * [Hyperparameter Tuning for Matrix Factorization](https://github.com/microsoft/recommenders/blob/master/notebooks/04_model_select_and_optimize/nni_surprise_svd.ipynb) with NNI

* ### **Relevant Articles** ###
  
  * [Hyper Parameter Optimization Comparison](docs/en_US/CommunitySharings/HpoComparision.md)
  * [Neural Architecture Search Comparison](docs/en_US/CommunitySharings/NasComparision.md)
  * [Parallelizing a Sequential Algorithm TPE](docs/en_US/CommunitySharings/ParallelizingTpeSearch.md)
  * [Automatically tuning SVD with NNI](docs/en_US/CommunitySharings/RecommendersSvd.md)
  * [Automatically tuning SPTAG with NNI](docs/en_US/CommunitySharings/SptagAutoTune.md)
  * **Blog (in Chinese)** - [AutoML tools (Advisor, NNI and Google Vizier) comparison](http://gaocegege.com/Blog/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/katib-new#%E6%80%BB%E7%BB%93%E4%B8%8E%E5%88%86%E6%9E%90) by [@gaocegege](https://github.com/gaocegege) - 总结与分析 section of design and implementation of kubeflow/katib
364
365

## **Feedback**
366
* Discuss on the NNI [Gitter](https://gitter.im/Microsoft/nni?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) in NNI.
367
* [File an issue](https://github.com/microsoft/nni/issues/new/choose) on GitHub.
368
* Ask a question with NNI tags on [Stack Overflow](https://stackoverflow.com/questions/tagged/nni?sort=Newest&edited=true).
Chi Song's avatar
Chi Song committed
369

Microsoft Open Source's avatar
Microsoft Open Source committed
370

Chi Song's avatar
Chi Song committed
371
372
## **License**

373
The entire codebase is under [MIT license](LICENSE)
374