Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master #163

Merged
merged 16 commits into from
Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ NNI_VERSION_TEMPLATE = 999.0.0-developing
build:
#$(_INFO) Building NNI Manager $(_END)
cd src/nni_manager && $(NNI_YARN) && $(NNI_YARN) build
cp -rf src/nni_manager/config src/nni_manager/dist/
#$(_INFO) Building WebUI $(_END)
cd src/webui && $(NNI_YARN) && $(NNI_YARN) build

Expand Down
7 changes: 4 additions & 3 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包
<li><a href="docs/zh_CN/Builtin_Tuner.md#NetworkMorphism">Network Morphism</a></li>
<li><a href="examples/tuners/enas_nni/README_zh_CN.md">ENAS</a></li>
<li><a href="docs/zh_CN/Builtin_Tuner.md#NetworkMorphism#MetisTuner">Metis Tuner</a></li>
</ul>
<li><a href="docs/zh_CN/Builtin_Tuner.md#BOHB">BOHB</a></li>
</ul>
<a href="docs/zh_CN/Builtin_Assessors.md#assessor">Assessor(评估器)</a>
<ul>
<li><a href="docs/zh_CN/Builtin_Assessors.md#Medianstop">Median Stop</a></li>
Expand All @@ -69,7 +70,7 @@ NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包
</td>
<td>
<ul>
<li><a href="docs/zh_CN/tutorial_1_CR_exp_local_api.md">本地计算机</a></li>
<li><a href="docs/zh_CN/LocalMode.md">本地计算机</a></li>
<li><a href="docs/zh_CN/RemoteMachineMode.md">远程计算机</a></li>
<li><a href="docs/zh_CN/PAIMode.md">OpenPAI</a></li>
<li><a href="docs/zh_CN/KubeflowMode.md">Kubeflow</a></li>
Expand Down Expand Up @@ -193,7 +194,7 @@ NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包

## **教程**

* [在本机运行 Experiment (支持多 GPU 卡)](docs/zh_CN/tutorial_1_CR_exp_local_api.md)
* [在本机运行 Experiment (支持多 GPU 卡)](docs/zh_CN/LocalMode.md)
* [在多机上运行 Experiment](docs/zh_CN/RemoteMachineMode.md)
* [在 OpenPAI 上运行 Experiment](docs/zh_CN/PAIMode.md)
* [在 Kubeflow 上运行 Experiment。](docs/zh_CN/KubeflowMode.md)
Expand Down
43 changes: 43 additions & 0 deletions deployment/deployment-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,46 @@ jobs:
fi
condition: eq( variables['upload_package'], 'true')
displayName: 'upload nni package to pypi/testpypi'

- job: 'Build_upload_nni_windows'
dependsOn: version_number_validation
condition: succeeded()
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python36:
PYTHON_VERSION: '3.6'
steps:
- script: |
python -m pip install --upgrade pip setuptools --user
python -m pip install twine --user
displayName: 'Install twine'

- script: |
cd deployment/pypi
if [ $(build_type) = 'prerelease' ]
then
# NNI build scripts (powershell) uses branch tag as package version number
git tag $(build_version)
echo 'building prerelease package...'
powershell.exe ./install.ps1 -version_ts $True
else
echo 'building release package...'
powershell.exe ./install.ps1
fi
condition: eq( variables['upload_package'], 'true')
displayName: 'build nni bdsit_wheel'

