diff --git a/README_zh_CN.md b/README_zh_CN.md
index 8df20fd24c..0807cf1c75 100644
--- a/README_zh_CN.md
+++ b/README_zh_CN.md
@@ -8,9 +8,24 @@
[English](README.md)
-NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包。 它通过多种调优的算法来搜索最好的神经网络结构和(或)超参,并支持单机、本地多机、云等不同的运行环境。
+**NNI (Neural Network Intelligence)** 是一个轻量但强大的工具包,帮助用户**自动**的进行[特征工程](docs/zh_CN/FeatureEngineering/Overview.md),[神经网络架构搜索](docs/zh_CN/NAS/Overview.md),[超参调优](docs/zh_CN/Tuner/BuiltinTuner.md)以及[模型压缩](docs/zh_CN/Compressor/Overview.md)。
-### **NNI v1.1 已发布! [
](#nni-released-reminder)**
+NNI 管理自动机器学习 (AutoML) 的 Experiment,**调度运行**由调优算法生成的 Trial 任务来找到最好的神经网络架构和/或超参,支持**各种训练环境**,如[本机](docs/zh_CN/TrainingService/LocalMode.md),[远程服务器](docs/zh_CN/TrainingService/RemoteMachineMode.md),[OpenPAI](docs/zh_CN/TrainingService/PaiMode.md),[Kubeflow](docs/zh_CN/TrainingService/KubeflowMode.md),[基于 K8S 的 FrameworkController(如,AKS 等)](docs/zh_CN/TrainingService/FrameworkControllerMode.md),以及其它云服务。
+
+## **使用场景**
+
+* 想要在自己的代码、模型中试验**不同的自动机器学习算法**。
+* 想要在**不同的环境中**加速运行自动机器学习。
+* 想要更容易**实现或试验新的自动机器学习算法**的研究员或数据科学家,包括:超参调优算法,神经网络搜索算法以及模型压缩算法。
+* 在机器学习平台中**支持自动机器学习**。
+
+### **NNI v1.2 已发布! [
](#nni-released-reminder)**
+
+## **NNI 功能一览**
+
+NNI 提供命令行工具以及友好的 WebUI 来管理训练的 Experiment。 通过可扩展的 API,可定制自动机器学习算法和训练平台。 为了方便新用户,NNI 内置了最新的自动机器学习算法,并为流行的训练平台提供了开箱即用的支持。
+
+下表中,包含了 NNI 的功能,同时在不断地增添新功能,也非常希望您能贡献其中。
@@ -26,7 +41,7 @@ NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包
- 调优算法
+ 算法
|
@@ -63,7 +78,7 @@ NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包
示例
|
- Tuner(调参器)
+ 超参调优
+ 启发式搜索
- NAS Tuner
+ 贝叶斯优化
+
+ 基于强化学习
- Assessor(评估器)
+ 神经网络架构搜索
+
+ 模型压缩
+
+ 特征工程(测试版)
+ 提前终止算法
-
|
@@ -148,24 +191,6 @@ NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包
-## **使用场景**
-
-* 在本机尝试使用不同的自动机器学习(AutoML)算法来训练模型。
-* 在分布式环境中加速自动机器学习(如:远程 GPU 工作站和云服务器)。
-* 定制自动机器学习算法,或比较不同的自动机器学习算法。
-* 在机器学习平台中支持自动机器学习。
-
-## 相关项目
-
-以开发和先进技术为目标,[Microsoft Research (MSR)](https://www.microsoft.com/en-us/research/group/systems-research-group-asia/) 发布了一些开源项目。
-
-* [OpenPAI](https://github.com/Microsoft/pai):作为开源平台,提供了完整的 AI 模型训练和资源管理能力,能轻松扩展,并支持各种规模的私有部署、云和混合环境。
-* [FrameworkController](https://github.com/Microsoft/frameworkcontroller):开源的通用 Kubernetes Pod 控制器,通过单个控制器来编排 Kubernetes 上所有类型的应用。
-* [MMdnn](https://github.com/Microsoft/MMdnn):一个完整、跨框架的解决方案,能够转换、可视化、诊断深度神经网络模型。 MMdnn 中的 "MM" 表示model management(模型管理),而 "dnn" 是 deep neural network(深度神经网络)的缩写。
-* [SPTAG](https://github.com/Microsoft/SPTAG) : Space Partition Tree And Graph (SPTAG) 是用于大规模向量的最近邻搜索场景的开源库。
-
-我们鼓励研究人员和学生利用这些项目来加速 AI 开发和研究。
-
## **安装和验证**
**通过 pip 命令安装**
@@ -194,12 +219,12 @@ python -m pip install --upgrade nni
* 当前支持 Linux(Ubuntu 16.04 或更高版本),MacOS(10.14.1)以及 Windows 10(1809 版)。
-Linux 和 macOS
+Linux 和 MacOS
* 在 `python >= 3.5` 的环境中运行命令: `git` 和 `wget`,确保安装了这两个组件。
```bash
- git clone -b v1.1 https://github.com/Microsoft/nni.git
+ git clone -b v1.2 https://github.com/Microsoft/nni.git
cd nni
source install.sh
```
@@ -209,7 +234,7 @@ Windows
* 在 `python >=3.5` 的环境中运行命令: `git` 和 `PowerShell`,确保安装了这两个组件。
```bash
- git clone -b v1.1 https://github.com/Microsoft/nni.git
+ git clone -b v1.2 https://github.com/Microsoft/nni.git
cd nni
powershell -ExecutionPolicy Bypass -file install.ps1
```
@@ -225,15 +250,15 @@ Windows 上参考 [Windows 上使用 NNI](docs/zh_CN/Tutorial/NniOnWindows.md)
* 通过克隆源代码下载示例。
```bash
- git clone -b v1.1 https://github.com/Microsoft/nni.git
+ git clone -b v1.2 https://github.com/Microsoft/nni.git
```
-Linux 和 macOS
+Linux 和 MacOS
* 运行 MNIST 示例。
```bash
- nnictl create --config nni/examples/trials/mnist/config.yml
+ nnictl create --config nni/examples/trials/mnist-tfv1/config.yml
```
Windows
@@ -241,7 +266,7 @@ Windows
* 运行 MNIST 示例。
```bash
- nnictl create --config nni\examples\trials\mnist\config_windows.yml
+ nnictl create --config nni\examples\trials\mnist-tfv1\config_windows.yml
```
* 在命令行中等待输出 `INFO: Successfully started experiment!`。 此消息表明 Experiment 已成功启动。 通过命令行输出的 `Web UI url` 来访问 Experiment 的界面。
@@ -282,55 +307,27 @@ You can use these commands to get more information about the experiment
## **文档**
-主要文档都可以在[这里](https://nni.readthedocs.io/cn/latest/Overview.html)找到,文档均从本代码库生成。
-点击阅读:
-
-* [NNI 概述](docs/zh_CN/Overview.md)
-* [快速入门](docs/zh_CN/Tutorial/QuickStart.md)
-* [Web 界面教程](docs/zh_CN/Tutorial/WebUI.md)
-* [贡献](docs/zh_CN/Tutorial/Contributing.md)
-
-## **入门**
-
-* [安装 NNI](docs/zh_CN/Tutorial/Installation.md)
-* [使用命令行工具 nnictl](docs/zh_CN/Tutorial/Nnictl.md)
-* [实现 Trial](docs/zh_CN/TrialExample/Trials.md)
-* [配置 Experiment](docs/zh_CN/Tutorial/ExperimentConfig.md)
-* [定制搜索空间](docs/zh_CN/Tutorial/SearchSpaceSpec.md)
-* [选择 Tuner、搜索算法](docs/zh_CN/Tuner/BuiltinTuner.md)
-* [使用 Annotation](docs/zh_CN/TrialExample/Trials.md#nni-python-annotation)
-* [使用 NNIBoard](docs/zh_CN/Tutorial/WebUI.md)
-
-## **教程**
-
-* [在本机运行 Experiment (支持多 GPU 卡)](docs/zh_CN/TrainingService/LocalMode.md)
-* [在 OpenPAI 上运行 Experiment](docs/zh_CN/TrainingService/PaiMode.md)
-* [在 Kubeflow 上运行 Experiment](docs/zh_CN/TrainingService/KubeflowMode.md)
-* [在多机上运行 Experiment](docs/zh_CN/TrainingService/RemoteMachineMode.md)
-* [尝试不同的 Tuner](docs/zh_CN/Tuner/BuiltinTuner.md)
-* [尝试不同的 Assessor](docs/zh_CN/Assessor/BuiltinAssessor.md)
-* [实现自定义 Tuner](docs/zh_CN/Tuner/CustomizeTuner.md)
-* [实现自定义 Assessor](docs/zh_CN/Assessor/CustomizeAssessor.md)
-* [实现 NNI 训练平台](docs/zh_CN/TrainingService/HowToImplementTrainingService.md)
-* [使用进化算法为阅读理解任务找到好模型](docs/zh_CN/TrialExample/SquadEvolutionExamples.md)
-* [高级神经网络架构搜索](docs/zh_CN/AdvancedFeature/AdvancedNas.md)
+* 要了解 NNI,请阅读 [NNI 概述](https://nni.readthedocs.io/zh/latest/Overview.html)。
+* 要熟悉如何使用 NNI,请阅读[文档](https://nni.readthedocs.io/zh/latest/index.html)。
+* 要安装 NNI,请参阅[安装 NNI](docs/zh_CN/Tutorial/Installation.md)。
## **贡献**
-非常欢迎通过各种方式参与此项目,例如:
+本项目欢迎任何贡献和建议。 大多数贡献都需要你同意参与者许可协议(CLA),来声明你有权,并实际上授予我们有权使用你的贡献。 有关详细信息,请访问 https://cla.microsoft.com。
-* [报告 Bug](https://github.com/microsoft/nni/issues/new/choose)。
-* [请求新功能](https://github.com/microsoft/nni/issues/new/choose).
-* 建议或询问[如何调试](docs/zh_CN/Tutorial/HowToDebug.md)文档相关的问题。
-* 找到标有 ['good first issue'](https://github.com/Microsoft/nni/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 或 ['help-wanted'](https://github.com/microsoft/nni/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) 标签的 Issue。这些都是简单的 Issue,新的贡献者可以从这些问题开始。
+当你提交拉取请求时,CLA机器人会自动检查你是否需要提供CLA,并修饰这个拉取请求(例如,标签、注释)。 只需要按照机器人提供的说明进行操作即可。 CLA 只需要同意一次,就能应用到所有的代码仓库上。
-在编写代码前,可以先看看[贡献指南](docs/zh_CN/Tutorial/Contributing.md)来了解更多信息。 此外,还提供了以下文档:
+该项目采用了 [ Microsoft 开源行为准则 ](https://opensource.microsoft.com/codeofconduct/)。 有关详细信息,请参阅[常见问题解答](https://opensource.microsoft.com/codeofconduct/faq/),如有任何疑问或意见可联系 opencode@microsoft.com。
+熟悉贡献协议后,即可按照 NNI 开发人员教程,创建第一个 PR =):
+
+* 推荐新贡献者先找到标有 ['good first issue'](https://github.com/Microsoft/nni/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 或 ['help-wanted'](https://github.com/microsoft/nni/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) 标签的 Issue。这些都比较简单,可以从这些问题开始。
* [NNI 开发环境安装教程](docs/zh_CN/Tutorial/SetupNniDeveloperEnvironment.md)
* [如何调试](docs/zh_CN/Tutorial/HowToDebug.md)
-* [自定义 Advisor](docs/zh_CN/Tuner/CustomizeAdvisor.md)
* [自定义 Tuner](docs/zh_CN/Tuner/CustomizeTuner.md)
* [实现定制的训练平台](docs/zh_CN/TrainingService/HowToImplementTrainingService.md)
+* [在 NNI 上实现新的 NAS Trainer](https://github.com/microsoft/nni/blob/master/docs/en_US/NAS/NasInterface.md#implement-a-new-nas-trainer-on-nni)
+* [自定义 Advisor](docs/zh_CN/Tuner/CustomizeAdvisor.md)
## **其它代码库和参考**
@@ -340,7 +337,7 @@ You can use these commands to get more information about the experiment
* 在 NNI 中运行 [ENAS](examples/tuners/enas_nni/README_zh_CN.md)
* 在 NNI 中运行 [神经网络架构结构搜索](examples/trials/nas_cifar10/README_zh_CN.md)
- * [NNI 中的自动特征工程](examples/trials/auto-feature-engineering/README_zh_CN.md)
+ * [NNI 中的自动特征工程](examples/feature_engineering/auto-feature-engineering/README_zh_CN.md)
* 使用 NNI 的 [矩阵分解超参调优](https://github.com/microsoft/recommenders/blob/master/notebooks/04_model_select_and_optimize/nni_surprise_svd.ipynb)
* [scikit-nni](https://github.com/ksachdeva/scikit-nni) 使用 NNI 为 scikit-learn 开发的超参搜索。
* ### **相关文章**
@@ -359,6 +356,17 @@ You can use these commands to get more information about the experiment
* [在 GitHub 上提交问题](https://github.com/microsoft/nni/issues/new/choose)。
* 在 [Stack Overflow](https://stackoverflow.com/questions/tagged/nni?sort=Newest&edited=true) 上使用 nni 标签提问。
+## 相关项目
+
+以探索先进技术和开放为目标,[Microsoft Research (MSR)](https://www.microsoft.com/en-us/research/group/systems-research-group-asia/) 还发布了一些相关的开源项目。
+
+* [OpenPAI](https://github.com/Microsoft/pai):作为开源平台,提供了完整的 AI 模型训练和资源管理能力,能轻松扩展,并支持各种规模的私有部署、云和混合环境。
+* [FrameworkController](https://github.com/Microsoft/frameworkcontroller):开源的通用 Kubernetes Pod 控制器,通过单个控制器来编排 Kubernetes 上所有类型的应用。
+* [MMdnn](https://github.com/Microsoft/MMdnn):一个完整、跨框架的解决方案,能够转换、可视化、诊断深度神经网络模型。 MMdnn 中的 "MM" 表示 model management(模型管理),而 "dnn" 是 deep neural network(深度神经网络)的缩写。
+* [SPTAG](https://github.com/Microsoft/SPTAG) : Space Partition Tree And Graph (SPTAG) 是用于大规模向量的最近邻搜索场景的开源库。
+
+我们鼓励研究人员和学生利用这些项目来加速 AI 开发和研究。
+
## **许可协议**
代码库遵循 [MIT 许可协议](LICENSE)
\ No newline at end of file
diff --git a/docs/zh_CN/CommunitySharings/community_sharings.rst b/docs/zh_CN/CommunitySharings/community_sharings.rst
index 509b68aa29..828ff48b4d 100644
--- a/docs/zh_CN/CommunitySharings/community_sharings.rst
+++ b/docs/zh_CN/CommunitySharings/community_sharings.rst
@@ -12,3 +12,4 @@
神经网络结构搜索(NAS)的对比
超参调优算法的对比
TPE 的并行优化
+ 使用 NNI 自动调优系统
diff --git a/docs/zh_CN/Compressor/AutoCompression.md b/docs/zh_CN/Compressor/AutoCompression.md
index 686ed6aaa1..ba257177ab 100644
--- a/docs/zh_CN/Compressor/AutoCompression.md
+++ b/docs/zh_CN/Compressor/AutoCompression.md
@@ -84,7 +84,7 @@ config_list_agp = [{'initial_sparsity': 0, 'final_sparsity': conv0_sparsity,
{'initial_sparsity': 0, 'final_sparsity': conv1_sparsity,
'start_epoch': 0, 'end_epoch': 3,
'frequency': 1,'op_name': 'conv1' },]
-PRUNERS = {'level':LevelPruner(model, config_list_level),'agp':AGP_Pruner(model, config_list_agp)}
+PRUNERS = {'level':LevelPruner(model, config_list_level), 'agp':AGP_Pruner(model, config_list_agp)}
pruner = PRUNERS(params['prune_method']['_name'])
pruner.compress()
... # fine tuning
diff --git a/docs/zh_CN/Compressor/Overview.md b/docs/zh_CN/Compressor/Overview.md
index db0482f7f5..cd56012f2d 100644
--- a/docs/zh_CN/Compressor/Overview.md
+++ b/docs/zh_CN/Compressor/Overview.md
@@ -6,16 +6,23 @@ NNI 提供了易于使用的工具包来帮助用户设计并使用压缩算法
## 支持的算法
-NNI 提供了两种朴素压缩算法以及三种流行的压缩算法,包括两种剪枝算法以及三种量化算法:
+NNI 提供了几种压缩算法,包括剪枝和量化算法:
+
+**剪枝**
+
+| 名称 | 算法简介 |
+| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
+| [Level Pruner](./Pruner.md#level-pruner) | 根据权重的绝对值,来按比例修剪权重。 |
+| [AGP Pruner](./Pruner.md#agp-pruner) | 自动的逐步剪枝(是否剪枝的判断:基于对模型剪枝的效果)[参考论文](https://arxiv.org/abs/1710.01878) |
+| [L1Filter Pruner](./Pruner.md#l1filter-pruner) | 剪除卷积层中最不重要的过滤器 (PRUNING FILTERS FOR EFFICIENT CONVNETS)[参考论文](https://arxiv.org/abs/1608.08710) |
+| [Slim Pruner](./Pruner.md#slim-pruner) | 通过修剪 BN 层中的缩放因子来修剪卷积层中的通道 (Learning Efficient Convolutional Networks through Network Slimming)[参考论文](https://arxiv.org/abs/1708.06519) |
+| [Lottery Ticket Pruner](./Pruner.md#agp-pruner) | "The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks" 提出的剪枝过程。 它会反复修剪模型。 [参考论文](https://arxiv.org/abs/1803.03635) |
+| [FPGM Pruner](./Pruner.md#fpgm-pruner) | Filter Pruning via Geometric Median for Deep Convolutional Neural Networks Acceleration [参考论文](https://arxiv.org/pdf/1811.00250.pdf) |
+
+**量化**
| 名称 | 算法简介 |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Level Pruner](./Pruner.md#level-pruner) | 根据权重的绝对值,来按比例修剪权重。 |
-| [AGP Pruner](./Pruner.md#agp-pruner) | 自动的逐步剪枝(是否剪枝的判断:基于对模型剪枝的效果)[参考论文](https://arxiv.org/abs/1710.01878) |
-| [L1Filter Pruner](./Pruner.md#l1filter-pruner) | 剪除卷积层中最不重要的过滤器 (PRUNING FILTERS FOR EFFICIENT CONVNETS)[参考论文](https://arxiv.org/abs/1608.08710) |
-| [Slim Pruner](./Pruner.md#slim-pruner) | 通过修剪 BN 层中的缩放因子来修剪卷积层中的通道 (Learning Efficient Convolutional Networks through Network Slimming)[参考论文](https://arxiv.org/abs/1708.06519) |
-| [Lottery Ticket Pruner](./Pruner.md#agp-pruner) | "The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks" 提出的剪枝过程。 它会反复修剪模型。 [参考论文](https://arxiv.org/abs/1803.03635) |
-| [FPGM Pruner](./Pruner.md#fpgm-pruner) | Filter Pruning via Geometric Median for Deep Convolutional Neural Networks Acceleration [参考论文](https://arxiv.org/pdf/1811.00250.pdf) |
| [Naive Quantizer](./Quantizer.md#naive-quantizer) | 默认将权重量化为 8 位 |
| [QAT Quantizer](./Quantizer.md#qat-quantizer) | 为 Efficient Integer-Arithmetic-Only Inference 量化并训练神经网络。 [参考论文](http://openaccess.thecvf.com/content_cvpr_2018/papers/Jacob_Quantization_and_Training_CVPR_2018_paper.pdf) |
| [DoReFa Quantizer](./Quantizer.md#dorefa-quantizer) | DoReFa-Net: 通过低位宽的梯度算法来训练低位宽的卷积神经网络。 [参考论文](https://arxiv.org/abs/1606.06160) |
@@ -24,25 +31,26 @@ NNI 提供了两种朴素压缩算法以及三种流行的压缩算法,包括
通过简单的示例来展示如何修改 Trial 代码来使用压缩算法。 比如,需要通过 Level Pruner 来将权重剪枝 80%,首先在代码中训练模型前,添加以下内容([完整代码](https://github.com/microsoft/nni/tree/master/examples/model_compress))。
-TensorFlow 代码
+PyTorch 代码
```python
-from nni.compression.tensorflow import LevelPruner
+from nni.compression.torch import LevelPruner
config_list = [{ 'sparsity': 0.8, 'op_types': ['default'] }]
-pruner = LevelPruner(tf.get_default_graph(), config_list)
+pruner = LevelPruner(model, config_list)
pruner.compress()
```
-PyTorch 代码
+TensorFlow 代码
```python
-from nni.compression.torch import LevelPruner
+from nni.compression.tensorflow import LevelPruner
config_list = [{ 'sparsity': 0.8, 'op_types': ['default'] }]
-pruner = LevelPruner(model, config_list)
+pruner = LevelPruner(tf.get_default_graph(), config_list)
pruner.compress()
```
-可使用 `nni.compression` 中的其它压缩算法。 此算法分别在 `nni.compression.torch` 和 `nni.compression.tensorflow` 中实现,支持 PyTorch 和 TensorFlow。 参考 [Pruner](./Pruner.md) 和 [Quantizer](./Quantizer.md) 进一步了解支持的算法。
+
+可使用 `nni.compression` 中的其它压缩算法。 此算法分别在 `nni.compression.torch` 和 `nni.compression.tensorflow` 中实现,支持 PyTorch 和 TensorFlow。 参考 [Pruner](./Pruner.md) 和 [Quantizer](./Quantizer.md) 进一步了解支持的算法。 此外,如果要使用知识蒸馏算法,可参考 [KD 示例](../TrialExample/KDExample.md)
函数调用 `pruner.compress()` 来修改用户定义的模型(在 Tensorflow 中,通过 `tf.get_default_graph()` 来获得模型,而 PyTorch 中 model 是定义的模型类),并修改模型来插入 mask。 然后运行模型时,这些 mask 即会生效。 mask 可在运行时通过算法来调整。
diff --git a/docs/zh_CN/FeatureEngineering/Overview.md b/docs/zh_CN/FeatureEngineering/Overview.md
index d871c1a37c..b8c0f41bd2 100644
--- a/docs/zh_CN/FeatureEngineering/Overview.md
+++ b/docs/zh_CN/FeatureEngineering/Overview.md
@@ -240,16 +240,17 @@ print("Pipeline Score: ", pipeline.score(X_train, y_train))
# 基准测试
-`Baseline` 表示没有进行特征选择,直接将数据传入 LogisticRegression。 此基准测试中,仅用了 10% 的训练数据作为测试数据。
-
-| 数据集 | Baseline | GradientFeatureSelector | TreeBasedClassifier | 训练次数 | 特征数量 |
-| ------------- | -------- | ----------------------- | ------------------- | ---------- | --------- |
-| colon-cancer | 0.7547 | 0.7368 | 0.7223 | 62 | 2,000 |
-| gisette | 0.9725 | 0.89416 | 0.9792 | 6,000 | 5,000 |
-| avazu | 0.8834 | N/A | N/A | 40,428,967 | 1,000,000 |
-| rcv1 | 0.9644 | 0.7333 | 0.9615 | 20,242 | 47,236 |
-| news20.binary | 0.9208 | 0.6870 | 0.9070 | 19,996 | 1,355,191 |
-| real-sim | 0.9681 | 0.7969 | 0.9591 | 72,309 | 20,958 |
-
-此基准测试可在[这里](https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/)下载
-
+`Baseline` 表示没有进行特征选择,直接将数据传入 LogisticRegression。 此基准测试中,仅用了 10% 的训练数据作为测试数据。 对于 GradientFeatureSelector,仅使用了前 20 个特征。 下列指标是在给定测试数据和标签上的平均精度。
+
+| 数据集 | 所有特征 + LR (acc, time, memory) | GradientFeatureSelector + LR (acc, time, memory) | TreeBasedClassifier + LR (acc, time, memory) | 训练次数 | 特征数量 |
+| ------------- | ----------------------------- | ------------------------------------------------ | -------------------------------------------- | ---------- | --------- |
+| colon-cancer | 0.7547, 890ms, 348MiB | 0.7368, 363ms, 286MiB | 0.7223, 171ms, 1171 MiB | 62 | 2,000 |
+| gisette | 0.9725, 215ms, 584MiB | 0.89416, 446ms, 397MiB | 0.9792, 911ms, 234MiB | 6,000 | 5,000 |
+| avazu | 0.8834, N/A, N/A | N/A, N/A, N/A | N/A, N/A, N/A | 40,428,967 | 1,000,000 |
+| rcv1 | 0.9644, 557ms, 241MiB | 0.7333, 401ms, 281MiB | 0.9615, 752ms, 284MiB | 20,242 | 47,236 |
+| news20.binary | 0.9208, 707ms, 361MiB | 0.6870, 565ms, 371MiB | 0.9070, 904ms, 364MiB | 19,996 | 1,355,191 |
+| real-sim | 0.9681, 433ms, 274MiB | 0.7969, 251ms, 274MiB | 0.9591, 643ms, 367MiB | 72,309 | 20,958 |
+
+此基准测试可在[这里](https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/)下载
+
+代码参考 `/examples/feature_engineering/gradient_feature_selector/benchmark_test.py`。
diff --git a/docs/zh_CN/NAS/DARTS.md b/docs/zh_CN/NAS/DARTS.md
new file mode 100644
index 0000000000..4f350efa9f
--- /dev/null
+++ b/docs/zh_CN/NAS/DARTS.md
@@ -0,0 +1,18 @@
+# NNI 中的 DARTS
+
+## 介绍
+
+论文 [DARTS: Differentiable Architecture Search](https://arxiv.org/abs/1806.09055) 通过可微分的方式来解决架构搜索中的伸缩性挑战。 此方法基于架构的连续放松的表示,从而允许在架构搜索时能使用梯度下降。
+
+为了实现,作者在小批量中交替优化网络权重和架构权重。 还进一步探讨了使用二阶优化(unroll)来替代一阶,来提高性能的可能性。
+
+NNI 的实现基于[官方实现](https://github.com/quark0/darts)以及一个[第三方实现](https://github.com/khanrc/pt.darts)。 目前,在 CIFAR10 上从头训练的一阶和二阶优化均已实现。
+
+## 重现结果
+
+为了重现本文的结果,我们做了一阶和二阶优化的实验。 由于时间限制,我们仅从第二阶段重新训练了*一次**最佳架构*。 我们的结果目前与论文的结果相当。 稍后会增加更多结果
+
+| | 论文中 | 重现 |
+| ------------ | ------------- | ---- |
+| 一阶 (CIFAR10) | 3.00 +/- 0.14 | 2.78 |
+| 二阶(CIFAR10) | 2.76 +/- 0.09 | 2.89 |
diff --git a/docs/zh_CN/NAS/ENAS.md b/docs/zh_CN/NAS/ENAS.md
new file mode 100644
index 0000000000..c25b27bc9b
--- /dev/null
+++ b/docs/zh_CN/NAS/ENAS.md
@@ -0,0 +1,7 @@
+# NNI 中的 ENAS
+
+## 介绍
+
+论文 [Efficient Neural Architecture Search via Parameter Sharing](https://arxiv.org/abs/1802.03268) 通过在子模型之间共享参数来加速 NAS 过程。 在 ENAS 中,Contoller 学习在大的计算图中搜索最有子图的方式来发现神经网络。 Controller 通过梯度策略训练,从而选择出能在验证集上有最大期望奖励的子图。 同时对与所选子图对应的模型进行训练,以最小化规范交叉熵损失。
+
+NNI 的实现基于 [Tensorflow 的官方实现](https://github.com/melodyguan/enas),包括了 CIFAR10 上的 Macro/Micro 搜索空间。 NNI 中从头训练的代码还未完成,当前还没有重现结果。
diff --git a/docs/zh_CN/NAS/NasInterface.md b/docs/zh_CN/NAS/NasInterface.md
index 372afc2e0d..c7893036d9 100644
--- a/docs/zh_CN/NAS/NasInterface.md
+++ b/docs/zh_CN/NAS/NasInterface.md
@@ -2,8 +2,6 @@
我们正在尝试通过统一的编程接口来支持各种 NAS 算法,当前处于试验阶段。 这意味着当前编程接口可能会进行重大变化。
-*先前的 [NAS annotation](../AdvancedFeature/GeneralNasInterfaces.md) 接口会很快被弃用。*
-
## 模型的编程接口
在两种场景下需要用于设计和搜索模型的编程接口。
@@ -55,7 +53,7 @@ def forward(self, x):
out = self.input_switch([in_tensor1, in_tensor2, in_tensor3])
...
```
-`InputChoice` 是一个 PyTorch module,初始化时需要元信息,例如,从多少个输入后选中选择多少个输入,初始化的 `InputChoice` 名称。 真正候选的输入张量只能在 `forward` 函数中获得。 在 `InputChoice` 中,`forward` 会在调用时传入实际的候选输入张量。
+`InputChoice` 是一个 PyTorch module,初始化时需要元信息,例如,从多少个输入后选中选择多少个输入,以及初始化的 `InputChoice` 名称。 真正候选的输入张量只能在 `forward` 函数中获得。 在 `forward` 函数中,`InputChoice` 模块需要在 `__init__` 中创建 (如, `self.input_switch`),其会在有了实际候选输入 Tensor 的时候被调用。
一些 [NAS Trainer](#one-shot-training-mode) 需要知道输入张量的来源层,因此在 `InputChoice` 中添加了输入参数 `choose_from` 来表示每个候选输入张量的来源层。 `choose_from` 是 str 的 list,每个元素都是 `LayerChoice` 和`InputChoice` 的 `key`,或者 module 的 name (详情参考[代码](https://github.com/microsoft/nni/blob/master/src/sdk/pynni/nni/nas/pytorch/mutables.py))。
@@ -75,7 +73,7 @@ class Cell(mutables.MutableScope):
## 两种训练模式
-在使用上述 API 在模型中嵌入 搜索空间后,下一步是从搜索空间中找到最好的模型。 有两种驯良模式:[one-shot 训练模式](#one-shot-training-mode) and [经典的分布式搜索](#classic-distributed-search)。
+在使用上述 API 在模型中嵌入 搜索空间后,下一步是从搜索空间中找到最好的模型。 有两种训练模式:[one-shot 训练模式](#one-shot-training-mode) and [经典的分布式搜索](#classic-distributed-search)。
### One-shot 训练模式
@@ -100,9 +98,7 @@ trainer.export(file='./chosen_arch')
不同的 Trainer 可能有不同的输入参数,具体取决于其算法。 详细参数可参考具体的 [Trainer 代码](https://github.com/microsoft/nni/tree/master/src/sdk/pynni/nni/nas/pytorch)。 训练完成后,可通过 `trainer.export()` 导出找到的最好的模型。 无需通过 `nnictl` 来启动 NNI Experiment。
-[这里](./Overview.md#supported-one-shot-nas-algorithms)是所有支持的 Trainer。 [这里](https://github.com/microsoft/nni/tree/master/examples/nas/simple/train.py)是使用 NNI NAS API 的简单示例。
-
-[这里]()是完整示例的代码。
+[这里](Overview.md#supported-one-shot-nas-algorithms)是所有支持的 Trainer。 [这里](https://github.com/microsoft/nni/tree/master/examples/nas/simple/train.py)是使用 NNI NAS API 的简单示例。
### 经典分布式搜索
@@ -174,4 +170,4 @@ NNI 中的 NAS Tuner 需要自动生成搜索空间。 `LayerChoice` 和 `InputC
"_idex": [1]
}
}
-```
\ No newline at end of file
+```
diff --git a/docs/zh_CN/NAS/Overview.md b/docs/zh_CN/NAS/Overview.md
index 7515d7dca6..509900aba5 100644
--- a/docs/zh_CN/NAS/Overview.md
+++ b/docs/zh_CN/NAS/Overview.md
@@ -6,11 +6,11 @@
以此为动力,NNI 的目标是提供统一的体系结构,以加速NAS上的创新,并将最新的算法更快地应用于现实世界中的问题上。
-通过 [统一的接口](NasInterface.md),有两种方式进行架构搜索。 [第一种](#supported-one-shot-nas-algorithms)称为 one-shot NAS,基于搜索空间构建了一个超级网络,并使用 one-shot 训练来生成性能良好的子模型。 [第二种](.ClassicNas.md)是传统的搜索方法,搜索空间中每个子模型作为独立的 Trial 运行,将性能结果发给 Tuner,由 Tuner 来生成新的子模型。
+通过[统一的接口](./NasInterface.md),有两种方式进行架构搜索。 [第一种](#supported-one-shot-nas-algorithms)称为 one-shot NAS,基于搜索空间构建了一个超级网络,并使用 one-shot 训练来生成性能良好的子模型。 [第二种](./NasInterface.md#classic-distributed-search)是传统的搜索方法,搜索空间中每个子模型作为独立的 Trial 运行,将性能结果发给 Tuner,由 Tuner 来生成新的子模型。
* [支持的 One-shot NAS 算法](#supported-one-shot-nas-algorithms)
-* [使用 NNI Experiment 的经典分布式 NAS](.NasInterface.md#classic-distributed-search)
-* [NNI NAS 编程接口](.NasInterface.md)
+* [使用 NNI Experiment 的经典分布式 NAS](./NasInterface.md#classic-distributed-search)
+* [NNI NAS 编程接口](./NasInterface.md)
## 支持的 One-shot NAS 算法
@@ -37,7 +37,7 @@ NNI 现在支持以下 NAS 算法,并且正在添加更多算法。 用户可
#### 用法
-NNI 中的 ENAS 还在开发中,当前仅支持在 CIFAR10 上 Macro/Micro 搜索空间的搜索阶段。 在 PTB 上从头开始训练及其搜索空间尚未完成。
+NNI 中的 ENAS 还在开发中,当前仅支持在 CIFAR10 上 Macro/Micro 搜索空间的搜索阶段。 在 PTB 上从头开始训练及其搜索空间尚未完成。 [详细说明](ENAS.md)。
```bash
#如果未克隆 NNI 代码。 如果代码已被克隆,请忽略此行并直接进入代码目录。
@@ -58,7 +58,7 @@ python3 search.py -h
### DARTS
-[DARTS: Differentiable Architecture Search](https://arxiv.org/abs/1806.09055) 在算法上的主要贡献是,引入了一种在两级网络优化中使用的可微分算法。
+[DARTS: Differentiable Architecture Search](https://arxiv.org/abs/1806.09055) 在算法上的主要贡献是,引入了一种在两级网络优化中使用的可微分算法。 [详细说明](DARTS.md)。
#### 用法
@@ -97,8 +97,6 @@ python3 retrain.py --arc-checkpoint ../pdarts/checkpoints/epoch_2.json
注意,我们正在尝试通过统一的编程接口来支持各种 NAS 算法,当前处于试验阶段。 这意味着当前编程接口将来会有变化。
-*先前的 [NAS annotation](../AdvancedFeature/GeneralNasInterfaces.md) 接口会很快被弃用。*
-
### 编程接口
在两种场景下需要用于设计和搜索模型的编程接口。
diff --git a/docs/zh_CN/Overview.md b/docs/zh_CN/Overview.md
index c37b16f53c..45f717905a 100644
--- a/docs/zh_CN/Overview.md
+++ b/docs/zh_CN/Overview.md
@@ -45,6 +45,36 @@ Experiment 的运行过程为:Tuner 接收搜索空间并生成配置。 这
更多 Experiment 运行的详情,参考[快速入门](Tutorial/QuickStart.md)。
+## 核心功能
+
+NNI 提供了并行运行多个实例以查找最佳参数组合的能力。 此功能可用于各种领域,例如,为深度学习模型查找最佳超参数,或查找具有真实数据的数据库和其他复杂系统的最佳配置。
+
+NNI 还希望提供用于机器学习和深度学习的算法工具包,尤其是神经体系结构搜索(NAS)算法,模型压缩算法和特征工程算法。
+
+### 超参调优
+
+这是 NNI 最核心、基本的功能,其中提供了许多流行的[自动调优算法](Tuner/BuiltinTuner.md) (即 Tuner) 以及 [提前终止算法](Assessor/BuiltinAssessor.md) (即 Assessor)。 可查看[快速入门](Tutorial/QuickStart.md)来调优模型或系统。 基本上通过以上三步,就能开始NNI Experiment。
+
+### 通用 NAS 框架
+
+此 NAS 框架可供用户轻松指定候选的神经体系结构,例如,可以为单个层指定多个候选操作(例如,可分离的 conv、扩张 conv),并指定可能的跳过连接。 NNI 将自动找到最佳候选。 另一方面,NAS 框架为其他类型的用户(如,NAS 算法研究人员)提供了简单的接口,以实现新的 NAS 算法。 详情及用法参考[这里](NAS/Overview.md)。
+
+NNI 通过 Trial SDK 支持多种 one-shot NAS 算法,如:ENAS、DARTS。 使用这些算法时,不需启动 NNI Experiment。 在 Trial 代码中加入算法,直接运行即可。 如果要调整算法中的超参数,或运行多个实例,可以使用 Tuner 并启动 NNI Experiment。
+
+除了 one-shot NAS 外,NAS 还能以 NNI 模式运行,其中每个候选的网络结构都作为独立 Trial 任务运行。 在此模式下,与超参调优类似,必须启动 NNI Experiment 并为 NAS 选择 Tuner。
+
+### 模型压缩
+
+NNI 上的模型压缩包括剪枝和量化算法。 这些算法通过 NNI Trial SDK 提供。 可以直接在 Trial 代码中使用,并在不启动 NNI Experiment 的情况下运行 Trial 代码。 详情及用法参考[这里](Compressor/Overview.md)。
+
+模型压缩中有不同的超参。 一种类型是在输入配置中的超参,例如,压缩算法的稀疏性、量化的位宽。 另一种类型是压缩算法的超参。 NNI 的超参调优可以自动找到最佳的压缩模型。 参考[简单示例](Compressor/AutoCompression.md)。
+
+### 自动特征工程
+
+自动特征工程,为下游任务找到最有效的特征。 详情及用法参考[这里](FeatureEngineering/Overview.md)。 通过 NNI Trial SDK 支持,不必创建 NNI Experiment。 只需在 Trial 代码中加入内置的自动特征工程算法,然后直接运行 Trial 代码。
+
+自动特征工程算法通常有一些超参。 如果要自动调整这些超参,可以利用 NNI 的超参数调优,即选择调优算法(即 Tuner)并启动 NNI Experiment。
+
## 了解更多信息
* [入门](Tutorial/QuickStart.md)
@@ -56,4 +86,7 @@ Experiment 的运行过程为:Tuner 接收搜索空间并生成配置。 这
* [如何在本机上运行 Experiment?](TrainingService/LocalMode.md)
* [如何在多机上运行 Experiment?](TrainingService/RemoteMachineMode.md)
* [如何在 OpenPAI 上运行 Experiment?](TrainingService/PaiMode.md)
-* [示例](TrialExample/MnistExamples.md)
\ No newline at end of file
+* [示例](TrialExample/MnistExamples.md)
+* [NNI 上的神经网络架构搜索](NAS/Overview.md)
+* [NNI 上的自动模型压缩](Compressor/Overview.md)
+* [NNI 上的自动特征工程](FeatureEngineering/Overview.md)
\ No newline at end of file
diff --git a/docs/zh_CN/Release.md b/docs/zh_CN/Release.md
index 99429e668e..b4ba5a1b84 100644
--- a/docs/zh_CN/Release.md
+++ b/docs/zh_CN/Release.md
@@ -1,25 +1,135 @@
# 更改日志
+## 发布 1.2 - 12/02/2019
+
+### 主要功能
+
+* [特征工程](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/FeatureEngineering/Overview.md)
+ - 新增特征工程接口
+ - 特征选择算法: [Gradient feature selector](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/FeatureEngineering/GradientFeatureSelector.md) & [GBDT selector](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/FeatureEngineering/GBDTSelector.md)
+ - [特征工程示例](https://github.com/microsoft/nni/tree/v1.2/examples/feature_engineering)
+- 神经网络结构搜索在 NNI 上的应用
+ - [新的 NAS 接口](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/NAS/NasInterface.md)
+ - NAS 算法: [ENAS](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/NAS/Overview.md#enas), [DARTS](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/NAS/Overview.md#darts), [P-DARTS](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/NAS/Overview.md#p-darts) (PyTorch)
+ - 经典模式下的 NAS(每次 Trial 独立运行)
+- 模型压缩
+ - [新增模型剪枝算法](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/Compressor/Overview.md): lottery ticket 修剪, L1Filter Pruner, Slim Pruner, FPGM Pruner
+ - [新增模型量化算法](https://github.com/microsoft/nni/blob/v1.2/docs/zh_CN/Compressor/Overview.md): QAT Quantizer, DoReFa Quantizer
+ - 支持导出压缩后模型的 API。
+- 训练平台
+ - 支持 OpenPAI 令牌身份验证
+- 示例:
+ - [使用 NNI 自动调优 rocksdb 配置的示例](https://github.com/microsoft/nni/tree/v1.2/examples/trials/systems/rocksdb-fillrandom)。
+ - [新的支持 TensorFlow 2.0 的 Trial 示例](https://github.com/microsoft/nni/tree/v1.2/examples/trials/mnist-tfv2)。
+- 改进
+ - 远程训练平台中不需要 GPU 的 Trial 任务改为使用随机调度,不再使用轮询调度。
+ - 添加 pylint 规则来检查拉取请求,新的拉取请求需要符合 [pylint 规则](https://github.com/microsoft/nni/blob/v1.2/pylintrc)。
+- Web 门户和用户体验
+ - 支持用户添加自定义 Trial。
+ - 除了超参外,用户可放大缩小详细图形。
+- 文档
+ - 改进了 NNI API 文档,增加了更多的 docstring。
+
+### 修复的 Bug
+
+- 修复当失败的 Trial 没有指标时,表格的排序问题。 -Issue #1773
+- 页面切换时,保留选择的(最大、最小)状态。 -PR#1710
+- 使超参数图的默认指标 yAxis 更加精确。 -PR#1736
+- 修复 GPU 脚本权限问题。 -Issue #1665
+
+## 发布 1.1 - 10/23/2019
+
+### 主要功能
+
+* 新 Tuner: [PPO Tuner](https://github.com/microsoft/nni/blob/v1.1/docs/zh_CN/Tuner/PPOTuner.md)
+* [查看已停止的 Experiment](https://github.com/microsoft/nni/blob/v1.1/docs/zh_CN/Tutorial/Nnictl.md#view)
+* Tuner 可使用专门的 GPU 资源(参考[教程](https://github.com/microsoft/nni/blob/v1.1/docs/zh_CN/Tutorial/ExperimentConfig.md)中的 `gpuIndices` 了解详情)
+* 改进 WEB 界面
+ - Trial 详情页面可列出每个 Trial 的超参,以及开始结束时间(需要通过 "add column" 添加)
+ - 优化大型 Experiment 的显示性能
+- 更多示例
+ - [EfficientNet PyTorch 示例](https://github.com/ultmaster/EfficientNet-PyTorch)
+ - [Cifar10 NAS 示例](https://github.com/microsoft/nni/blob/v1.1/examples/trials/nas_cifar10/README_zh_CN.md)
+- [模型压缩工具包 - Alpha 发布](https://github.com/microsoft/nni/blob/v1.1/docs/zh_CN/Compressor/Overview.md):我们很高兴的宣布 NNI 的模型压缩工具包发布了。它还处于试验阶段,会根据使用反馈来改进。 诚挚邀请您使用、反馈,或更多贡献
+
+### 修复的 Bug
+
+* 当搜索空间结束后,多阶段任务会死锁 (issue #1204)
+* 没有日志时,`nnictl` 会失败 (issue #1548)
+
+## 发布1.0 - 9/2/2019
+
+### 主要功能
+
+* Tuners 和 Assessors
+
+ - 支持自动特征生成和选择 -Issue#877 -PR #1387 + 提供自动特征接口 + 基于 Beam 搜索的 Tuner + [添加 Pakdd 示例](https://github.com/microsoft/nni/tree/master/examples/trials/auto-feature-engineering)
+ - 添加并行算法提高 TPE 在高并发下的性能。 -PR #1052
+ - 为 hyperband 支持多阶段 -PR #1257
+- 训练平台
+
+ - 支持私有 Docker Registry -PR #755
+
+
+ * 改进
+ * 增加 RestFUL API 的 Python 包装,支持通过代码获取指标的值 PR #1318
+ * 新的 Python API : get_experiment_id(), get_trial_id() -PR #1353 -Issue #1331 & -Issue#1368
+ * 优化 NAS 搜索空间 -PR #1393
+ + 使用 _type 统一 NAS 搜索空间 -- "mutable_type"e
+ + 更新随机搜索 Tuner
+ + 将 gpuNum 设为可选 -Issue #1365
+ + 删除 OpenPAI 模式下的 outputDir 和 dataDir 配置 -Issue #1342
+ + 在 Kubeflow 模式下创建 Trial 时,codeDir 不再被拷贝到 logDir -Issue #1224
++ Web 门户和用户体验
+
+ - 在 Web 界面的搜索过程中显示最好指标的曲线 -Issue #1218
+ - 在多阶段 Experiment 中,显示参数列表的当前值 -Issue1210 -PR #1348
+ - 在 AddColumn 中增加 "Intermediate count" 选项。 -Issue #1210
+ - 在 Web 界面中支持搜索参数的值 -Issue #1208
+ - 在默认指标图中,启用指标轴的自动缩放 -Issue #1360
+ - 在命令行中为 nnictl 命令增加详细文档的连接 -Issue #1260
+ - 用户体验改进:显示 Error 日志 -Issue #1173
+- 文档
+
+ - 更新文档结构 -Issue #1231
+ - [多阶段文档的改进](AdvancedFeature/MultiPhase.md) -Issue #1233 -PR #1242 + 增加配置示例
+ - [Web 界面描述改进](Tutorial/WebUI.md) -PR #1419
+
+### 修复的 Bug
+
+* (Bug 修复)修复 0.9 版本中的链接 -Issue #1236
+* (Bug 修复)自动完成脚本
+* (Bug 修复) 修复管道中仅检查脚本中最后一个命令退出代码的问题。 -PR #1417
+* (Bug 修复) Tuner 的 quniform -Issue #1377
+* (Bug fix) 'quniform' 在 GridSearch 和其它 Tuner 之间的含义不同。 -Issue #1335
+* (Bug 修复)"nnictl experiment list" 将 "RUNNING" 状态的 Experiment 显示为了 "INITIALIZED" -PR #1388
+* (Bug 修复) 在 NNI dev 安装模式下无法安装 SMAC。 -Issue #1376
+* (Bug 修复) 无法点击中间结果的过滤按钮 -Issue #1263
+* (Bug 修复) API "/api/v1/nni/trial-jobs/xxx" 在多阶段 Experiment 无法显示 Trial 的所有参数 -Issue #1258
+* (Bug 修复) 成功的 Trial 没有最终结果,但 Web 界面显示成了 ×××(FINAL) -Issue #1207
+* (Bug 修复) nnictl stop -Issue #1298
+* (Bug 修复) 修复安全警告
+* (Bug 修复) 超参页面损坏 -Issue #1332
+* (Bug 修复) 运行 flake8 测试来查找 Python 语法错误和未定义的名称 -PR #1217
+
## 发布 0.9 - 7/1/2019
### 主要功能
-* 生成 NAS 编程接口
+* 通用 NAS 编程接口
* 为 NAS 接口添加 `enas-mode` 和 `oneshot-mode`:[PR #1201](https://github.com/microsoft/nni/pull/1201#issue-291094510)
* [有 Matern 核的高斯 Tuner](Tuner/GPTuner.md)
* 支持多阶段 Experiment
-
+
* 为多阶段 Experiment 增加新的训练平台:pai 模式从 v0.9 开始支持多阶段 Experiment。
- * 为以下内置 Tuner 增加多阶段的功能:
-
-
- * TPE, Random Search, Anneal, Naïve Evolution, SMAC, Network Morphism, Metis Tuner。
-
- 有关详细信息,参考[实现多阶段的 Tuner](AdvancedFeature/MultiPhase.md)。
+ * 为以下内置 Tuner 增加多阶段的功能:
+ * TPE, Random Search, Anneal, Naïve Evolution, SMAC, Network Morphism, Metis Tuner。
+
+ 有关详细信息,参考[实现多阶段的 Tuner](AdvancedFeature/MultiPhase.md)。
* Web 界面
-
+
* 在 Web 界面中可比较 Trial。 有关详细信息,参考[查看 Trial 状态](Tutorial/WebUI.md)
* 允许用户调节 Web 界面的刷新间隔。 有关详细信息,参考[查看概要页面](Tutorial/WebUI.md)
* 更友好的显示中间结果。 有关详细信息,参考[查看 Trial 状态](Tutorial/WebUI.md)
@@ -48,7 +158,7 @@
* 在已经运行非 NNI 任务的 GPU 上也能运行 Trial
* 支持 Kubeflow v1beta2 操作符
* 支持 Kubeflow TFJob/PyTorchJob v1beta2
-* [生成 NAS 编程接口](AdvancedFeature/GeneralNasInterfaces.md)
+* [通用 NAS 编程接口](AdvancedFeature/GeneralNasInterfaces.md)
* 实现了 NAS 的编程接口,可通过 NNI Annotation 很容易的表达神经网络架构搜索空间
* 提供新命令 `nnictl trial codegen` 来调试 NAS 代码生成部分
* 提供 NAS 编程接口教程,NAS 在 MNIST 上的示例,用于 NAS 的可定制的随机 Tuner
@@ -251,12 +361,12 @@
### NNICTL 的新功能和更新
* 支持同时运行多个 Experiment。
-
+
在 v0.3 以前,NNI 仅支持一次运行一个 Experiment。 此版本开始,用户可以同时运行多个 Experiment。 每个 Experiment 都需要一个唯一的端口,第一个 Experiment 会像以前版本一样使用默认端口。 需要为其它 Experiment 指定唯一端口:
-
- ```bash
- nnictl create --port 8081 --config
- ```
+
+ ```bash
+ nnictl create --port 8081 --config
+ ```
* 支持更新最大 Trial 的数量。 使用 `nnictl update --help` 了解详情。 或参考 [NNICTL](Tutorial/Nnictl.md) 查看完整帮助。
@@ -265,15 +375,15 @@
* 不兼容的改动:nn.get_parameters() 改为 nni.get_next_parameter。 所有以前版本的样例将无法在 v0.3 上运行,需要重新克隆 NNI 代码库获取新样例。 如果在自己的代码中使用了 NNI,也需要相应的更新。
* 新 API **nni.get_sequence_id()**。 每个 Trial 任务都会被分配一个唯一的序列数字,可通过 nni.get_sequence_id() API 来获取。
-
- ```bash
- git clone -b v0.3 https://github.com/microsoft/nni.git
- ```
+
+ ```bash
+ git clone -b v0.3 https://github.com/microsoft/nni.git
+ ```
* **nni.report_final_result(result)** API 对结果参数支持更多的数据类型。
-
+
可用类型:
-
+
* int
* float
* 包含有 'default' 键值的 dict,'default' 的值必须为 int 或 float。 dict 可以包含任何其它键值对。
@@ -284,11 +394,11 @@
### 新示例
-* 公开的 NNI Docker 映像:
-
- ```bash
- docker pull msranni/nni:latest
- ```
+* 公共的 NNI Docker 映像:
+
+ ```bash
+ docker pull msranni/nni:latest
+ ```
* 新的 Trial 样例:[NNI Sklearn 样例](https://github.com/microsoft/nni/tree/master/examples/trials/sklearn)
diff --git a/docs/zh_CN/TrainingService/FrameworkControllerMode.md b/docs/zh_CN/TrainingService/FrameworkControllerMode.md
index 6f6d6cc417..4c964d1e9b 100644
--- a/docs/zh_CN/TrainingService/FrameworkControllerMode.md
+++ b/docs/zh_CN/TrainingService/FrameworkControllerMode.md
@@ -44,7 +44,7 @@ maxExecDuration: 10h
maxTrialNum: 100
#可选项: local, remote, pai, kubeflow, frameworkcontroller
trainingServicePlatform: frameworkcontroller
-searchSpacePath: ~/nni/examples/trials/mnist/search_space.json
+searchSpacePath: ~/nni/examples/trials/mnist-tfv1/search_space.json
#可选项: true, false
useAnnotation: false
tuner:
@@ -59,7 +59,7 @@ assessor:
optimize_mode: maximize
gpuNum: 0
trial:
- codeDir: ~/nni/examples/trials/mnist
+ codeDir: ~/nni/examples/trials/mnist-tfv1
taskRoles:
- name: worker
taskNum: 1
diff --git a/docs/zh_CN/TrainingService/KubeflowMode.md b/docs/zh_CN/TrainingService/KubeflowMode.md
index 6e2f58f07e..c4c2184e2a 100644
--- a/docs/zh_CN/TrainingService/KubeflowMode.md
+++ b/docs/zh_CN/TrainingService/KubeflowMode.md
@@ -78,7 +78,7 @@ kubeflowConfig:
## 运行 Experiment
-以 `examples/trials/mnist` 为例。 这是一个 TensorFlow 作业,使用了 Kubeflow 的 tf-operator。 NNI 的 YAML 配置文件如下:
+以 `examples/trials/mnist-tfv1` 为例。 这是一个 TensorFlow 作业,使用了 Kubeflow 的 tf-operator。 NNI 的 YAML 配置文件如下:
```yaml
authorName: default
diff --git a/docs/zh_CN/TrainingService/LocalMode.md b/docs/zh_CN/TrainingService/LocalMode.md
index 9113653e6e..0268e66b34 100644
--- a/docs/zh_CN/TrainingService/LocalMode.md
+++ b/docs/zh_CN/TrainingService/LocalMode.md
@@ -1,6 +1,6 @@
# **教程:使用 NNI API 在本地创建和运行 Experiment**
-本教程会使用 [~/examples/trials/mnist] 样例来解释如何在本地使用 NNI API 来创建并运行 Experiment。
+本教程会使用 [~/examples/trials/mnist-tfv1] 样例来解释如何在本地使用 NNI API 来创建并运行 Experiment。
> 在开始前
diff --git a/docs/zh_CN/TrainingService/RemoteMachineMode.md b/docs/zh_CN/TrainingService/RemoteMachineMode.md
index fedae2dc7b..eba05921b5 100644
--- a/docs/zh_CN/TrainingService/RemoteMachineMode.md
+++ b/docs/zh_CN/TrainingService/RemoteMachineMode.md
@@ -16,9 +16,9 @@ NNI 支持通过 SSH 通道在多台计算机上运行 Experiment,称为 `remo
## 运行 Experiment
-在另一台计算机,或在其中任何一台上安装 NNI,并运行 nnictl 工具。
+将 NNI 安装在可以访问上述三台计算机的网络的另一台计算机上,或者仅在三台计算机中的任何一台上运行 `nnictl` 即可启动 Experiment。
-以 `examples/trials/mnist-annotation` 为例。 `cat ~/nni/examples/trials/mnist-annotation/config_remote.yml` 来查看详细配置:
+以 `examples/trials/mnist-annotation` 为例。 此处示例在 `examples/trials/mnist-annotation/config_remote.yml`:
```yaml
authorName: default
@@ -58,27 +58,13 @@ machineList:
passwd: bob123
```
-可以使用不同系统来在远程计算机上运行 Experiment。
-
-#### Linux 和 macOS
-
-填好 `machineList` 部分,然后运行:
-
-```bash
-nnictl create --config ~/nni/examples/trials/mnist-annotation/config_remote.yml
-```
-
-来启动 Experiment。
-
-#### Windows
-
-填好 `machineList` 部分,然后运行:
+`codeDir` 中的文件会被自动上传到远程服务器。 可在不同的操作系统上运行 NNI (Windows, Linux, MacOS),来在远程机器上(仅支持 Linux)运行 Experiment。
```bash
-nnictl create --config %userprofile%\nni\examples\trials\mnist-annotation\config_remote.yml
+nnictl create --config examples/trials/mnist-annotation/config_remote.yml
```
-来启动 Experiment。
+也可使用公钥/私钥对,而非用户名/密码进行身份验证。 有关高级用法,请参考[实验配置参考](../Tutorial/ExperimentConfig.md)。
## 版本校验
diff --git a/docs/zh_CN/TrialExample/KDExample.md b/docs/zh_CN/TrialExample/KDExample.md
new file mode 100644
index 0000000000..8f669b3d6d
--- /dev/null
+++ b/docs/zh_CN/TrialExample/KDExample.md
@@ -0,0 +1,33 @@
+NNI Compressor 上使用知识蒸馏
+===
+
+## 知识蒸馏 (Knowledge Distillation)
+
+知识蒸馏,在 [Distilling the Knowledge in a Neural Networ](https://arxiv.org/abs/1503.02531) 中,压缩模型被训练成模拟预训练的大模型。 这种训练设置也称为"师生(teacher-student)"方式,其中大模型是教师,小模型是学生。
+
+
+
+### 用法
+
+PyTorch 代码
+
+```python
+from knowledge_distill.knowledge_distill import KnowledgeDistill
+kd = KnowledgeDistill(kd_teacher_model, kd_T=5)
+alpha = 1
+beta = 0.8
+for batch_idx, (data, target) in enumerate(train_loader):
+ data, target = data.to(device), target.to(device)
+ optimizer.zero_grad()
+ output = model(data)
+ loss = F.cross_entropy(output, target)
+ # 只需要添加以下行来使用知识蒸馏微调模型
+ loss = alpha * loss + beta * kd.loss(data=data, student_out=output)
+ loss.backward()
+```
+
+#### 知识蒸馏的用户配置
+* **kd_teacher_model:** 预训练过的教师模型
+* **kd_T:** 用于平滑教师模型输出的温度。
+
+完整代码可在这里找到
\ No newline at end of file
diff --git a/docs/zh_CN/TrialExample/MnistExamples.md b/docs/zh_CN/TrialExample/MnistExamples.md
index c1402f0edc..04eeddd20d 100644
--- a/docs/zh_CN/TrialExample/MnistExamples.md
+++ b/docs/zh_CN/TrialExample/MnistExamples.md
@@ -2,7 +2,8 @@
在深度学习中,用 CNN 来分类 MNIST 数据,就像介绍编程语言中的 `hello world` 样例。 因此,NNI 将 MNIST 作为样例来介绍功能。 样例如下:
-- [MNIST 中使用 NNI API](#mnist)
+- [MNIST 中使用 NNI API (TensorFlow v1.x)](#mnist-tfv1)
+- [MNIST 中使用 NNI API (TensorFlow v2.x)](#mnist-tfv2)
- [MNIST 中使用 NNI 标记(annotation)](#mnist-annotation)
- [在 Keras 中使用 MNIST](#mnist-keras)
- [MNIST -- 用批处理 Tuner 来调优](#mnist-batch)
@@ -11,12 +12,19 @@
- [用 Kubeflow 运行分布式的 MNIST (tensorflow)](#mnist-kubeflow-tf)
- [用 Kubeflow 运行分布式的 MNIST (PyTorch)](#mnist-kubeflow-pytorch)
-
-**MNIST 中使用 NNI API**
+
+**MNIST 中使用 NNI API (TensorFlow v1.x)**
这是个简单的卷积网络,有两个卷积层,两个池化层和一个全连接层。 调优的超参包括 dropout 比率,卷积层大小,隐藏层(全连接层)大小等等。 它能用 NNI 中大部分内置的 Tuner 来调优,如 TPE,SMAC,Random。 样例的 YAML 文件也启用了评估器来提前终止一些中间结果不好的尝试。
-`代码目录: examples/trials/mnist/`
+`代码目录: examples/trials/mnist-tfv1/`
+
+
+**MNIST 中使用 NNI API (TensorFlow v2.x)**
+
+与上述示例的网络相同,但使用了 TensorFlow v2.x Keras API。
+
+`代码目录: examples/trials/mnist-tfv2/`
**MNIST 中使用 NNI 标记(annotation)**
diff --git a/docs/zh_CN/TrialExample/RocksdbExamples.md b/docs/zh_CN/TrialExample/RocksdbExamples.md
index 1ba39fdc63..3e4665d907 100644
--- a/docs/zh_CN/TrialExample/RocksdbExamples.md
+++ b/docs/zh_CN/TrialExample/RocksdbExamples.md
@@ -10,9 +10,9 @@ RocksDB 的性能表现非常依赖于调优操作。 但由于其底层技术
db_bench 已经加入到了 `PATH` 中。 参考[这里](../Tutorial/QuickStart.md),了解如何安装并准备 NNI 环境,参考[这里](https://github.com/facebook/rocksdb/blob/master/INSTALL.md)来编译 RocksDB 以及 `db_bench`。
-此简单脚本 [`db_bench_installation.sh`](../../../examples/trials/systems/rocksdb-fillrandom/db_bench_installation.sh) 可帮助编译并在 Ubuntu 上安装 `db_bench` 及其依赖包。 可遵循相同的过程在其它系统中安装 RocksDB。
+此简单脚本 [`db_bench_installation.sh`](https://github.com/microsoft/nni/tree/master/examples/trials/systems/rocksdb-fillrandom/db_bench_installation.sh) 可帮助编译并在 Ubuntu 上安装 `db_bench` 及其依赖包。 可遵循相同的过程在其它系统中安装 RocksDB。
-*代码目录:[`example/trials/systems/rocksdb-fillrandom`](../../../examples/trials/systems/rocksdb-fillrandom)*
+*代码路径:[`example/trials/systems/rocksdb-fillrandom`](https://github.com/microsoft/nni/tree/master/examples/trials/systems/rocksdb-fillrandom)*
@@ -48,7 +48,7 @@ db_bench 已经加入到了 `PATH` 中。 参考[这里](../Tutorial/Quic
```
-*代码目录:[`example/trials/systems/rocksdb-fillrandom/search_space.json`](../../../examples/trials/systems/rocksdb-fillrandom/search_space.json)*
+*代码路径:[`example/trials/systems/rocksdb-fillrandom/search_space.json`](https://github.com/microsoft/nni/tree/master/examples/trials/systems/rocksdb-fillrandom/search_space.json)*
@@ -59,7 +59,7 @@ db_bench 已经加入到了 `PATH` 中。 参考[这里](../Tutorial/Quic
* 使用 `nni.get_next_parameter()` 来获取下一个系统配置。
* 使用 `nni.report_final_result(metric)` 来返回测试结果。
-*代码目录:[`example/trials/systems/rocksdb-fillrandom/main.py`](../../../examples/trials/systems/rocksdb-fillrandom/main.py)*
+*代码路径:[`example/trials/systems/rocksdb-fillrandom/main.py`](https://github.com/microsoft/nni/tree/master/examples/trials/systems/rocksdb-fillrandom/main.py)*
@@ -69,11 +69,11 @@ db_bench 已经加入到了 `PATH` 中。 参考[这里](../Tutorial/Quic
这是使用 SMAC 算法调优 RocksDB 的示例:
-*代码目录:[`example/trials/systems/rocksdb-fillrandom/config_smac.yml`](../../../examples/trials/systems/rocksdb-fillrandom/config_smac.yml)*
+*代码路径:[`example/trials/systems/rocksdb-fillrandom/config_smac.yml`](https://github.com/microsoft/nni/tree/master/examples/trials/systems/rocksdb-fillrandom/config_smac.yml)*
这是使用 TPE 算法调优 RocksDB 的示例:
-*代码目录: [`example/trials/systems/rocksdb-fillrandom/config_tpe.yml`](../../../examples/trials/systems/rocksdb-fillrandom/config_tpe.yml)*
+*代码路径:[`example/trials/systems/rocksdb-fillrandom/config_tpe.yml`](https://github.com/microsoft/nni/tree/master/examples/trials/systems/rocksdb-fillrandom/config_tpe.yml)*
其它 Tuner 算法可以通过相同的方式来使用。 参考[这里](../Tuner/BuiltinTuner.md)了解详情。
@@ -105,7 +105,7 @@ nnictl create --config ./config_tpe.yml
详细的实验结果如下图所示。 水平轴是 Trial 的顺序。 垂直轴是指标,此例中为写入的 OPS。 蓝点表示使用的是 SMAC Tuner,橙色表示使用的是 TPE Tuner。
-
+
下表列出了两个 Tuner 获得的最佳 Trial 以及相应的参数和指标。 不出所料,两个 Tuner 都为 `fillrandom` 测试找到了一样的最佳配置。
diff --git a/docs/zh_CN/TrialExample/SquadEvolutionExamples.md b/docs/zh_CN/TrialExample/SquadEvolutionExamples.md
index 732b639605..89e7165227 100644
--- a/docs/zh_CN/TrialExample/SquadEvolutionExamples.md
+++ b/docs/zh_CN/TrialExample/SquadEvolutionExamples.md
@@ -113,22 +113,18 @@ trial:
gpuNum: 0
cpuNum: 1
memoryMB: 32869
- #在 OpenPAI 上运行 NNI 任务的 Docker 映像
+ # 在 OpenPAI 上运行 NNI 的 Docker 映像
image: msranni/nni:latest
- #在 OpenPAI 的 hdfs 目录上存储数据的目录,如:'hdfs://host:port/directory'
- dataDir: hdfs://10.10.10.10:9000/username/nni
- #在 OpenPAI 的 hdfs 目录上存储输出的目录,如:'hdfs://host:port/directory'
- outputDir: hdfs://10.10.10.10:9000/username/nni
paiConfig:
- #登录 OpenPAI 的用户名
+ # 登录 OpenPAI 的用户名
userName: username
- #登录 OpenPAI 的密码
+ # 登录 OpenPAI 的密码
passWord: password
- # OpenPAI 的 RESTful 服务器地址
+ # OpenPAI 的 RestFUL 服务器地址
host: 10.10.10.10
```
-将默认值改为个人账户和服务器信息。 包括 `nniManagerIp`, `dataDir`, `outputDir`, `userName`, `passWord` 和 `host`。
+将默认值改为个人账户和服务器信息。 包括 `nniManagerIp`, `userName`, `passWord` 和 `host`。
在 "Trial" 部分中,如果需要使用 GPU 来进行架构搜索,可将 `gpuNum` 从 `0` 改为 `1`。 根据训练时长,可以增加 `maxTrialNum` 和 `maxExecDuration`。
diff --git a/docs/zh_CN/TrialExample/Trials.md b/docs/zh_CN/TrialExample/Trials.md
index 1af7370190..18d4dc6235 100644
--- a/docs/zh_CN/TrialExample/Trials.md
+++ b/docs/zh_CN/TrialExample/Trials.md
@@ -132,6 +132,24 @@ Annotation 的语法和用法等,参考 [Annotation](../Tutorial/AnnotationSpe
useAnnotation: true
+## 用于调试的独立模式
+
+NNI 支持独立模式,使 Trial 代码无需启动 NNI 实验即可运行。 这样能更容易的找出 Trial 代码中的 Bug。 NNI Annotation 天然支持独立模式,因为添加的 NNI 相关的行都是注释的形式。 NNI Trial API 在独立模式下的行为有所变化,某些 API 返回虚拟值,而某些 API 不报告值。 有关这些 API 的完整列表,请参阅下表。
+
+```python
+#注意:请为 Trial 代码中的超参分配默认值
+nni.get_next_parameter#返回 {}
+nni.report_final_result#已在 stdout 上打印日志,但不报告
+nni.report_intermediate_result#已在 stdout 上打印日志,但不报告
+nni.get_experiment_id#返回 "STANDALONE"
+nni.get_trial_id#返回 "STANDALONE"
+nni.get_sequence_id#返回 0
+```
+
+可使用 [mnist 示例](https://github.com/microsoft/nni/tree/master/examples/trials/mnist-tfv1) 来尝试独立模式。 只需在代码目录下运行 `python3 mnist.py`。 Trial 代码会使用默认超参成功运行。
+
+更多调试的信息,可参考[调试指南](../Tutorial/HowToDebug.md)。
+
## Trial 存放在什么地方?
### 本机模式
@@ -162,7 +180,7 @@ echo $? `date +%s%3N` >/home/user_name/nni/experiments/$experiment_id$/trials/$t
-## 更多 Trial 的样例
+## 更多 Trial 的示例
* [MNIST 样例](MnistExamples.md)
* [为 CIFAR 10 分类找到最佳的 optimizer](Cifar10Examples.md)
diff --git a/docs/zh_CN/Tuner/CustomizeAdvisor.md b/docs/zh_CN/Tuner/CustomizeAdvisor.md
index 08a3dcae93..5f0e7e1ed8 100644
--- a/docs/zh_CN/Tuner/CustomizeAdvisor.md
+++ b/docs/zh_CN/Tuner/CustomizeAdvisor.md
@@ -35,4 +35,4 @@ advisor:
## 示例
-[参考示例](../../../examples/tuners/mnist_keras_customized_advisor)。
\ No newline at end of file
+参考[示例](https://github.com/microsoft/nni/tree/master/examples/tuners/mnist_keras_customized_advisor)。
\ No newline at end of file
diff --git a/docs/zh_CN/Tutorial/Contributing.md b/docs/zh_CN/Tutorial/Contributing.md
index 8f7c752b06..a4f58ba79e 100644
--- a/docs/zh_CN/Tutorial/Contributing.md
+++ b/docs/zh_CN/Tutorial/Contributing.md
@@ -46,6 +46,8 @@
* 有关 docstrings,参考 [numpydoc docstring 指南](https://numpydoc.readthedocs.io/en/latest/format.html) 和 [pandas docstring 指南](https://python-sprints.github.io/pandas/guide/pandas_docstring.html)
* 函数的 docstring, **description**, **Parameters**, 以及**Returns**/**Yields** 是必需的。
* 类的 docstring, **description**, **Attributes** 是必需的。
+ * 描述 `dict` 的 docstring 在超参格式描述中多处用到,参考 [RiboKit : 文档标准
+ * 写作标准的内部准则](https://ribokit.github.io/docs/text/)
## 文档
@@ -56,4 +58,4 @@
* 需要链接时,尽量使用**相对路径**。 但如果文档是 Markdown 格式的,并且:
* 图片需要通过嵌入的 HTML 语法来格式化,则需要使用绝对链接,如 `https://user-images.githubusercontent.com/44491713/51381727-e3d0f780-1b4f-11e9-96ab-d26b9198ba65.png`。可以通过将图片拖拽到 [Github Issue](https://github.com/Microsoft/nni/issues/new) 框中来生成这样的链接。
- * 如果不能被 sphinx 重新格式化,如源代码等,则需要使用绝对链接。 如果源码连接到本代码库,使用 `https://github.com/Microsoft/nni/tree/master/` 作为根目录 (例如:[mnist.py](https://github.com/Microsoft/nni/blob/master/examples/trials/mnist/mnist.py))。
\ No newline at end of file
+ * 如果不能被 sphinx 重新格式化,如源代码等,则需要使用绝对链接。 如果源码连接到本代码库,使用 `https://github.com/Microsoft/nni/tree/master/` 作为根目录 (例如:[mnist.py](https://github.com/Microsoft/nni/blob/master/examples/trials/mnist-tfv1/mnist.py))。
\ No newline at end of file
diff --git a/docs/zh_CN/Tutorial/ExperimentConfig.md b/docs/zh_CN/Tutorial/ExperimentConfig.md
index dac1c34497..5d441d1877 100644
--- a/docs/zh_CN/Tutorial/ExperimentConfig.md
+++ b/docs/zh_CN/Tutorial/ExperimentConfig.md
@@ -4,8 +4,77 @@
- [Experiment(实验)配置参考](#experiment-config-reference)
- [模板](#template)
- - [说明](#configuration-spec)
- - [样例](#examples)
+ - [说明](#configuration-spec)
+ - [authorName](#authorname)
+ - [experimentName](#experimentname)
+ - [trialConcurrency](#trialconcurrency)
+ - [maxExecDuration](#maxexecduration)
+ - [versionCheck](#versioncheck)
+ - [debug](#debug)
+ - [maxTrialNum](#maxtrialnum)
+ - [trainingServicePlatform](#trainingserviceplatform)
+ - [searchSpacePath](#searchspacepath)
+ - [useAnnotation](#useannotation)
+ - [multiPhase](#multiphase)
+ - [multiThread](#multithread)
+ - [nniManagerIp](#nnimanagerip)
+ - [logDir](#logdir)
+ - [logLevel](#loglevel)
+ - [logCollection](#logcollection)
+ - [tuner](#tuner)
+ - [builtinTunerName](#builtintunername)
+ - [codeDir](#codedir)
+ - [classFileName](#classfilename)
+ - [className](#classname)
+ - [classArgs](#classargs)
+ - [gpuIndices](#gpuindices)
+ - [includeIntermediateResults](#includeintermediateresults)
+ - [assessor](#assessor)
+ - [builtinAssessorName](#builtinassessorname)
+ - [codeDir](#codedir-1)
+ - [classFileName](#classfilename-1)
+ - [className](#classname-1)
+ - [classArgs](#classargs-1)
+ - [advisor](#advisor)
+ - [builtinAdvisorName](#builtinadvisorname)
+ - [codeDir](#codedir-2)
+ - [classFileName](#classfilename-2)
+ - [className](#classname-2)
+ - [classArgs](#classargs-2)
+ - [gpuIndices](#gpuindices-1)
+ - [trial](#trial)
+ - [localConfig](#localconfig)
+ - [gpuIndices](#gpuindices-2)
+ - [maxTrialNumPerGpu](#maxtrialnumpergpu)
+ - [useActiveGpu](#useactivegpu)
+ - [machineList](#machinelist)
+ - [ip](#ip)
+ - [port](#port)
+ - [username](#username)
+ - [passwd](#passwd)
+ - [sshKeyPath](#sshkeypath)
+ - [passphrase](#passphrase)
+ - [gpuIndices](#gpuindices-3)
+ - [maxTrialNumPerGpu](#maxtrialnumpergpu-1)
+ - [useActiveGpu](#useactivegpu-1)
+ - [kubeflowConfig](#kubeflowconfig)
+ - [operator](#operator)
+ - [storage](#storage)
+ - [nfs](#nfs)
+ - [keyVault](#keyvault)
+ - [azureStorage](#azurestorage)
+ - [uploadRetryCount](#uploadretrycount)
+ - [paiConfig](#paiconfig)
+ - [userName](#username)
+ - [password](#password)
+ - [token](#token)
+ - [host](#host)
+ - [样例](#examples)
+ - [本机模式](#local-mode)
+ - [远程模式](#remote-mode)
+ - [PAI 模式](#pai-mode)
+ - [Kubeflow 模式](#kubeflow-mode)
+ - [Kubeflow 中使用 Azure 存储](#kubeflow-with-azure-storage)
## 模板
@@ -132,727 +201,717 @@ machineList:
## 说明
-- **authorName**
-
- - 说明
-
- **authorName** 是创建 Experiment 的作者。
-
- 待定: 增加默认值
+### authorName
-- **experimentName**
-
- - 说明
-
- **experimentName** 是创建的 Experiment 的名称。
-
- 待定: 增加默认值
+必填。 字符串。
-- **trialConcurrency**
-
- - 说明
-
- **trialConcurrency** 定义了并发尝试任务的最大数量。
-
- 注意:如果 trialGpuNum 大于空闲的 GPU 数量,并且并发的 Trial 任务数量还没达到 trialConcurrency,Trial 任务会被放入队列,等待分配 GPU 资源。
+创建 Experiment 的作者的姓名。
-- **maxExecDuration**
-
- - 说明
-
- **maxExecDuration** 定义 Experiment 执行的最长时间。时间单位:{**s**, **m**, **h**, **d**},分别代表:{*seconds*, *minutes*, *hours*, *days*}。
-
- 注意:maxExecDuration 设置的是 Experiment 执行的时间,不是 Trial 的。 如果 Experiment 达到了设置的最大时间,Experiment 不会停止,但不会再启动新的 Trial 作业。
+*待定: 增加默认值。*
-- **versionCheck**
-
- - 说明
-
- NNI 会校验 remote, pai 和 Kubernetes 模式下 NNIManager 与 trialKeeper 进程的版本。 如果需要禁用版本校验,versionCheck 应设置为 false。
+### experimentName
-- **debug**
-
- - 说明
-
- 调试模式会将 versionCheck 设置为 False,并将 logLevel 设置为 'debug'。
+必填。 字符串。
-- **maxTrialNum**
-
- - 说明
-
- **maxTrialNum** 定义了 Trial 任务的最大数量,成功和失败的都计算在内。
+创建的 Experiment 名称。
-- **trainingServicePlatform**
-
- - 说明
-
- **trainingServicePlatform** 定义运行 Experiment 的平台,包括:{**local**, **remote**, **pai**, **kubeflow**}.
-
- - **local** 在本机的 Ubuntu 上运行 Experiment。
-
- - **remote** 将任务提交到远程的 Ubuntu 上,必须用 **machineList** 来指定远程的 SSH 连接信息。
-
- - **pai** 提交任务到微软开源的 [OpenPAI](https://github.com/Microsoft/pai) 上。 更多 OpenPAI 配置,参考 [pai 模式](../TrainingService/PaiMode.md)。
-
- - **kubeflow** 提交任务至 [Kubeflow](https://www.kubeflow.org/docs/about/kubeflow/)。 NNI 支持基于 Kubeflow 的 Kubenetes,以及[Azure Kubernetes](https://azure.microsoft.com/en-us/services/kubernetes-service/)。 详情参考 [Kubeflow 文档](../TrainingService/KubeflowMode.md)
+*待定: 增加默认值。*
-- **searchSpacePath**
-
- - 说明
-
- **searchSpacePath** 定义搜索空间文件的路径,此文件必须在运行 nnictl 的本机。
-
- 注意: 如果设置了 useAnnotation=True,searchSpacePath 字段必须被删除。
+### trialConcurrency
-- **useAnnotation**
-
- - 说明
-
- **useAnnotation** 定义使用标记来分析代码并生成搜索空间。
-
- 注意: 如果设置了 useAnnotation=True,searchSpacePath 字段必须被删除。
+必填。 1 到 99999 之间的整数。
-- **multiPhase**
-
- - 说明
-
- **multiPhase** 启用[多阶段 Experiment](../AdvancedFeature/MultiPhase.md)。
+指定同时运行的 Trial 任务的最大数量。
-- **multiThread**
-
- - 说明
-
- **multiThread** 如果 multiThread 设为 `true`,可启动 Dispatcher 的多线程模式。Dispatcher 会为来自 NNI 管理器的每个命令启动一个线程。
+如果 trialGpuNum 大于空闲的 GPU 数量,并且并发的 Trial 任务数量还没达到 **trialConcurrency**,Trial 任务会被放入队列,等待分配 GPU 资源。
-- **nniManagerIp**
-
- - 说明
-
- **nniManagerIp** 设置 NNI 管理器运行的 IP 地址。 此字段为可选项,如果没有设置,则会使用 eth0 的 IP 地址。
-
- 注意: 可在 NNI 管理器机器上运行 ifconfig 来检查 eth0 是否存在。 如果不存在,推荐显式设置 nnimanagerIp。
+### maxExecDuration
-- **logDir**
-
- - 说明
-
- **logDir** 配置存储日志和数据的目录。 默认值是 `/nni/experiment`
+可选。 字符串。 默认值:999d。
-- **logLevel**
-
- - 说明
-
- **logLevel** 为 Experiment 设置日志级别,支持的日志级别有:`trace, debug, info, warning, error, fatal`。 默认值是 `info`。
+**maxExecDuration** 指定实验的最大执行时间。 时间的单位为 {**s**, **m**, **h**, **d**},其分别表示 {*秒*, *分钟*, *小时*, *天*}。
-- **logCollection**
-
- - 说明
-
- **logCollection** 设置在 remote, pai, kubeflow, frameworkcontroller 平台下收集日志的方法。 日志支持两种设置,一种是通过 `http`,让 Trial 将日志通过 POST 方法发回日志,这种方法会减慢 trialKeeper 的速度。 另一种方法是 `none`,Trial 不将日志回传回来,仅仅回传 Job 的指标。 如果日志较大,可将此参数设置为 `none`。
+注意:maxExecDuration 设置的是 Experiment 执行的时间,不是 Trial 的。 如果 Experiment 达到了设置的最大时间,Experiment 不会停止,但不会再启动新的 Trial 作业。
-- **Tuner**
-
- - 说明
-
- **tuner** 指定了 Experiment 的 Tuner 算法。有两种方法可设置 Tuner。 一种方法是使用 SDK 提供的 Tuner,需要设置 **builtinTunerName** 和 **classArgs**。 另一种方法,是使用用户自定义的 Tuner,需要设置 **codeDirectory**,**classFileName**,**className** 和 **classArgs**。
-
- - **builtinTunerName** 和 **classArgs**
-
- - **builtinTunerName**
-
- **builtinTunerName** 指定系统 Tuner 的名称,NNI SDK 提供了多个内置 Tuner,详情参考[这里](../Tuner/BuiltinTuner.md)。
-
- - **classArgs**
-
- **classArgs** 指定了 Tuner 算法的参数。 参考[此文件](../Tuner/BuiltinTuner.md)来了解内置 Tuner 的配置参数。
-
- - **codeDir**, **classFileName**, **className** 和 **classArgs**
-
- - **codeDir**
-
- **codeDir** 指定 Tuner 代码的目录。
-
- - **classFileName**
-
- **classFileName** 指定 Tuner 文件名。
-
- - **className**
-
- **className** 指定 Tuner 类名。
-
- - **classArgs**
-
- **classArgs** 指定了 Tuner 算法的参数。
-
- - **gpuIndices**
-
- __gpuIndices__ 指定了 Tuner 进程可使用的 GPU。 可以指定单个或多个 GPU 索引,多个索引间使用逗号(,)隔开,例如:`1` 或 `0,1,3`。 如果没设置此字段,脚本中的 `CUDA_VISIBLE_DEVICES` 会为空 '',即 Tuner 中找不到 GPU。
-
-
- - **includeIntermediateResults**
-
- 如果 __includeIntermediateResults__ 为 true,最后一个 Assessor 的中间结果会被发送给 Tuner 作为最终结果。 __includeIntermediateResults__ 的默认值为 false。
-
-
- 注意:用户只能用一种方法来指定 Tuner,指定 `builtinTunerName` 和 `classArgs`,或指定 `codeDir`,`classFileName`,`className` 以及 `classArgs`。
+### versionCheck
-- **Assessor**
-
- - 说明
-
- **assessor** 指定了 Experiment 的 Assessor 算法。有两种方法可设置 Assessor。 一种方法是使用 SDK 提供的 Assessor,需要设置 **builtinAssessorName** 和 **classArgs**。 另一种方法,是使用用户自定义的 Assessor,需要设置 **codeDirectory**,**classFileName**,**className** 和 **classArgs**。
-
- - **builtinAssessorName** 和 **classArgs**
-
- - **builtinAssessorName**
-
- **builtinAssessorName** 指定了内置 Assessor 的名称,NNI SDK 提供了多个内置的 Assessor,详情参考[这里](../Assessor/BuiltinAssessor.md)。
-
- - **classArgs**
-
- **classArgs** 指定了 Assessor 算法的参数。
-
- - **codeDir**, **classFileName**, **className** 和 **classArgs**
-
- - **codeDir**
-
- **codeDir** 指定 Assessor 代码的目录。
-
- - **classFileName**
-
- **classFileName** 指定 Assessor 文件名。
-
- - **className**
-
- **className** 指定 Assessor 类名。
-
- - **classArgs**
-
- **classArgs** 指定了 Assessor 算法的参数。
-
- 注意:用户只能用一种方法来指定 Assessor,指定 `builtinAssessorName` 和 `classArgs`,或指定 `codeDir`,`classFileName`,`className` 以及 `classArgs`。 如果不需要使用 Assessor,此字段可为空。
+可选。 布尔。 默认值:false。
-- **Advisor**
-
- - 说明
-
- **Advisor** 指定了 Experiment 的 Advisor 算法。有两种方法可设置 Advisor。 一种方法是使用 SDK 提供的 Advisor ,需要设置 **builtinAdvisorName** 和 **classArgs**。 另一种方法,是使用用户自定义的 Advisor,需要设置 **codeDirectory**,**classFileName**,**className** 和 **classArgs**。
-
- - **builtinAdvisorName** 和 **classArgs**
-
- - **builtinAdvisorName**
-
- **builtinAdvisorName** 指定了内置 Advisor 的名称,NNI SDK 提供了多个[内置的 Advisor](../Tuner/BuiltinTuner.md)。
-
- - **classArgs**
-
- **classArgs** 指定了 Advisor 算法的参数。 参考[此文件](../Tuner/BuiltinTuner.md)来了解内置 Advisor 的配置参数。
-
- - **codeDir**, **classFileName**, **className** 和 **classArgs**
-
- - **codeDir**
-
- **codeDir** 指定 Advisor 代码的目录。
-
- - **classFileName**
-
- **classFileName** 指定 Advisor 文件名。
-
- - **className**
-
- **className** 指定 Advisor 类名。
-
- - **classArgs**
-
- **classArgs** 指定了 Advisor 算法的参数。
-
- - **gpuIndices**
-
- __gpuIndices__ 指定了 Advisor 进程可使用的 GPU。 可以指定单个或多个 GPU 索引,多个索引间使用逗号(,)隔开,例如:`1` 或 `0,1,3`。 如果没设置此字段,脚本中的 `CUDA_VISIBLE_DEVICES` 会为空 '',即 Tuner 中找不到 GPU。
-
-
- 注意:用户只能用一种方法来指定 Advisor ,指定 `builtinAdvisorName` 和 `classArgs`,或指定 `codeDir`,`classFileName`,`className` 以及 `classArgs`。
+NNI 会校验 remote, pai 和 Kubernetes 模式下 NNIManager 与 trialKeeper 进程的版本。 如果需要禁用版本校验,versionCheck 应设置为 false。
-- **trial (local, remote)**
-
- - **command**
-
- **command** 指定了运行 Trial 进程的命令行。
-
- - **codeDir**
-
- **codeDir** 指定了 Trial 代码文件的目录。
-
- - **gpuNum**
-
- **gpuNum** 指定了运行 Trial 进程的 GPU 数量。 默认值为 0。
+### debug
-- **trial (pai)**
-
- - **command**
-
- **command** 指定了运行 Trial 进程的命令行。
-
- - **codeDir**
-
- **codeDir** 指定了 Trial 代码文件的目录。
-
- - **gpuNum**
-
- **gpuNum** 指定了运行 Trial 进程的 GPU 数量。 默认值为 0。
-
- - **cpuNum**
-
- **cpuNum** 指定了 OpenPAI 容器中使用的 CPU 数量。
-
- - **memoryMB**
-
- **memoryMB** 指定了 OpenPAI 容器中使用的内存数量。
-
- - **image**
-
- **image** 指定了 OpenPAI 中使用的 docker 映像。
-
- - **dataDir**
-
- **dataDir** 是 HDFS 中用到的数据目录变量。
-
- - **outputDir**
-
- **outputDir** 是 HDFS 中用到的输出目录变量。在 OpenPAI 中,stdout 和 stderr 文件会在作业完成后,存放在此目录中。
+可选。 布尔。 默认值:false。
-- **trial (kubeflow)**
-
- - **codeDir**
-
- **codeDir** 指定了代码文件的本机路径。
+调试模式会将 versionCheck 设置为 False,并将 logLevel 设置为 'debug'。
+
+### maxTrialNum
+
+可选。 1 到 99999 之间的整数。 默认值:99999。
+
+指定 NNI 创建的最大 Trial 任务数,包括成功和失败的任务。
+
+### trainingServicePlatform
+
+必填。 字符串。
+
+指定运行 Experiment 的平台,包括 **local**, **remote**, **pai**, **kubeflow**, **frameworkcontroller**.
+
+- **local** 在本机的 Ubuntu 上运行 Experiment。
+
+- **remote** 将任务提交到远程的 Ubuntu 上,必须用 **machineList** 来指定远程的 SSH 连接信息。
+
+- **pai** 提交任务到微软开源的 [OpenPAI](https://github.com/Microsoft/pai) 上。 更多 OpenPAI 配置,参考 [PAI 模式](../TrainingService/PaiMode.md)。
+
+- **kubeflow** 提交任务至 [Kubeflow](https://www.kubeflow.org/docs/about/kubeflow/)。 NNI 支持基于 Kubeflow 的 Kubenetes,以及[Azure Kubernetes](https://azure.microsoft.com/en-us/services/kubernetes-service/)。 详情参考 [Kubeflow 文档](../TrainingService/KubeflowMode.md)
+
+- TODO:解释 FrameworkController。
+
+### searchSpacePath
+
+可选。 现有文件的路径。
+
+指定搜索空间文件的路径,此文件必须在运行 nnictl 的本机。
+
+仅在 `useAnnotation=True` 时,才不需要填写 **searchSpacePath**。
+
+### useAnnotation
+
+可选。 布尔。 默认值:false。
+
+使用 Annotation 分析 Trial 代码并生成搜索空间。
+
+注意:如果 **useAnnotation** 为 true,searchSpacePath 字段会被删除。
+
+### multiPhase
+
+可选。 布尔。 默认值:false。
+
+启用[多阶段 Experiment](../AdvancedFeature/MultiPhase.md)。
+
+### multiThread
+
+可选。 布尔。 默认值:false。
+
+为 Dispatcher 启用多线程模式。 如果启用了 multiThread,Dispatcher 将启动一个线程来处理来自 NNI 管理器的每个命令。
+
+### nniManagerIp
+
+可选。 字符串。 默认值:eth0 设备的 IP。
+
+设置运行 NNI 管理器进程的计算机的 IP 地址。 此字段为可选项,如果没有设置,则会使用 eth0 的 IP 地址。
+
+注意: 可在 NNI 管理器机器上运行 `ifconfig` 来检查 eth0 是否存在。 如果没有,建议显式设置 **nniManagerIp**。
+
+### logDir
+
+可选。 目录的路径。 默认值:`/nni/experiment`。
+
+配置目录以存储 Experiment 的日志和数据。
+
+### logLevel
+
+可选。 字符串。 默认值:`info`。
+
+设置 Experiment 的日志级别。 可设置的日志级别包括:`trace`, `debug`, `info`, `warning`, `error`, `fatal`。
+
+### logCollection
+
+可选。 `http` 或 `none`。 默认值:`none`。
+
+设置在remote、pai、kubeflow、frameworkcontroller 平台中收集日志的方式。 日志支持两种设置,一种是通过 `http`,让 Trial 将日志通过 POST 方法发回日志,这种方法会减慢 trialKeeper 的速度。 另一种方法是 `none`,Trial 不将日志回传回来,仅仅回传 Job 的指标。 如果日志较大,可将此参数设置为 `none`。
+
+### tuner
+
+必填。
+
+指定了 Experiment 的 Tuner 算法。有两种方法可设置 Tuner。 一种方法是使用 NNI SDK 提供的内置 Tuner,在这种情况下,需要设置 **builtinTunerName** 和 **classArgs**。 另一种方法,是使用用户自定义的 Tuner,需要设置 **codeDirectory**,**classFileName**,**className** 和 **classArgs**。 *必须选择其中的一种方式。*
+
+#### builtinTunerName
+
+如果使用内置 Tuner,则为必需。 字符串。
+
+指定系统 Tuner 的名称, NNI SDK 提供的各种 Tuner 的[说明](../Tuner/BuiltinTuner.md)。
+
+#### codeDir
+
+如果使用定制 Tuner,则为必需。 相对于配置文件位置的路径。
+
+指定 Tuner 代码的目录。
+
+#### classFileName
+
+如果使用定制 Tuner,则为必需。 相对于 **codeDir** 的文件路径。
+
+指定 Tuner 文件的名称。
+
+#### className
+
+如果使用定制 Tuner,则为必需。 字符串。
+
+指定 Tuner 的名称。
+
+#### classArgs
+
+可选。 键值对。 默认值:空。
+
+指定 Tuner 算法的参数。 参考[此文件](../Tuner/BuiltinTuner.md)来了解内置 Tuner 的配置参数。
+
+#### gpuIndices
+
+可选。 字符串。 默认值:空。
+
+指定 Tuner 进程可以使用的 GPU。 可以指定单个或多个 GPU 索引。 多个 GPU 索引用逗号 `,` 分隔。 例如,`1` 或 `0,1,3`。 如果未设置该字段,则 Tuner 将找不到 GPU(设置 `CUDA_VISIBLE_DEVICES` 成空字符串)。
+
+#### includeIntermediateResults
+
+可选。 布尔。 默认值:false。
+
+如果 **includeIntermediateResults** 为 true,最后一个 Assessor 的中间结果会被发送给 Tuner 作为最终结果。
+
+### assessor
+
+指定 Assessor 算法以运行 Experiment。 与 Tuner 类似,有两种设置 Assessor 的方法。 一种方法是使用 NNI SDK 提供的 Assessor。 用户需要设置 **builtinAssessorName** 和 **classArgs**。 另一种方法,是使用自定义的 Assessor,需要设置 **codeDirectory**,**classFileName**,**className** 和 **classArgs**。 *必须选择其中的一种方式。*
+
+默认情况下,未启用任何 Assessor。
+
+#### builtinAssessorName
+
+如果使用内置 Assessor,则为必需。 字符串。
+
+指定内置 Assessor 的名称,NNI SDK 提供的 Assessor 可参考[这里](../Assessor/BuiltinAssessor.md)。
+
+#### codeDir
+
+如果使用定制 Assessor,则为必需。 相对于配置文件位置的路径。
+
+指定 Assessor 代码的目录。
+
+#### classFileName
+
+如果使用定制 Assessor,则为必需。 相对于 **codeDir** 的文件路径。
+
+指定 Assessor 文件的名称。
+
+#### className
+
+如果使用定制 Assessor,则为必需。 字符串。
+
+指定 Assessor 类的名称。
+
+#### classArgs
+
+可选。 键值对。 默认值:空。
+
+指定 Assessor 算法的参数。
+
+### advisor
+
+可选。
+
+指定 Experiment 中的 Advisor 算法。 与 Tuner 和 Assessor 类似,有两种指定 Advisor 的方法。 一种方法是使用 SDK 提供的 Advisor ,需要设置 **builtinAdvisorName** 和 **classArgs**。 另一种方法,是使用用户自定义的 Advisor,需要设置 **codeDirectory**,**classFileName**,**className** 和 **classArgs**。
+
+启用 Advisor 后,将忽略 Tuner 和 Advisor 的设置。
+
+#### builtinAdvisorName
+
+指定内置 Advisor 的名称。 NNI SDK 提供了 [BOHB](../Tuner/BohbAdvisor.md) 和 [Hyperband](../Tuner/HyperbandAdvisor.md)。
+
+#### codeDir
+
+如果使用定制 Advisor,则为必需。 相对于配置文件位置的路径。
+
+指定 Advisor 代码的目录。
+
+#### classFileName
+
+如果使用定制 Advisor,则为必需。 相对于 **codeDir** 的文件路径。
+
+指定 Advisor 文件的名称。
+
+#### className
+
+如果使用定制 Advisor,则为必需。 字符串。
+
+指定 Advisor 类的名称。
+
+#### classArgs
+
+可选。 键值对。 默认值:空。
+
+指定 Advisor 的参数。
+
+#### gpuIndices
+
+可选。 字符串。 默认值:空。
+
+指定可以使用的 GPU。 可以指定单个或多个 GPU 索引。 多个 GPU 索引用逗号 `,` 分隔。 例如,`1` 或 `0,1,3`。 如果未设置该字段,则 Tuner 将找不到 GPU(设置 `CUDA_VISIBLE_DEVICES` 成空字符串)。
+
+### trial
+
+必填。 键值对。
+
+在 local 和 remote 模式下,需要以下键。
+
+- **command**:必需字符串。 指定运行 Trial 的命令。
+
+- **codeDir**:必需字符串。 指定 Trial 文件的目录。 此目录将在 remote 模式下自动上传。
+
+- **gpuNum**:可选、整数。 指定了运行 Trial 进程的 GPU 数量。 默认值为 0。
+
+在 PAI 模式下,需要以下键。
+
+- **command**:必需字符串。 指定运行 Trial 的命令。
+
+- **codeDir**:必需字符串。 指定 Trial 文件的目录。 目录中的文件将在 PAI 模式下上传。
+
+- **gpuNum**:必需、整数。 指定了运行 Trial 进程的 GPU 数量。 默认值为 0。
+
+- **cpuNum**:必需、整数。 指定要在 OpenPAI 容器中使用的 cpu 数。
+
+- **memoryMB**:必需、整数。 设置要在 OpenPAI 容器中使用的内存大小,以兆字节为单位。
+
+- **image**:必需字符串。 设置要在 OpenPAI 中使用的 Docker 映像。
+
+- **authFile**:可选、字符串。 用于提供 Docker 注册,用于为 OpenPAI 中的映像拉取请求进行身份验证。 [参考](https://github.com/microsoft/pai/blob/2ea69b45faa018662bc164ed7733f6fdbb4c42b3/docs/faq.md#q-how-to-use-private-docker-registry-job-image-when-submitting-an-openpai-job)。
+
+- **shmMB**:可选、整数。 容器的共享内存大小。
+
+- **portList**: `label`, `beginAt`, `portNumber` 的键值对 list。 参考[ OpenPAI Job 教程](https://github.com/microsoft/pai/blob/master/docs/job_tutorial.md)。
+
+在 Kubeflow 模式下,需要以下键。
+
+- **codeDir** 指定了代码文件的本机路径。
+
+- **ps**: Kubeflow 的 tensorflow-operator 的可选配置,包括:
- - **ps (可选)**
-
- **ps** 是 Kubeflow 的 Tensorflow-operator 配置。
-
- - **replicas**
+ * __replicas__: __ps__ 角色的副本数量。
- **replicas** 是 **ps** 角色的副本数量。
-
- - **command**
+ * __command__: __ps__ 容器的运行脚本。
- **command** 是在 **ps** 的容器中运行的脚本命令。
-
- - **gpuNum**
+ * __gpuNum__: 在 __ps__ 容器中使用的 GPU 数量。
- **gpuNum** 是在 **ps** 容器中使用的 GPU 数量。
-
- - **cpuNum**
+ * __cpuNum__: 在 __ps__ 容器中使用的 CPU 数量。
- **cpuNum** 是在 **ps** 容器中使用的 CPU 数量。
-
- - **memoryMB**
+ * __memoryMB__:容器的内存大小。
- **memoryMB** 指定了容器中使用的内存数量。
-
- - **image**
+ * __image__: 在 __ps__ 中使用的 Docker 映像。
- **image** 设置了 **ps** 使用的 docker 映像。
+
+- **worker** 是 Kubeflow 的 tensorflow-operator 的可选配置。
- - **worker**
-
- **worker** 是 Kubeflow 的 Tensorflow-operator 配置。
-
- - **replicas**
+ * __replicas__: __worker__ 角色的副本数量。
- **replicas** 是 **worker** 角色的副本数量。
-
- - **command**
+ * __command__: __worker__ 容器的运行脚本。
- **command** 是在 **worker** 的容器中运行的脚本命令。
-
- - **gpuNum**
+ * __gpuNum__: 在 __worker__ 容器中使用的 GPU 数量。
- **gpuNum** 是在 **worker** 容器中使用的 GPU 数量。
-
- - **cpuNum**
+ * __cpuNum__: 在 __worker__ 容器中使用的 CPU 数量。
- **cpuNum** 是在 **worker** 容器中使用的 CPU 数量。
-
- - **memoryMB**
+ * __memoryMB__:容器的内存大小。
- **memoryMB** 指定了容器中使用的内存数量。
-
- - **image**
+ * __image__: 在 __worker__ 中使用的 Docker 映像。
- **image** 设置了 **worker** 使用的 docker 映像。
-- **localConfig**
-
- **localConfig** 仅在 **trainingServicePlatform** 设为 `local` 时有效,否则,配置文件中不应该有 **localConfig** 部分。
-
- - **gpuIndices**
-
- **gpuIndices** 用于指定 GPU。设置此值后,只有指定的 GPU 会被用来运行 Trial 任务。 可指定单个或多个 GPU 的索引,多个 GPU 之间用逗号(,)隔开,例如 `1` 或 `0,1,3`。
-
- - **maxTrialNumPerGpu**
-
- **maxTrialNumPerGpu** 用于指定每个 GPU 设备上最大并发的 Trial 数量。
-
- - **useActiveGpu**
-
- **useActiveGpu** 用于指定 NNI 是否使用还有其它进程的 GPU。 默认情况下,NNI 只会使用没有其它进程的空闲 GPU,如果 **useActiveGpu** 设置为 true,NNI 会使用所有 GPU。 此字段不适用于 Windows 版的 NNI。
+### localConfig
-- **machineList**
-
- 如果 **trainingServicePlatform** 为 remote,则需要设置 **machineList**。否则应将其置为空。
-
- - **ip**
-
- **ip** 是远程计算机的 ip 地址。
-
- - **port**
-
- **端口** 是用于连接远程计算机的 ssh 端口。
-
- 注意:如果 port 设为空,则为默认值 22。
-
- - **username**
-
- **username** 是远程计算机的用户名。
-
- - **passwd**
-
- **passwd** 指定了账户的密码。
-
- - **sshKeyPath**
-
- 如果要使用 ssh 密钥登录远程计算机,则需要设置 **sshKeyPath**。 **sshKeyPath** 为有效的 ssh 密钥文件路径。
-
- 注意:如果同时设置了 passwd 和 sshKeyPath,NNI 会使用 passwd。
-
- - **passphrase**
-
- **passphrase** 用于保护 ssh 密钥,如果没有使用,可为空。
-
- - **gpuIndices**
-
- **gpuIndices** 用于指定 GPU。设置此值后,远程计算机上只有指定的 GPU 会被用来运行 Trial 任务。 可指定单个或多个 GPU 的索引,多个 GPU 之间用逗号(,)隔开,例如 `1` 或 `0,1,3`。
-
- - **maxTrialNumPerGpu**
-
- **maxTrialNumPerGpu** 用于指定每个 GPU 设备上最大并发的 Trial 数量。
-
- - **useActiveGpu**
-
- **useActiveGpu** 用于指定 NNI 是否使用还有其它进程的 GPU。 默认情况下,NNI 只会使用没有其它进程的空闲 GPU,如果 **useActiveGpu** 设置为 true,NNI 会使用所有 GPU。 此字段不适用于 Windows 版的 NNI。
+本机模式下可选。 键值对。
-- **kubeflowConfig**:
-
- - **operator**
-
- **operator** 指定了 kubeflow 使用的 operator,NNI 当前版本支持 **tf-operator**。
-
- - **storage**
-
- **storage** 指定了 kubeflow 的存储类型,包括 {**nfs**,**azureStorage**}。 此字段可选,默认值为 **nfs**。 如果使用了 azureStorage,此字段必须填写。
-
- - **nfs**
-
- **server** 是 NFS 服务器的地址
-
- **path** 是 NFS 挂载的路径
-
- - **keyVault**
-
- 如果用户使用 Azure Kubernetes Service,需要设置 keyVault 来使用 Azure 存储账户的私钥。 参考: https://docs.microsoft.com/zh-cn/azure/key-vault/key-vault-manage-with-cli2
-
- - **vaultName**
-
- **vaultName** 是 az 命令中 `--vault-name` 的值。
-
- - **name**
-
- **name** 是 az 命令中 `--name` 的值。
-
- - **azureStorage**
-
- 如果用户使用了 Azure Kubernetes Service,需要设置 Azure 存储账户来存放代码文件。
-
- - **accountName**
-
- **accountName** 是 Azure 存储账户的名称。
-
- - **azureShare**
-
- **azureShare** 是 Azure 文件存储的共享参数。
-
- - **uploadRetryCount**
-
- 如果上传文件至 Azure Storage 失败,NNI 会重试。此字段指定了重试的次数。
+仅在 **trainingServicePlatform** 设为 `local` 时有效,否则,配置文件中不应该有 **localConfig** 部分。
-- **paiConfig**
-
- - **userName**
-
- **userName** 是 OpenPAI 的用户名。
-
- - **password**
-
- **password** 是 OpenPAI 用户的密码。
-
- - **host**
+#### gpuIndices
+
+可选。 字符串。 默认值:none。
+
+用于指定特定的 GPU。设置此值后,只有指定的 GPU 会被用来运行 Trial 任务。 可以指定单个或多个 GPU 索引。 多个 GPU 索引,应用逗号(`,`)分隔,如 `1` 或 `0,1,3`。 默认情况下,将使用所有可用的 GPU。
+
+#### maxTrialNumPerGpu
+
+可选。 整数。 默认值:99999。
+
+用于指定 GPU 设备上的最大并发 Trial 的数量。
+
+#### useActiveGpu
+
+可选。 布尔。 默认值:false。
+
+用于指定 GPU 上存在其他进程时是否使用此 GPU。 默认情况下,NNI 仅在 GPU 中没有其他活动进程时才使用 GPU。 如果 **useActiveGpu** 设置为 true,则 NNI 无论某 GPU 是否有其它进程,都将使用它。 此字段不适用于 Windows 版的 NNI。
+
+### machineList
+
+在 remote 模式下必需。 具有以下键的键值对的列表。
+
+#### ip
+
+必填。 可从当前计算机访问的 IP 地址。
+
+远程计算机的 IP 地址。
+
+#### port
+
+可选。 整数。 有效端口。 默认值: 22。
+
+用于连接计算机的 SSH 端口。
+
+#### username
+
+使用用户名/密码进行身份验证时是必需的。 字符串。
+
+远程计算机的帐户。
+
+#### passwd
+
+使用用户名/密码进行身份验证时是必需的。 字符串。
+
+指定帐户的密码。
+
+#### sshKeyPath
+
+如果使用 SSH 密钥进行身份验证,则为必需。 私钥文件的路径。
+
+如果用户使用 SSH 密钥登录远程计算机,**sshKeyPath** 应是有效的 SSH 密钥文件路径。
+
+*注意:如果同时设置了 passwd 和 sshKeyPath,NNI 会首先使用 passwd。*
+
+#### passphrase
+
+可选。 字符串。
+
+用于保护 SSH 密钥,如果用户没有密码,可为空。
+
+#### gpuIndices
+
+可选。 字符串。 默认值:none。
+
+用于指定特定的 GPU。设置此值后,只有指定的 GPU 会被用来运行 Trial 任务。 可以指定单个或多个 GPU 索引。 多个 GPU 索引,应用逗号(`,`)分隔,如 `1` 或 `0,1,3`。 默认情况下,将使用所有可用的 GPU。
+
+#### maxTrialNumPerGpu
+
+可选。 整数。 默认值:99999。
+
+用于指定 GPU 设备上的最大并发 Trial 的数量。
+
+#### useActiveGpu
+
+可选。 布尔。 默认值:false。
+
+用于指定 GPU 上存在其他进程时是否使用此 GPU。 默认情况下,NNI 仅在 GPU 中没有其他活动进程时才使用 GPU。 如果 **useActiveGpu** 设置为 true,则 NNI 无论某 GPU 是否有其它进程,都将使用它。 此字段不适用于 Windows 版的 NNI。
+
+### kubeflowConfig
+
+#### operator
+
+必填。 字符串。 必须是 `tf-operator` 或 `pytorch-operator`。
+
+指定要使用的 Kubeflow 运算符,当前版本中 NNI 支持 `tf-operator`。
+
+#### storage
+
+可选。 字符串。 默认值 `nfs`。
+
+指定 Kubeflow 的存储类型,包括 `nfs` 和 `azureStorage`。
+
+#### nfs
+
+如果使用 nfs,则必需。 键值对。
+
+- **server** 是 NFS 服务器的地址。
+
+- **path** 是 NFS 挂载的路径。
+
+#### keyVault
+
+如果使用 Azure 存储,则必需。 键值对。
+
+将 **keyVault** 设置为 Azure 存储帐户的私钥。 参考:https://docs.microsoft.com/en-us/azure/key-vault/key-vault-manage-with-cli2 。
+
+- **vaultName** 是 az 命令中 `--vault-name` 的值。
+
+- **name** 是 az 命令中 `--name` 的值。
+
+#### azureStorage
+
+如果使用 Azure 存储,则必需。 键值对。
+
+设置 Azure 存储帐户以存储代码文件。
+
+- **accountName** 是 Azure 存储账户的名称。
+
+- **azureShare** 是 Azure 文件存储的共享参数。
+
+#### uploadRetryCount
+
+如果使用 Azure 存储,则必需。 1 到 99999 之间的整数。
+
+如果上传文件至 Azure Storage 失败,NNI 会重试。此字段指定了重试的次数。
+
+### paiConfig
+
+#### userName
+
+必填。 字符串。
+
+OpenPAI 帐户的用户名。
+
+#### password
+
+如果使用密码身份验证,则需要。 字符串。
+
+OpenPAI 帐户的密码。
+
+#### token
+
+如果使用 token 身份验证,则需要。 字符串。
+
+可以从 OpenPAI 门户检索的个人访问 token。
+
+#### host
+
+必填。 字符串。
+
+OpenPAI 的 IP 地址。
+
+## 示例
+
+### 本机模式
+
+如果要在本机运行 Trial 任务,并使用标记来生成搜索空间,可参考下列配置:
+
+ authorName: test
+ experimentName: test_experiment
+ trialConcurrency: 3
+ maxExecDuration: 1h
+ maxTrialNum: 10
+ #可选项: local, remote, pai, kubeflow
+ trainingServicePlatform: local
+ #可选项: true, false
+ useAnnotation: true
+ tuner:
+ #可选项: TPE, Random, Anneal, Evolution
+ builtinTunerName: TPE
+ classArgs:
+ #可选项: maximize, minimize
+ optimize_mode: maximize
+ trial:
+ command: python3 mnist.py
+ codeDir: /nni/mnist
+ gpuNum: 0
- **host** 是 OpenPAI 的主机地址。
-## 样例
+增加 Assessor 配置
+
+ authorName: test
+ experimentName: test_experiment
+ trialConcurrency: 3
+ maxExecDuration: 1h
+ maxTrialNum: 10
+ #可选项: local, remote, pai, kubeflow
+ trainingServicePlatform: local
+ searchSpacePath: /nni/search_space.json
+ #可选项: true, false
+ useAnnotation: false
+ tuner:
+ #可选项: TPE, Random, Anneal, Evolution
+ builtinTunerName: TPE
+ classArgs:
+ #可选项: maximize, minimize
+ optimize_mode: maximize
+ assessor:
+ #可选项: Medianstop
+ builtinAssessorName: Medianstop
+ classArgs:
+ #可选项: maximize, minimize
+ optimize_mode: maximize
+ trial:
+ command: python3 mnist.py
+ codeDir: /nni/mnist
+ gpuNum: 0
+
-- **本机模式**
-
- 如果要在本机运行 Trial 任务,并使用标记来生成搜索空间,可参考下列配置:
-
- ```yaml
- authorName: test
- experimentName: test_experiment
- trialConcurrency: 3
- maxExecDuration: 1h
- maxTrialNum: 10
- #可选项: local, remote, pai, kubeflow
- trainingServicePlatform: local
- #可选项: true, false
- useAnnotation: true
- tuner:
- #可选项: TPE, Random, Anneal, Evolution
- builtinTunerName: TPE
- classArgs:
- #可选项: maximize, minimize
- optimize_mode: maximize
- trial:
- command: python3 mnist.py
- codeDir: /nni/mnist
- gpuNum: 0
- ```
-
- 增加 Assessor 配置
-
- ```yaml
- authorName: test
- experimentName: test_experiment
- trialConcurrency: 3
- maxExecDuration: 1h
- maxTrialNum: 10
- #可选项: local, remote, pai, kubeflow
- trainingServicePlatform: local
- searchSpacePath: /nni/search_space.json
- #可选项: true, false
- useAnnotation: false
- tuner:
- #可选项: TPE, Random, Anneal, Evolution
- builtinTunerName: TPE
- classArgs:
- #可选项: maximize, minimize
- optimize_mode: maximize
- assessor:
- #可选项: Medianstop
- builtinAssessorName: Medianstop
- classArgs:
- #可选项: maximize, minimize
- optimize_mode: maximize
- trial:
- command: python3 mnist.py
- codeDir: /nni/mnist
- gpuNum: 0
- ```
-
- 或者可以指定自定义的 Tuner 和 Assessor:
-
- ```yaml
- authorName: test
- experimentName: test_experiment
- trialConcurrency: 3
- maxExecDuration: 1h
- maxTrialNum: 10
- #可选项: local, remote, pai, kubeflow
- trainingServicePlatform: local
- searchSpacePath: /nni/search_space.json
- #可选项: true, false
- useAnnotation: false
- tuner:
- codeDir: /nni/tuner
- classFileName: mytuner.py
- className: MyTuner
- classArgs:
- #可选项: maximize, minimize
- optimize_mode: maximize
- assessor:
- codeDir: /nni/assessor
- classFileName: myassessor.py
- className: MyAssessor
- classArgs:
- #choice: maximize, minimize
- optimize_mode: maximize
- trial:
- command: python3 mnist.py
- codeDir: /nni/mnist
- gpuNum: 0
- ```
-
-- **远程模式**
-
- 如果要在远程服务器上运行 Trial 任务,需要增加服务器信息:
-
- ```yaml
- authorName: test
- experimentName: test_experiment
- trialConcurrency: 3
- maxExecDuration: 1h
- maxTrialNum: 10
- #可选项: local, remote, pai, kubeflow
- trainingServicePlatform: remote
- searchSpacePath: /nni/search_space.json
- #可选项: true, false
- useAnnotation: false
- tuner:
- #可选项: TPE, Random, Anneal, Evolution
- builtinTunerName: TPE
- classArgs:
- #可选项: maximize, minimize
- optimize_mode: maximize
- trial:
- command: python3 mnist.py
- codeDir: /nni/mnist
- gpuNum: 0
- # 如果是本地 Experiment,machineList 可为空。
- machineList:
-
- - ip: 10.10.10.10
- port: 22
- username: test
- passwd: test
- - ip: 10.10.10.11
- port: 22
- username: test
- passwd: test
- - ip: 10.10.10.12
- port: 22
- username: test
- sshKeyPath: /nni/sshkey
- passphrase: qwert
- ```
-
-- **pai 模式**
-
- ```yaml
- authorName: test
- experimentName: nni_test1
- trialConcurrency: 1
- maxExecDuration:500h
- maxTrialNum: 1
- #可选项: local, remote, pai, kubeflow
- trainingServicePlatform: pai
- searchSpacePath: search_space.json
- #可选项: true, false
- useAnnotation: false
- tuner:
- #可选项: TPE, Random, Anneal, Evolution, BatchTuner
- #SMAC (SMAC 需要使用 nnictl package 单独安装)
- builtinTunerName: TPE
- classArgs:
- #可选项: maximize, minimize
- optimize_mode: maximize
- trial:
- command: python3 main.py
- codeDir: .
- gpuNum: 4
- cpuNum: 2
- memoryMB: 10000
- # 在 OpenPAI 上用来运行 Nni 作业的 docker 映像
- image: msranni/nni:latest
- # 在 OpenPAI 的 hdfs 上存储数据的目录,如:'hdfs://host:port/directory'
- dataDir: hdfs://10.11.12.13:9000/test
- # 在 OpenPAI 的 hdfs 上存储输出的目录,如:'hdfs://host:port/directory'
- outputDir: hdfs://10.11.12.13:9000/test
- paiConfig:
- # OpenPAI 用户名
- userName: test
- # OpenPAI 密码
- passWord: test
- # OpenPAI 服务器 Ip
- host: 10.10.10.10
- ```
-
-- **Kubeflow 模式**
-
- 使用 NFS 存储。
-
- ```yaml
- authorName: default
- experimentName: example_mni
- trialConcurrency: 1
- maxExecDuration: 1h
- maxTrialNum: 1
- # 可选项: local, remote, pai, kubeflow
- trainingServicePlatform: kubeflow
- searchSpacePath: search_space.json
- # 可选项: true, false
- useAnnotation: false
- tuner:
- # 可选项: TPE, Random, Anneal, Evolution
- builtinTunerName: TPE
- classArgs:
- # 可选项: maximize, minimize
- optimize_mode: maximize
- trial:
- codeDir: .
- worker:
- replicas: 1
+或者可以指定自定义的 Tuner 和 Assessor:
+
+ authorName: test
+ experimentName: test_experiment
+ trialConcurrency: 3
+ maxExecDuration: 1h
+ maxTrialNum: 10
+ #可选项: local, remote, pai, kubeflow
+ trainingServicePlatform: local
+ searchSpacePath: /nni/search_space.json
+ #可选项: true, false
+ useAnnotation: false
+ tuner:
+ codeDir: /nni/tuner
+ classFileName: mytuner.py
+ className: MyTuner
+ classArgs:
+ #可选项: maximize, minimize
+ optimize_mode: maximize
+ assessor:
+ codeDir: /nni/assessor
+ classFileName: myassessor.py
+ className: MyAssessor
+ classArgs:
+ #choice: maximize, minimize
+ optimize_mode: maximize
+ trial:
command: python3 mnist.py
+ codeDir: /nni/mnist
gpuNum: 0
- cpuNum: 1
- memoryMB: 8192
- image: msranni/nni:latest
- kubeflowConfig:
- operator: tf-operator
- nfs:
- server: 10.10.10.10
- path: /var/nfs/general
- ```
-
- 使用 Azure 存储。
-
- ```yaml
- authorName: default
- experimentName: example_mni
- trialConcurrency: 1
- maxExecDuration: 1h
- maxTrialNum: 1
- # 可选项: local, remote, pai, kubeflow
- trainingServicePlatform: kubeflow
- searchSpacePath: search_space.json
- # 可选项: true, false
- useAnnotation: false
- #nniManagerIp: 10.10.10.10
- tuner:
- # 可选项: TPE, Random, Anneal, Evolution
- builtinTunerName: TPE
- classArgs:
- # 可选项: maximize, minimize
- optimize_mode: maximize
- assessor:
- builtinAssessorName: Medianstop
- classArgs:
- optimize_mode: maximize
- trial:
- codeDir: .
- worker:
- replicas: 1
+
+
+### 远程模式
+
+如果要在远程服务器上运行 Trial 任务,需要增加服务器信息:
+
+ authorName: test
+ experimentName: test_experiment
+ trialConcurrency: 3
+ maxExecDuration: 1h
+ maxTrialNum: 10
+ #可选项: local, remote, pai, kubeflow
+ trainingServicePlatform: remote
+ searchSpacePath: /nni/search_space.json
+ #可选项: true, false
+ useAnnotation: false
+ tuner:
+ #可选项: TPE, Random, Anneal, Evolution
+ builtinTunerName: TPE
+ classArgs:
+ #可选项: maximize, minimize
+ optimize_mode: maximize
+ trial:
command: python3 mnist.py
+ codeDir: /nni/mnist
gpuNum: 0
- cpuNum: 1
- memoryMB: 4096
+ # 如果是本地 Experiment,machineList 可为空。
+ machineList:
+
+ - ip: 10.10.10.10
+ port: 22
+ username: test
+ passwd: test
+ - ip: 10.10.10.11
+ port: 22
+ username: test
+ passwd: test
+ - ip: 10.10.10.12
+ port: 22
+ username: test
+ sshKeyPath: /nni/sshkey
+ passphrase: qwert
+
+
+### OpenPAI 模式
+
+ authorName: test
+ experimentName: nni_test1
+ trialConcurrency: 1
+ maxExecDuration:500h
+ maxTrialNum: 1
+ #可选项: local, remote, pai, kubeflow
+ trainingServicePlatform: pai
+ searchSpacePath: search_space.json
+ #可选项: true, false
+ useAnnotation: false
+ tuner:
+ #可选项: TPE, Random, Anneal, Evolution, BatchTuner
+ #SMAC (SMAC 需要使用 nnictl package 单独安装)
+ builtinTunerName: TPE
+ classArgs:
+ #可选项: maximize, minimize
+ optimize_mode: maximize
+ trial:
+ command: python3 main.py
+ codeDir: .
+ gpuNum: 4
+ cpuNum: 2
+ memoryMB: 10000
+ # 在 OpenPAI 上运行 NNI 的 Docker 映像
image: msranni/nni:latest
- kubeflowConfig:
- operator: tf-operator
- keyVault:
- vaultName: Contoso-Vault
- name: AzureStorageAccountKey
- azureStorage:
- accountName: storage
- azureShare: share01
- ```
\ No newline at end of file
+ paiConfig:
+ # 登录 OpenPAI 的用户名
+ userName: test
+ # 登录 OpenPAI 的密码
+ passWord: test
+ # OpenPAI 的 RestFUL 服务器地址
+ host: 10.10.10.10
+
+
+### Kubeflow 模式
+
+ 使用 NFS 存储。
+
+ authorName: default
+ experimentName: example_mni
+ trialConcurrency: 1
+ maxExecDuration: 1h
+ maxTrialNum: 1
+ # 可选项: local, remote, pai, kubeflow
+ trainingServicePlatform: kubeflow
+ searchSpacePath: search_space.json
+ # 可选项: true, false
+ useAnnotation: false
+ tuner:
+ # 可选项: TPE, Random, Anneal, Evolution
+ builtinTunerName: TPE
+ classArgs:
+ # 可选项: maximize, minimize
+ optimize_mode: maximize
+ trial:
+ codeDir: .
+ worker:
+ replicas: 1
+ command: python3 mnist.py
+ gpuNum: 0
+ cpuNum: 1
+ memoryMB: 8192
+ image: msranni/nni:latest
+ kubeflowConfig:
+ operator: tf-operator
+ nfs:
+ server: 10.10.10.10
+ path: /var/nfs/general
+
+
+
+### Kubeflow 中使用 Azure 存储
+
+ authorName: default
+ experimentName: example_mni
+ trialConcurrency: 1
+ maxExecDuration: 1h
+ maxTrialNum: 1
+ # 可选项: local, remote, pai, kubeflow
+ trainingServicePlatform: kubeflow
+ searchSpacePath: search_space.json
+ # 可选项: true, false
+ useAnnotation: false
+ #nniManagerIp: 10.10.10.10
+ tuner:
+ # 可选项: TPE, Random, Anneal, Evolution
+ builtinTunerName: TPE
+ classArgs:
+ # 可选项: maximize, minimize
+ optimize_mode: maximize
+ assessor:
+ builtinAssessorName: Medianstop
+ classArgs:
+ optimize_mode: maximize
+ trial:
+ codeDir: .
+ worker:
+ replicas: 1
+ command: python3 mnist.py
+ gpuNum: 0
+ cpuNum: 1
+ memoryMB: 4096
+ image: msranni/nni:latest
+ kubeflowConfig:
+ operator: tf-operator
+ keyVault:
+ vaultName: Contoso-Vault
+ name: AzureStorageAccountKey
+ azureStorage:
+ accountName: storage
+ azureShare: share01
\ No newline at end of file
diff --git a/docs/zh_CN/Tutorial/FAQ.md b/docs/zh_CN/Tutorial/FAQ.md
index 204c929e95..bcd7fe7a25 100644
--- a/docs/zh_CN/Tutorial/FAQ.md
+++ b/docs/zh_CN/Tutorial/FAQ.md
@@ -41,9 +41,16 @@ nnictl 在执行时,使用 tmp 目录作为临时目录来复制 codeDir 下
无法打开 Web 界面的链接可能有以下几个原因:
-* http://127.0.0.1,http://172.17.0.1 以及 http://10.0.0.15 都是 localhost。如果在服务器或远程计算机上启动 Experiment, 可将此 IP 替换为所连接的 IP 来查看 Web 界面,如 http://[远程连接的地址]:8080
+* `http://127.0.0.1`,`http://172.17.0.1` 以及 `http://10.0.0.15` 都是 localhost。如果在服务器或远程计算机上启动 Experiment, 可将此 IP 替换为所连接的 IP 来查看 Web 界面,如 `http://[远程连接的地址]:8080`
* 如果使用服务器 IP 后还是无法看到 Web 界面,可检查此服务器上是否有防火墙或需要代理。 或使用此运行 NNI Experiment 的服务器上的浏览器来查看 Web 界面。
-* 另一个可能的原因是 Experiment 启动失败了,NNI 无法读取 Experiment 的信息。 可在如下目录中查看 NNIManager 的日志: ~/nni/experiment/[your_experiment_id] /log/nnimanager.log
+* 另一个可能的原因是 Experiment 启动失败了,NNI 无法读取 Experiment 的信息。 可在如下目录中查看 NNIManager 的日志: `~/nni/experiment/[your_experiment_id]` `/log/nnimanager.log`
+
+### RESTful 服务器启动失败
+
+可能是网络配置有问题。可检查以下问题。
+
+* 可能需要链接 `127.0.0.1` 与 `localhost`。 在 `/etc/hosts` 中增加 `127.0.0.1 localhost`。
+* 也可能设置了一些代理。检查环境中是否有如 `HTTP_PROXY` 或 `HTTPS_PROXY` 的变量,如果有,则需要取消。
### NNI 在 Windows 上的问题
diff --git a/docs/zh_CN/Tutorial/HowToDebug.md b/docs/zh_CN/Tutorial/HowToDebug.md
index 7a7fa86e96..580da25dcd 100644
--- a/docs/zh_CN/Tutorial/HowToDebug.md
+++ b/docs/zh_CN/Tutorial/HowToDebug.md
@@ -79,4 +79,6 @@ NNI 中有不同的错误类型。 根据严重程度,可分为三类。 当 N

-如图,每个 Trial 都有日志路径,可以从中找到 Trial 的日志和 stderr。
\ No newline at end of file
+如图,每个 Trial 都有日志路径,可以从中找到 Trial 的日志和 stderr。
+
+除了 Experiment 级调试之外,NNI 还提供调试单个 Trial 的功能,而无需启动整个 Experiment。 有关调试单个 Trial 代码的更多信息,请参考[独立运行模式](../TrialExample/Trials.md#standalone-mode-for-debug)。
\ No newline at end of file
diff --git a/docs/zh_CN/Tutorial/Installation.md b/docs/zh_CN/Tutorial/Installation.md
index 7792bae884..830676ac1b 100644
--- a/docs/zh_CN/Tutorial/Installation.md
+++ b/docs/zh_CN/Tutorial/Installation.md
@@ -1,6 +1,6 @@
# 安装 NNI
-当前支持在 Linux,Mac 和 Windows(本机,远程和 OpenPAI 模式)下安装。
+当前支持在 Linux,Mac 和 Windows 下安装。
## **在 Linux 和 Mac 下安装**
diff --git a/docs/zh_CN/Tutorial/NniOnWindows.md b/docs/zh_CN/Tutorial/NniOnWindows.md
index 2f2cd15976..f509131d4f 100644
--- a/docs/zh_CN/Tutorial/NniOnWindows.md
+++ b/docs/zh_CN/Tutorial/NniOnWindows.md
@@ -1,6 +1,6 @@
# Windows 上的 NNI(实验阶段的功能)
-当前 Windows 上支持本机、远程和 OpenPAI 模式。 推荐 Windows 10 的 1809 版,其经过了测试。
+在 Windows 上运行 NNI 是测试中的功能。 推荐 Windows 10 的 1809 版,其经过了测试。
## **在 Windows 上安装**
@@ -9,7 +9,7 @@
完成操作后,使用 **config_windows.yml** 配置来开始 Experiment 进行验证。
```bash
-nnictl create --config nni\examples\trials\mnist\config_windows.yml
+nnictl create --config nni\examples\trials\mnist-tfv1\config_windows.yml
```
同样,其它示例的 YAML 配置中也需将 Trial 命令的 `python3` 替换为 `python`。
@@ -45,6 +45,10 @@ nnictl create --config nni\examples\trials\mnist\config_windows.yml
当前不支持 SMAC,原因可参考[此问题](https://github.com/automl/SMAC3/issues/483)。
+### 将 Windows 服务器用作远程服务器
+
+目前不支持。
+
注意:
* 如果遇到如 `Segmentation fault` 这样的任何错误,参考[常见问题](FAQ.md)。
\ No newline at end of file
diff --git a/docs/zh_CN/Tutorial/Nnictl.md b/docs/zh_CN/Tutorial/Nnictl.md
index 91e89ad1e8..e6f319b608 100644
--- a/docs/zh_CN/Tutorial/Nnictl.md
+++ b/docs/zh_CN/Tutorial/Nnictl.md
@@ -55,19 +55,19 @@ nnictl 支持的命令:
> 在默认端口 8080 上创建一个新的 Experiment
```bash
- nnictl create --config nni/examples/trials/mnist/config.yml
+ nnictl create --config nni/examples/trials/mnist-tfv1/config.yml
```
> 在指定的端口 8088 上创建新的 Experiment
```bash
- nnictl create --config nni/examples/trials/mnist/config.yml --port 8088
+ nnictl create --config nni/examples/trials/mnist-tfv1/config.yml --port 8088
```
> 在指定的端口 8088 上创建新的 Experiment,并启用调试模式
```bash
- nnictl create --config nni/examples/trials/mnist/config.yml --port 8088 --debug
+ nnictl create --config nni/examples/trials/mnist-tfv1/config.yml --port 8088 --debug
```
注意:
@@ -216,10 +216,10 @@ nnictl 支持的命令:
* 示例
- `使用 'examples/trials/mnist/search_space.json' 来更新 Experiment 的搜索空间`
+ `使用 'examples/trials/mnist-tfv1/search_space.json' 来更新 Experiment 的搜索空间`
```bash
- nnictl update searchspace [experiment_id] --filename examples/trials/mnist/search_space.json
+ nnictl update searchspace [experiment_id] --filename examples/trials/mnist-tfv1/search_space.json
```
* **nnictl update concurrency**
diff --git a/docs/zh_CN/Tutorial/QuickStart.md b/docs/zh_CN/Tutorial/QuickStart.md
index 1de21c9f9a..6cc20885e8 100644
--- a/docs/zh_CN/Tutorial/QuickStart.md
+++ b/docs/zh_CN/Tutorial/QuickStart.md
@@ -48,7 +48,7 @@ if __name__ == '__main__':
run_trial(params)
```
-注意:完整实现请参考 [examples/trials/mnist/mnist_before.py](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/mnist_before.py)
+注意:完整实现请参考 [examples/trials/mnist-tfv1/mnist_before.py](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1/mnist_before.py)
上面的代码一次只能尝试一组参数,如果想要调优学习率,需要手工改动超参,并一次次尝试。
@@ -84,7 +84,7 @@ NNI 用来帮助超参调优。它的流程如下:
+ }
```
-*实现代码:[search_space.json](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/search_space.json)*
+*实现代码:[search_space.json](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1/search_space.json)*
**第二步**:修改 `Trial` 代码来从 NNI 获取超参,并返回 NNI 最终结果。
@@ -111,7 +111,7 @@ NNI 用来帮助超参调优。它的流程如下:
run_trial(params)
```
-*实现代码:[mnist.py](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/mnist.py)*
+*实现代码:[mnist.py](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1/mnist.py)*
**第三步**:定义 YAML 格式的`配置`文件,其中声明了搜索空间和 Trial 文件的`路径`,以及`其它信息`,如调优算法,最大尝试次数,最大运行时间等等。
@@ -136,16 +136,16 @@ trial:
注意:**在 Windows 上,需要将 Trial 命令的 `python3` 改为 `python`**
-*实现代码:[config.yml](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist/config.yml)*
+*实现代码:[config.yml](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1/config.yml)*
-上面的代码都已准备好,并保存在 [examples/trials/mnist/](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist)。
+上面的代码都已准备好,并保存在 [examples/trials/mnist-tfv1/](https://github.com/Microsoft/nni/tree/master/examples/trials/mnist-tfv1)。
#### Linux 和 macOS
从命令行使用 **config.yml** 文件启动 MNIST Experiment 。
```bash
- nnictl create --config nni/examples/trials/mnist/config.yml
+ nnictl create --config nni/examples/trials/mnist-tfv1/config.yml
```
#### Windows
@@ -155,7 +155,7 @@ trial:
**注意**:如果使用 Windows,则需要在 config.yml 文件中,将 `python3` 改为 `python`,或者使用 config_windows.yml 来开始 Experiment。
```bash
- nnictl create --config nni\examples\trials\mnist\config_windows.yml
+ nnictl create --config nni\examples\trials\mnist-tfv1\config_windows.yml
```
注意:**nnictl** 是一个命令行工具,用来控制 NNI Experiment,如启动、停止、继续 Experiment,启动、停止 NNIBoard 等等。 查看[这里](Nnictl.md),了解 `nnictl` 更多用法。
@@ -253,4 +253,4 @@ Experiment 相关信息会显示在界面上,配置和搜索空间等。 可
* [如何在多机上运行 Experiment?](../TrainingService/RemoteMachineMode.md)
* [如何在 OpenPAI 上运行 Experiment?](../TrainingService/PaiMode.md)
* [如何通过 Kubeflow 在 Kubernetes 上运行 Experiment?](../TrainingService/KubeflowMode.md)
-* [如何通过 FrameworkController 在 Kubernetes 上运行 Experiment?](../TrainingService/FrameworkControllerMode.md)
+* [如何通过 FrameworkController 在 Kubernetes 上运行 Experiment?](../TrainingService/FrameworkControllerMode.md)
\ No newline at end of file
diff --git a/docs/zh_CN/Tutorial/SetupNniDeveloperEnvironment.md b/docs/zh_CN/Tutorial/SetupNniDeveloperEnvironment.md
index 74225cb25f..8a340d6d45 100644
--- a/docs/zh_CN/Tutorial/SetupNniDeveloperEnvironment.md
+++ b/docs/zh_CN/Tutorial/SetupNniDeveloperEnvironment.md
@@ -46,7 +46,7 @@
Trial 启动 Experiment 来检查环境。 例如,运行命令
- nnictl create --config ~/nni/examples/trials/mnist/config.yml
+ nnictl create --config ~/nni/examples/trials/mnist-tfv1/config.yml
并打开网页界面查看
diff --git a/docs/zh_CN/assessors.rst b/docs/zh_CN/assessors.rst
index d00daf5eb8..adbbcf516b 100644
--- a/docs/zh_CN/assessors.rst
+++ b/docs/zh_CN/assessors.rst
@@ -6,7 +6,7 @@ Assessor 从 Trial 中接收中间结果,并通过指定的算法决定此 Tri
这是 MNIST 在使用了 'Curvefitting' Assessor 的 'maximize' 模式后的实验结果,可以看到 Assessor 成功的将大量最终结果不好的 Trial **提前结束** 。 使用 Assessor,能在相同的计算资源下,得到更好的结果。
-*实现代码:config_assessor.yml *
+*实现代码:config_assessor.yml *
.. image:: ../img/Assessor.png
diff --git a/docs/zh_CN/builtin_tuner.rst b/docs/zh_CN/builtin_tuner.rst
index c4055cfd7d..1963b6aff8 100644
--- a/docs/zh_CN/builtin_tuner.rst
+++ b/docs/zh_CN/builtin_tuner.rst
@@ -17,3 +17,4 @@
Network Morphism
Hyperband
BOHB
+ PPO Tuner
diff --git a/docs/zh_CN/conf.py b/docs/zh_CN/conf.py
index b87f9db8eb..9db2b8a62d 100644
--- a/docs/zh_CN/conf.py
+++ b/docs/zh_CN/conf.py
@@ -28,7 +28,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
-release = 'v1.1'
+release = 'v1.2'
# -- General configuration ---------------------------------------------------
diff --git a/docs/zh_CN/examples.rst b/docs/zh_CN/examples.rst
index 6958f07e6a..e27d9d9c19 100644
--- a/docs/zh_CN/examples.rst
+++ b/docs/zh_CN/examples.rst
@@ -10,3 +10,4 @@
Scikit-learn<./TrialExample/SklearnExamples>
EvolutionSQuAD<./TrialExample/SquadEvolutionExamples>
GBDT<./TrialExample/GbdtExample>
+ RocksDB <./TrialExample/RocksdbExamples>
diff --git a/docs/zh_CN/feature_engineering.rst b/docs/zh_CN/feature_engineering.rst
index 9244153c38..0ed0789909 100644
--- a/docs/zh_CN/feature_engineering.rst
+++ b/docs/zh_CN/feature_engineering.rst
@@ -1,6 +1,5 @@
-#################
特征工程
-#################
+===================
很高兴的宣布 NNI 的特征工程包 Alpha 版本发布了。
其仍处于试验阶段,会根据使用反馈来演化。
diff --git a/docs/zh_CN/nas.rst b/docs/zh_CN/nas.rst
index 9bcb1483d8..a7329dd60d 100644
--- a/docs/zh_CN/nas.rst
+++ b/docs/zh_CN/nas.rst
@@ -1,6 +1,6 @@
-#################
+##############
NAS 算法
-#################
+##############
自动化的神经网络架构(NAS)搜索在寻找更好的模型方面发挥着越来越重要的作用。
最近的研究工作证明了自动化 NAS 的可行性,并发现了一些超越手动设计和调整的模型。
@@ -20,6 +20,6 @@ NAS 算法
概述
NAS 接口
- ENAS
- DARTS
+ ENAS
+ DARTS
P-DARTS
diff --git a/docs/zh_CN/reference.rst b/docs/zh_CN/reference.rst
index 4ba1ca2e3f..1995f6e6f6 100644
--- a/docs/zh_CN/reference.rst
+++ b/docs/zh_CN/reference.rst
@@ -10,3 +10,4 @@
配置
搜索空间
实现训练平台
+ Framework Library
diff --git a/docs/zh_CN/training_services.rst b/docs/zh_CN/training_services.rst
index 9df2adc364..4e2969e597 100644
--- a/docs/zh_CN/training_services.rst
+++ b/docs/zh_CN/training_services.rst
@@ -2,8 +2,9 @@ NNI 支持的训练平台介绍
=====================================
.. toctree::
+ 概述 <./TrainingService/SupportTrainingService>
本机<./TrainingService/LocalMode>
远程<./TrainingService/RemoteMachineMode>
OpenPAI<./TrainingService/PaiMode>
Kubeflow<./TrainingService/KubeflowMode>
- FrameworkController<./TrainingService/FrameworkControllerMode>
\ No newline at end of file
+ FrameworkController<./TrainingService/FrameworkControllerMode>
diff --git a/examples/trials/ga_squad/README_zh_CN.md b/examples/trials/ga_squad/README_zh_CN.md
index eb8cfb1487..7a313c931c 100644
--- a/examples/trials/ga_squad/README_zh_CN.md
+++ b/examples/trials/ga_squad/README_zh_CN.md
@@ -113,22 +113,18 @@
gpuNum: 0
cpuNum: 1
memoryMB: 32869
- #在 OpenPAI 上运行 NNI 任务的 Docker 映像
+ # 在 OpenPAI 上运行 NNI 的 Docker 映像
image: msranni/nni:latest
- #在 OpenPAI 的 hdfs 目录上存储数据的目录,如:'hdfs://host:port/directory'
- dataDir: hdfs://10.10.10.10:9000/username/nni
- #在 OpenPAI 的 hdfs 目录上存储输出的目录,如:'hdfs://host:port/directory'
- outputDir: hdfs://10.10.10.10:9000/username/nni
paiConfig:
- #登录 OpenPAI 的用户名
+ # 登录 OpenPAI 的用户名
userName: username
- #登录 OpenPAI 的密码
+ # 登录 OpenPAI 的密码
passWord: password
- # OpenPAI 的 RESTful 服务器地址
+ # OpenPAI 的 RestFUL 服务器地址
host: 10.10.10.10
-将默认值改为个人账户和服务器信息。 包括 `nniManagerIp`, `dataDir`, `outputDir`, `userName`, `passWord` 和 `host`。
+将默认值改为个人账户和服务器信息。 包括 `nniManagerIp`, `userName`, `passWord` 和 `host`.
在 "trial" 部分中,如果需要使用 GPU 来进行架构搜索,可将 `gpuNum` 从 `0` 改为 `1`。 根据训练时长,可以增加 `maxTrialNum` 和 `maxExecDuration`。
|