diff --git a/README.md b/README.md index e3c2670ea5..420563e26e 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ 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 recommended to install NNI on Windows. +* Currently NNI on Windows only support local mode. Anaconda or Miniconda is highly recommended 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** diff --git a/README_zh_CN.md b/README_zh_CN.md index 85b6b8cefe..e43d9e83e1 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -10,7 +10,7 @@ NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包。 它通过多种调优的算法来搜索最好的神经网络结构和(或)超参,并支持单机、本地多机、云等不同的运行环境。 -### **NNI [v0.6](https://github.com/Microsoft/nni/releases) 已发布!** +### **NNI [v0.7](https://github.com/Microsoft/nni/releases) 已发布!**
@@ -98,78 +98,118 @@ NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包 ## **安装和验证** +在 Windows 本机模式下,并且是第一次使用 PowerShell 来运行脚本,需要**使用管理员权限**运行一次下列命令: + +```bash + Set-ExecutionPolicy -ExecutionPolicy Unrestricted +``` + **通过 pip 命令安装** -* 当前支持 Linux 和 MacOS。测试并支持的版本包括:Ubuntu 16.04 及更高版本,MacOS 10.14.1。 在 `python >= 3.5` 的环境中,只需要运行 `pip install` 即可完成安装。 +* 当前支持 Linux,MacOS 和 Windows(本机模式),在 Ubuntu 16.04 或更高版本,MacOS 10.14.1 以及 Windows 10.1809 上进行了测试。 在 `python >= 3.5` 的环境中,只需要运行 `pip install` 即可完成安装。 + +Linux 和 MacOS ```bash - python3 -m pip install --upgrade nni +python3 -m pip install --upgrade nni +``` + +Windows + +```bash +python -m pip install --upgrade nni ``` 注意: * 如果需要将 NNI 安装到自己的 home 目录中,可使用 `--user`,这样也不需要任何特殊权限。 +* 当前 NNI 在 Windows 上仅支持本机模式。 强烈推荐使用 Anaconda 在 Windows 上安装 NNI。 * 如果遇到如`Segmentation fault` 这样的任何错误请参考[常见问题](docs/zh_CN/FAQ.md)。 **通过源代码安装** -* 当前支持 Linux(Ubuntu 16.04 及更高版本) 和 MacOS(10.14.1)。 +* 当前支持 Linux(Ubuntu 16.04 或更高版本),MacOS(10.14.1)以及 Windows 10(1809 版)下的本机模式。 + +Linux 和 MacOS + * 在 `python >= 3.5` 的环境中运行命令: `git` 和 `wget`,确保安装了这两个组件。 ```bash - git clone -b v0.6 https://github.com/Microsoft/nni.git - cd nni - source install.sh + git clone -b v0.7 https://github.com/Microsoft/nni.git + cd nni + source install.sh +``` + +Windows + +* 在 `python >=3.5` 的环境中运行命令: `git` 和 `PowerShell`,确保安装了这两个组件。 + +```bash + git clone -b v0.7 https://github.com/Microsoft/nni.git + cd nni + powershell ./install.ps1 ``` 参考[安装 NNI](docs/zh_CN/Installation.md) 了解系统需求。 +参考 [NNI Windows 本机模式](docs/zh_CN/WindowsLocalMode.md),了解更多信息。 + **验证安装** 以下示例 Experiment 依赖于 TensorFlow 。 在运行前确保安装了 **TensorFlow**。 -* 通过克隆源代码下载示例。 +* 通过克隆源代码下载示例。 ```bash - git clone -b v0.6 https://github.com/Microsoft/nni.git + git clone -b v0.7 https://github.com/Microsoft/nni.git ``` -* 运行 mnist 示例。 +Linux 和 macOS + +* 运行 MNIST 示例。 ```bash nnictl create --config nni/examples/trials/mnist/config.yml ``` +Windows + +* 运行 MNIST 示例。 + +```bash + nnictl create --config nni/examples/trials/mnist/config_windows.yml +``` + * 在命令行中等待输出 `INFO: Successfully started experiment!`。 此消息表明 Experiment 已成功启动。 通过命令行输出的 `Web UI url` 来访问 Experiment 的界面。 - ``` - 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 - 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 - ----------------------------------------------------------------------- - - -* 在浏览器中打开 `Web UI url`,可看到下图的 Experiment 详细信息,以及所有的 Trial 任务。 查看[这里的](docs/zh_CN/WebUI.md)更多页面示例。 +```text +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 +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 +----------------------------------------------------------------------- +``` + +* 在浏览器中打开 `Web UI url`,可看到下图的 Experiment 详细信息,以及所有的 Trial 任务。 查看[这里](docs/zh_CN/WebUI.md)的更多页面。
diff --git a/deployment/docker/README_zh_CN.md b/deployment/docker/README_zh_CN.md index 19a5788d67..a2b243e472 100644 --- a/deployment/docker/README_zh_CN.md +++ b/deployment/docker/README_zh_CN.md @@ -12,7 +12,7 @@ scikit-learn 0.20.0 pandas 0.23.4 lightgbm 2.2.2 - NNI v0.6 + NNI v0.7 此 Dockerfile 可作为定制的参考。 diff --git a/deployment/pypi/README_zh_CN.md b/deployment/pypi/README_zh_CN.md index 076f6b47d4..d685245491 100644 --- a/deployment/pypi/README_zh_CN.md +++ b/deployment/pypi/README_zh_CN.md @@ -51,15 +51,15 @@ powershell Python >= 3.5 Pip - Node.js Yarn - tar * **如何生成** + 参数 `version_os` 用来选择使用 64 位还是 32 位 Windows 来生成。 + ```bash - powershell ./install.ps1 + powershell ./install.ps1 -version_os [64/32] ``` * **如何上传** diff --git a/docs/en_US/Installation.md b/docs/en_US/Installation.md index 1d18a8b799..ec29c50ce5 100644 --- a/docs/en_US/Installation.md +++ b/docs/en_US/Installation.md @@ -25,22 +25,28 @@ Currently we support installation on Linux, Mac and Windows(local mode). 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** - When you use powershell to run script for the first time, you need **run powershell as administrator** with this command: + + 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. + + Anaconda or Miniconda is highly recommended. * __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` - you can install nni as administrator or current user as follows: + Prerequisite: `python >=3.5`, `git`, `PowerShell`. + + you can install NNI as administrator or current user as follows: + ```bash git clone -b v0.7 https://github.com/Microsoft/nni.git cd nni diff --git a/docs/en_US/WindowsLocalMode.md b/docs/en_US/WindowsLocalMode.md index e9c3b9e13e..d4a1e172e6 100644 --- a/docs/en_US/WindowsLocalMode.md +++ b/docs/en_US/WindowsLocalMode.md @@ -4,7 +4,7 @@ Currently we only support local mode on Windows. Windows 10.1809 is well tested ## **Installation on Windows** - **Anaconda python(64-bit) is highly recommended.** + **Anaconda or Miniconda 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: @@ -22,7 +22,7 @@ Set-ExecutionPolicy -ExecutionPolicy Unrestricted * __Install NNI through source code__ - Prerequisite: `python >=3.5`, `git`, `powershell` + Prerequisite: `python >=3.5`, `git`, `PowerShell` ```bash git clone -b v0.7 https://github.com/Microsoft/nni.git @@ -55,9 +55,9 @@ Set-ExecutionPolicy -ExecutionPolicy Unrestricted >...cannot be loaded because running scripts is disabled on this system. -### Trial failed with missing DLL in cmd or PowerShell +### Trial failed with missing DLL in command line or PowerShell -This error caused by missing LIBIFCOREMD.DLL and LIBMMD.DLL and fail to install SciPy. Using anaconda python(64-bit) can solve it. +This error caused by missing LIBIFCOREMD.DLL and LIBMMD.DLL and fail to install SciPy. Using Anaconda or Miniconda with Python(64-bit) can solve it. >ImportError: DLL load failed ### Trial failed on webUI @@ -77,8 +77,7 @@ If there is a stderr file, please check out. Two possible cases are as follows: Make sure C++ 14.0 compiler installed then try to run `nnictl package install --name=BOHB` to install the dependencies. ### Not supported tuner on Windows -SMAC is not supported currently, the specific reason can be referred to this [github issue](https://github.com/automl/SMAC3/issues/483). - +SMAC is not supported currently, the specific reason can be referred to this [GitHub issue](https://github.com/automl/SMAC3/issues/483). Note: diff --git a/docs/zh_CN/Blog/HPOComparison.md b/docs/zh_CN/Blog/HPOComparison.md new file mode 100644 index 0000000000..4a7d867909 --- /dev/null +++ b/docs/zh_CN/Blog/HPOComparison.md @@ -0,0 +1,217 @@ +# 超参数优化的对比 + +*匿名作者* + +超参优化算法在几个问题上的对比。 + +超参数优化算法如下: + +- [Random Search(随机搜索)](../Builtin_Tuner.md#Random) +- [Grid Search(遍历搜索)](../Builtin_Tuner.md#Random) +- [Evolution](../Builtin_Tuner.md#Evolution) +- [Anneal(退火算法)](../Builtin_Tuner.md#Anneal) +- [Metis](../Builtin_Tuner.md#MetisTuner) +- [TPE](../Builtin_Tuner.md#TPE) +- [SMAC](../Builtin_Tuner.md#SMAC) +- [HyperBand](../Builtin_Tuner.md#Hyperband) +- [BOHB](../Builtin_Tuner.md#BOHB) + +所有算法都在 NNI 本机环境下运行。 + +环境: + + OS: Linux Ubuntu 16.04 LTS + CPU: Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz 2600 MHz + Memory: 112 GB + NNI Version: v0.7 + NNI 模式(local|pai|remote): local + Python 版本: 3.6 + 使用的虚拟环境: Conda + 是否在 Docker 中运行: no + + +## AutoGBDT 示例 + +### 问题描述 + +超参搜索上的非凸问题 [AutoGBDT](../gbdt_example.md)。 + +### 搜索空间 + +```json +{ + "num_leaves": { + "_type": "choice", + "_value": [10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 48, 64, 96, 128] + }, + "learning_rate": { + "_type": "choice", + "_value": [0.00001, 0.0001, 0.001, 0.01, 0.05, 0.1, 0.2, 0.5] + }, + "max_depth": { + "_type": "choice", + "_value": [-1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 48, 64, 96, 128] + }, + "feature_fraction": { + "_type": "choice", + "_value": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2] + }, + "bagging_fraction": { + "_type": "choice", + "_value": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2] + }, + "bagging_freq": { + "_type": "choice", + "_value": [1, 2, 4, 8, 10, 12, 14, 16] + } +} +``` + +总搜索空间为 1, 204, 224 次,将最大 Trial 次数设置为1000。 时间限制为 48 小时。 + +### 结果 + +| 算法 | 最好的损失值 | 最好的 5 次损失的平均值 | 最好的 10 次损失的平均 | +| ------------- | ------------ | ------------- | ------------- | +| Random Search | 0.418854 | 0.420352 | 0.421553 | +| Random Search | 0.417364 | 0.420024 | 0.420997 | +| Random Search | 0.417861 | 0.419744 | 0.420642 | +| Grid Search | 0.498166 | 0.498166 | 0.498166 | +| Evolution | 0.409887 | 0.409887 | 0.409887 | +| Evolution | 0.413620 | 0.413875 | 0.414067 | +| Evolution | 0.409887 | 0.409887 | 0.409887 | +| Anneal | 0.414877 | 0.417289 | 0.418281 | +| Anneal | 0.409887 | 0.409887 | 0.410118 | +| Anneal | 0.413683 | 0.416949 | 0.417537 | +| Metis | 0.416273 | 0.420411 | 0.422380 | +| Metis | 0.420262 | 0.423175 | 0.424816 | +| Metis | 0.421027 | 0.424172 | 0.425714 | +| TPE | 0.414478 | 0.414478 | 0.414478 | +| TPE | 0.415077 | 0.417986 | 0.418797 | +| TPE | 0.415077 | 0.417009 | 0.418053 | +| SMAC | **0.408386** | **0.408386** | **0.408386** | +| SMAC | 0.414012 | 0.414012 | 0.414012 | +| SMAC | **0.408386** | **0.408386** | **0.408386** | +| BOHB | 0.410464 | 0.415319 | 0.417755 | +| BOHB | 0.418995 | 0.420268 | 0.422604 | +| BOHB | 0.415149 | 0.418072 | 0.418932 | +| HyperBand | 0.414065 | 0.415222 | 0.417628 | +| HyperBand | 0.416807 | 0.417549 | 0.418828 | +| HyperBand | 0.415550 | 0.415977 | 0.417186 | + +Metis 算法因为其高斯计算过程的复杂度为 O(n^3) 而运行非常慢,因此仅执行了 300 次 Trial。 + +## RocksDB 的 'fillrandom' 和 'readrandom' 基准测试 + +### 问题描述 + +[DB_Bench](https://github.com/facebook/rocksdb/wiki/Benchmarking-tools) 是用来做 [RocksDB](https://rocksdb.org/) 性能基准测试的工具。 有多个参数需要调优。 + +`DB_Bench` 的性能与计算机配置和安装方法有关。 在 `DB_Bench` Linux 系统上运行,并将 Rock 作为共享库安装。 + +#### 计算机配置 + + RocksDB: version 6.1 + CPU: 6 * Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz + CPUCache: 35840 KB + Keys: 16 bytes each + Values: 100 bytes each (50 bytes after compression) + Entries: 1000000 + + +#### 存储性能 + +**延迟**:每个 IO 请求都需要一些时间才能完成,这称为平均延迟。 有几个因素会影响此时间,包括网络连接质量和硬盘IO性能。 + +**IOPS**: **每秒的 IO 操作数量**,这意味着可以在一秒钟内完成的*读取或写入操作次数*。 + +**IO 大小**: **每个 IO 请求的大小**。 根据操作系统和需要磁盘访问的应用程序、服务,它将同时发出读取或写入一定数量数据的请求。 + +**吞吐量(以 MB/s 为单位)= 平均 IO 大小 x IOPS ** + +IOPS 与在线处理能力有关,我们在实验中使用 IOPS 作为指标。 + +### 搜索空间 + +```json +{ + "max_background_compactions": { + "_type": "quniform", + "_value": [1, 256, 1] + }, + "block_size": { + "_type": "quniform", + "_value": [1, 500000, 1] + }, + "write_buffer_size": { + "_type": "quniform", + "_value": [1, 130000000, 1] + }, + "max_write_buffer_number": { + "_type": "quniform", + "_value": [1, 128, 1] + }, + "min_write_buffer_number_to_merge": { + "_type": "quniform", + "_value": [1, 32, 1] + }, + "level0_file_num_compaction_trigger": { + "_type": "quniform", + "_value": [1, 256, 1] + }, + "level0_slowdown_writes_trigger": { + "_type": "quniform", + "_value": [1, 1024, 1] + }, + "level0_stop_writes_trigger": { + "_type": "quniform", + "_value": [1, 1024, 1] + }, + "cache_size": { + "_type": "quniform", + "_value": [1, 30000000, 1] + }, + "compaction_readahead_size": { + "_type": "quniform", + "_value": [1, 30000000, 1] + }, + "new_table_reader_for_compaction_inputs": { + "_type": "randint", + "_value": [1] + } +} +``` + +搜索空间非常大(约10 的 40 次方),将最大 Trial 次数设置为 100 以限制资源。 + +### 结果 + +#### fillrandom 基准 + +| 模型 | 最高 IOPS(重复 1 次) | 最高 IOPS(重复 2 次) | 最高 IOPS(重复 3 次) | +| --------- | --------------- | --------------- | --------------- | +| Random | 449901 | 427620 | 477174 | +| Anneal | 461896 | 467150 | 437528 | +| Evolution | 436755 | 389956 | 389790 | +| TPE | 378346 | 482316 | 468989 | +| SMAC | 491067 | 490472 | **491136** | +| Metis | 444920 | 457060 | 454438 | + +图: + +![](../../img/hpo_rocksdb_fillrandom.png) + +#### readrandom 基准 + +| 模型 | 最高 IOPS(重复 1 次) | 最高 IOPS(重复 2 次) | 最高 IOPS(重复 3 次) | +| --------- | --------------- | --------------- | --------------- | +| Random | 2276157 | 2285301 | 2275142 | +| Anneal | 2286330 | 2282229 | 2284012 | +| Evolution | 2286524 | 2283673 | 2283558 | +| TPE | 2287366 | 2282865 | 2281891 | +| SMAC | 2270874 | 2284904 | 2282266 | +| Metis | **2287696** | 2283496 | 2277701 | + +图: + +![](../../img/hpo_rocksdb_readrandom.png) \ No newline at end of file diff --git a/docs/zh_CN/Blog/NASComparison.md b/docs/zh_CN/Blog/NASComparison.md index a1d3211b2e..969340ef8d 100644 --- a/docs/zh_CN/Blog/NASComparison.md +++ b/docs/zh_CN/Blog/NASComparison.md @@ -1,8 +1,8 @@ -# NAS 算法对比 +# 神经网络结构搜索的对比 *匿名作者* -训练并对比 Autokeras, DARTS, ENAS 和 NAO 这些算法的效果。 +训练和比较 NAS(神经网络架构搜索)的模型,包括 Autokeras,DARTS,ENAS 和 NAO。 源码链接如下: diff --git a/docs/zh_CN/Blog/index.rst b/docs/zh_CN/Blog/index.rst index f66561396c..0041f0f39e 100644 --- a/docs/zh_CN/Blog/index.rst +++ b/docs/zh_CN/Blog/index.rst @@ -5,4 +5,5 @@ .. toctree:: :maxdepth: 2 - NAS 算法比较 |
---|