- script: |
cd deployment/pypi
if [ $(build_type) = 'prerelease' ]
then
echo 'uploading prerelease package to testpypi...'
python -m twine upload -u $(testpypi_user) -p $(testpypi_pwd) --repository-url https://test.pypi.org/legacy/ dist/*
else
echo 'uploading release package to pypi...'
python -m twine upload -u $(pypi_user) -p $(pypi_pwd) dist/*
fi
condition: eq( variables['upload_package'], 'true')
displayName: 'upload nni package to pypi/testpypi'
103 changes: 70 additions & 33 deletions deployment/pypi/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,73 @@
Python Package Index (PyPI) for NNI
===
# Python Package Index (PyPI) for NNI

## 1.Description
This is the PyPI build and upload tool for NNI project.

## 2.Prepare environment
Before build and upload NNI package, make sure the below OS and tools are available.
```
Ubuntu 16.04 LTS
make
wget
Python >= 3.5
Pip
Node.js
Yarn
```

## 2.How to build
```bash
make
```

## 3.How to upload

### upload for testing
```bash
TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/ make upload
```
You may need to input the account and password of https://test.pypi.org during this process.

### upload for release
```bash
make upload
```
You may need to input the account and password of https://pypi.org during this process.
## **For Linux**

* __Prepare environment__

Before build and upload NNI package, make sure the below OS and tools are available.
```
Ubuntu 16.04 LTS
make
wget
Python >= 3.5
Pip
Node.js
Yarn
```

* __How to build__

```bash
make
```

* __How to upload__

**upload for testing**
```bash
TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/ make upload
```
You may need to input the account and password of https://test.pypi.org during this process.

**upload for release**
```bash
make upload
```
You may need to input the account and password of https://pypi.org during this process.

## **For Windows**

* __Prepare environment__

Before build and upload NNI package, make sure the below OS and tools are available.
```
Windows 10
powershell
Python >= 3.5
Pip
Node.js
Yarn
tar
```

* __How to build__

```bash
powershell ./install.ps1
```

* __How to upload__

**upload for testing**
```bash
powershell ./upload.ps1
```
You may need to input the account and password of https://test.pypi.org during this process.

**upload for release**
```bash
powershell ./upload.ps1 -test $False
```
You may need to input the account and password of https://pypi.org during this process.
7 changes: 7 additions & 0 deletions deployment/pypi/clean.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$CWD = $PWD
$OS_SPEC = "windows"
Remove-Item $CWD\build -Recurse -Force
Remove-Item $CWD\dist -Recurse -Force
Remove-Item $CWD\nni -Recurse -Force
Remove-Item $CWD\nni.egg-info -Recurse -Force
Remove-Item $CWD\node-$OS_SPEC-x64 -Recurse -Force
49 changes: 49 additions & 0 deletions deployment/pypi/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
param([bool]$version_ts=$false)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$CWD = $PWD

$OS_SPEC = "windows"
$WHEEL_SPEC = "win_amd64"

$TIME_STAMP = date -u "+%y%m%d%H%M"
$NNI_VERSION_VALUE = git describe --tags --abbrev=0

# To include time stamp in version value, run:
# make version_ts=true build

if($version_ts){
$NNI_VERSION_VALUE = "$NNI_VERSION_VALUE.$TIME_STAMP"
}

$NNI_VERSION_TEMPLATE = "999.0.0-developing"

python -m pip install --user --upgrade setuptools wheel

$nodeUrl = "https://aka.ms/nni/nodejs-download/win64"
$NNI_NODE_ZIP = "$CWD\node-$OS_SPEC-x64.zip"
$NNI_NODE_FOLDER = "$CWD\node-$OS_SPEC-x64"
(New-Object Net.WebClient).DownloadFile($nodeUrl, $NNI_NODE_ZIP)
if(Test-Path $NNI_NODE_FOLDER){
Remove-Item $NNI_NODE_FOLDER -Recurse -Force
}
New-Item $NNI_NODE_FOLDER -ItemType Directory
cmd /c tar -xf $NNI_NODE_ZIP -C $NNI_NODE_FOLDER --strip-components 1

cd $CWD\..\..\src\nni_manager
yarn
yarn build
cd $CWD\..\..\src\webui
yarn
yarn build
if(Test-Path $CWD\nni){
Remove-Item $CWD\nni -r -fo
}
Copy-Item $CWD\..\..\src\nni_manager\dist $CWD\nni -Recurse
Copy-Item $CWD\..\..\src\webui\build $CWD\nni\static -Recurse
Copy-Item $CWD\..\..\src\nni_manager\package.json $CWD\nni
(Get-Content $CWD\nni\package.json).replace($NNI_VERSION_TEMPLATE, $NNI_VERSION_VALUE) | Set-Content $CWD\nni\package.json
cd $CWD\nni
yarn --prod
cd $CWD
(Get-Content setup.py).replace($NNI_VERSION_TEMPLATE, $NNI_VERSION_VALUE) | Set-Content setup.py
python setup.py bdist_wheel -p $WHEEL_SPEC
8 changes: 7 additions & 1 deletion deployment/pypi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@
os_name = 'POSIX :: Linux'
elif os_type == 'Darwin':
os_name = 'MacOS'
elif os_type == 'Windows':
os_name = 'Microsoft :: Windows'
else:
raise NotImplementedError('current platform {} not supported'.format(os_type))

data_files = [('bin', ['node-{}-x64/bin/node'.format(os_type.lower())])]
if os_type == 'Windows':
data_files = [('.\Scripts', ['node-{}-x64/node.exe'.format(os_type.lower())])]

for (dirpath, dirnames, filenames) in walk('./nni'):
files = [path.normpath(path.join(dirpath, filename)) for filename in filenames]
data_files.append((path.normpath(dirpath), files))
Expand Down Expand Up @@ -69,7 +74,8 @@
'json_tricks',
'numpy',
'scipy',
'coverage'
'coverage',
'colorama'
],
classifiers = [
'Programming Language :: Python :: 3',
Expand Down
8 changes: 8 additions & 0 deletions deployment/pypi/upload.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
param([bool]$test=$true)
python -m pip install --user --upgrade twine
if($test){
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
}
else{
python -m twine upload dist/*
}
6 changes: 3 additions & 3 deletions docs/en_US/ExperimentConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ machineList:

* __localConfig__

__localConfig__ is applicable only if __trainingServicePlatform__ is set to ```local```, otherwise there should not be __localConfig__ section in configuration file.
__localConfig__ is applicable only if __trainingServicePlatform__ is set to `local`, otherwise there should not be __localConfig__ section in configuration file.
* __gpuIndices__

__gpuIndices__ is used to specify designated GPU devices for NNI, if it is set, only the specified GPU devices are used for NNI trial jobs. Single or multiple GPU indices can be specified, multiple GPU indices are seperated by comma(,), such as ```1``` or ```0,1,3```.
__gpuIndices__ is used to specify designated GPU devices for NNI, if it is set, only the specified GPU devices are used for NNI trial jobs. Single or multiple GPU indices can be specified, multiple GPU indices are seperated by comma(,), such as `1` or `0,1,3`.

* __machineList__

Expand Down Expand Up @@ -431,7 +431,7 @@ machineList:

* __gpuIndices__

__gpuIndices__ is used to specify designated GPU devices for NNI on this remote machine, if it is set, only the specified GPU devices are used for NNI trial jobs. Single or multiple GPU indices can be specified, multiple GPU indices are seperated by comma(,), such as ```1``` or ```0,1,3```.
__gpuIndices__ is used to specify designated GPU devices for NNI on this remote machine, if it is set, only the specified GPU devices are used for NNI trial jobs. Single or multiple GPU indices can be specified, multiple GPU indices are seperated by comma(,), such as `1` or `0,1,3`.

* __kubeflowConfig__:

Expand Down
41 changes: 38 additions & 3 deletions docs/en_US/Installation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Installation of NNI

Currently we only support installation on Linux & Mac.
Currently we support installation on Linux, Mac and Windows.

## **Installation**
## **Installation on Linux & Mac**

* __Install NNI through pip__

Expand All @@ -13,7 +13,7 @@ Currently we only support installation on Linux & Mac.

* __Install NNI through source code__

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

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**

* __Install NNI through pip__

Prerequisite: `python >= 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:
```bash
git clone https://github.com/Microsoft/nni.git
cd nni
powershell ./install.ps1
```

## **System requirements**

Below are the minimum system requirements for NNI on Linux. Due to potential programming changes, the minimum system requirements for NNI may change over time.
Expand All @@ -50,6 +73,18 @@ 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.

||Minimum Requirements|Recommended Specifications|
|---|---|---|
|**Operating System**|Windows 10|Windows 10|
|**CPU**|Intel® Core™ i3 or AMD Phenom™ X3 8650|Intel® Core™ i5 or AMD Phenom™ II X3 or better|
|**GPU**|NVIDIA® GeForce® GTX 460|NVIDIA® GeForce® GTX 660 or better|
|**Memory**|4 GB RAM|6 GB RAM|
|**Storage**|30 GB available hare drive space|
|**Internet**|Boardband internet connection|
|**Resolution**|1024 x 768 minimum display resolution|

## Further reading

* [Overview](Overview.md)
Expand Down
Loading