Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Update Windows local mode doc (#1019)
Browse files Browse the repository at this point in the history
Update Windows local mode doc
  • Loading branch information
demianzhang authored and chicm-ms committed Apr 28, 2019
1 parent a05db21 commit 2600395
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 25 deletions.
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
NNI (Neural Network Intelligence) is a toolkit to help users run automated machine learning (AutoML) experiments.
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.

### **NNI [v0.6](https://github.com/Microsoft/nni/releases) has been released!**
### **NNI [v0.7](https://github.com/Microsoft/nni/releases) has been released!**
<p align="center">
<a href="#nni-v05-has-been-released"><img src="docs/img/overview.svg" /></a>
</p>
Expand Down Expand Up @@ -100,41 +100,65 @@ Targeting at openness and advancing state-of-art technology, [Microsoft Research
We encourage researchers and students leverage these projects to accelerate the AI development and research.

## **Install & Verify**
If you choose NNI Windows local mode and you use powershell to run script for the first time, you need to **run powershell as administrator** with this command first:
```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```

**Install through pip**
* We support Linux and MacOS in current stage, Ubuntu 16.04 or higher, along with MacOS 10.14.1 are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`.
* We support Linux, MacOS and Windows(local 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`.

Linux and MacOS
```bash
python3 -m pip install --upgrade nni
```
Windows
```bash
python -m pip install --upgrade nni
```
Note:

* `--user` can be added if you want to install NNI in your home directory, which does not require any special privileges.
* Currently NNI on Windows only support local mode. Anaconda is highly recommanded to install NNI on Windows.
* If there is any error like `Segmentation fault`, please refer to [FAQ](docs/en_US/FAQ.md)

**Install through source code**
* We support Linux (Ubuntu 16.04 or higher), MacOS (10.14.1) in our current stage.
* We support Linux (Ubuntu 16.04 or higher), MacOS (10.14.1) and Windows local mode (10.1809) in our current stage.

Linux and MacOS
* Run the following commands in an environment that has `python >= 3.5`, `git` and `wget`.
```bash
git clone -b v0.6 https://github.com/Microsoft/nni.git
git clone -b v0.7 https://github.com/Microsoft/nni.git
cd nni
source install.sh
```

For the system requirements of NNI, please refer to [Install NNI](docs/en_US/Installation.md)
Windows
* Run the following commands in an environment that has `python >=3.5`, `git` and `powershell`
```bash
git clone -b v0.7 https://github.com/Microsoft/nni.git
cd nni
powershell ./install.ps1
```
For the system requirements of NNI, please refer to [Install NNI](docs/en_US/Installation.md)
For NNI Windows local mode, please refer to [NNI Windows local mode](docs/en_US/WindowsLocalMode.md)

**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
git clone -b v0.6 https://github.com/Microsoft/nni.git
git clone -b v0.7 https://github.com/Microsoft/nni.git
```
Linux and MacOS
* Run the mnist example.
```bash
nnictl create --config nni/examples/trials/mnist/config.yml
```

Windows
* Run the mnist example.
```bash
nnictl create --config nni/examples/trials/mnist/config_windows.yml
```
* 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`.

```
Expand Down
26 changes: 13 additions & 13 deletions docs/en_US/Installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation of NNI

Currently we support installation on Linux, Mac and Windows.
Currently we support installation on Linux, Mac and Windows(local mode).

## **Installation on Linux & Mac**

Expand All @@ -15,7 +15,7 @@ Currently we support installation on Linux, Mac and Windows.

Prerequisite: `python >=3.5`, `git`, `wget`
```bash
git clone -b v0.6 https://github.com/Microsoft/nni.git
git clone -b v0.7 https://github.com/Microsoft/nni.git
cd nni
./install.sh
```
Expand All @@ -24,25 +24,25 @@ Currently we support installation on Linux, Mac and Windows.

You can also install NNI in a docker image. Please follow the instructions [here](https://github.com/Microsoft/nni/tree/master/deployment/docker/README.md) to build NNI docker image. The NNI docker image can also be retrieved from Docker Hub through the command `docker pull msranni/nni:latest`.

## **Installation on Windows**

## **Installation on Windows**
When you use powershell to run script for the first time, you need **run powershell as administrator** with this command:
```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```
Anaconda is highly recommanded.
* __Install NNI through pip__

Prerequisite: `python >= 3.5`
Prerequisite: `python(64-bit) >= 3.5`
```bash
python -m pip install --upgrade nni
```

* __Install NNI through source code__

Prerequisite: `python >=3.5`, `git`, `powershell`
When you use powershell to run script for the first time, you need run powershell as Administrator with this command:
```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```
Then you can install nni as administrator or current user as follows:
you can install nni as administrator or current user as follows:
```bash
git clone https://github.com/Microsoft/nni.git
git clone -b v0.7 https://github.com/Microsoft/nni.git
cd nni
powershell ./install.ps1
```
Expand Down Expand Up @@ -73,7 +73,7 @@ Below are the minimum system requirements for NNI on macOS. Due to potential pro
|**Internet**|Boardband internet connection|
|**Resolution**|1024 x 768 minimum display resolution|

Below are the minimum system requirements for NNI on Windows. Due to potential programming changes, the minimum system requirements for NNI may change over time.
Below are the minimum system requirements for NNI on Windows, Windows 10.1809 is well tested and recommend. Due to potential programming changes, the minimum system requirements for NNI may change over time.

||Minimum Requirements|Recommended Specifications|
|---|---|---|
Expand All @@ -96,4 +96,4 @@ Below are the minimum system requirements for NNI on Windows. Due to potential p
* [How to run an experiment on multiple machines?](RemoteMachineMode.md)
* [How to run an experiment on OpenPAI?](PAIMode.md)
* [How to run an experiment on Kubernetes through Kubeflow?](KubeflowMode.md)
* [How to run an experiment on Kubernetes through FrameworkController?](FrameworkControllerMode.md)
* [How to run an experiment on Kubernetes through FrameworkController?](FrameworkControllerMode.md)
22 changes: 18 additions & 4 deletions docs/en_US/QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

## Installation

We support Linux and MacOS in current stage, Ubuntu 16.04 or higher and MacOS 10.14.1 are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`.

We support Linux MacOS and Windows(local mode) in current stage, Ubuntu 16.04 or higher, MacOS 10.14.1 and Windows 10.1809 are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`.
#### Linux and MacOS
```bash
python3 -m pip install --upgrade nni
```

#### Windows
```bash
python -m pip install --upgrade nni
```
Note:

* `--user` can be added if you want to install NNI in your home directory, which does not require any special privileges.
* For Linux and MacOS `--user` can be added if you want to install NNI in your home directory, which does not require any special privileges.
* If there is any error like `Segmentation fault`, please refer to [FAQ](FAQ.md)
* For the `system requirements` of NNI, please refer to [Install NNI](Installation.md)

Expand Down Expand Up @@ -124,16 +127,27 @@ trial:
codeDir: .
gpuNum: 0
```
Note:
* **For Windows, you need to change trial command `python3` to `python`**

*Implemented code directory: [config.yml](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/config.yml)*

All the codes above are already prepared and stored in [examples/trials/mnist/](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist).

If you choose Windows local mode and use powershell to run script for the first time, you need run powershell as administrator with this command
```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```
When these things are done, **run the config.yml file from your command line to start the experiment**.

```bash
nnictl create --config nni/examples/trials/mnist/config.yml
```
If you use windows local mode and forget to change the trial command `python3` to `python` in config.yml, **then run the config_windows.yml file from your command line to start the experiment**.

```bash
nnictl create --config nni/examples/trials/mnist/config_windows.yml
```

Note: **nnictl** is a command line tool, which can be used to control experiments, such as start/stop/resume an experiment, start/stop NNIBoard, etc. Click [here](NNICTLDOC.md) for more usage of `nnictl`

Expand Down
68 changes: 68 additions & 0 deletions docs/en_US/WindowsLocalMode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Windows Local Mode (experimental feature)
Currently we only support local mode on Windows. Windows 10.1809 is well tested and recommended.

## **Installation on Windows**

**Anaconda python(64-bit) is highly recommended.**

When you use powershell to run script for the first time, you need **run powershell as administrator** with this command:
```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```

* __Install NNI through pip__

Prerequisite: `python(64-bit) >= 3.5`
```bash
python -m pip install --upgrade nni
```

* __Install NNI through source code__

Prerequisite: `python >=3.5`, `git`, `powershell`
```bash
git clone -b v0.7 https://github.com/Microsoft/nni.git
cd nni
powershell ./install.ps1
```

When these things are done, run the **config_windows.yml** file from your command line to start the experiment.

```bash
nnictl create --config nni/examples/trials/mnist/config_windows.yml
```
For other examples you need to change trial command `python3` into `python` in each example yaml.

## **Frequent met errors and answers**

### simplejson failed when installing nni
Make sure C++ 14.0 compiler installed.
>builging 'simplejson._speedups' extension error: [WinError 3] The system cannot find the path specified
### Fail to run powershell when install nni from source
If you run powershell script for the first time and did not set the execution policies for executing the script, you will meet this error below. Try to run powershell as administrator with this command first:
```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```
>...cannot be loaded because running scripts is disabled on this system.
### Trial failed with missing DLL in cmd or powershell
This error caused by missing LIBIFCOREMD.DLL and LIBMMD.DLL and fail to install scipy. Anaconda python is highly recommended. If you use official python, make sure you have one of `Visual Studio`, `MATLAB`, `MKL` and `Intel Distribution for Python` installed on Windows before running nni. If not, try to install one of the softwares above or change to use Anaconda python(64-bit).
>ImportError: DLL load failed
### Trial failed on webUI
Please check the trial log file stderr for more details. If there is no such file and nni is installed through pip, then you need to run powershell as administrator with this command first:
```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```
If there is a stderr file, please check out. Two possible cases are as follows:
* forget to change the trial command `python3` into `python` in each experiment yaml.
* forget to install experiment dependencies such as tensorflow, keras and so on.

### Support tuner on Windows
* SMAC is not supported
* BOHB is supported, make sure C++ 14.0 compiler and dependencies installed successfully.

Note:

* If there is any error like `Segmentation fault`, please refer to [FAQ](FAQ.md)
21 changes: 21 additions & 0 deletions examples/trials/mnist/config_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
authorName: default
experimentName: example_mnist
trialConcurrency: 1
maxExecDuration: 1h
maxTrialNum: 10
#choice: local, remote, pai
trainingServicePlatform: local
searchSpacePath: search_space.json
#choice: true, false
useAnnotation: false
tuner:
#choice: TPE, Random, Anneal, Evolution, BatchTuner, MetisTuner
#SMAC (SMAC should be installed through nnictl)
builtinTunerName: TPE
classArgs:
#choice: maximize, minimize
optimize_mode: maximize
trial:
command: python mnist.py
codeDir: .
gpuNum: 0

0 comments on commit 2600395

Please sign in to comment.