README.md 3.45 KB
Newer Older
xuanbaby's avatar
DTK-x  
xuanbaby committed
1
2
3
4
<p align="center">
<img src="docs/img/nni_logo.png" width="300"/>
</p>

zhanggzh's avatar
zhanggzh committed
5
**NNI (Neural Network Intelligence)** 是一个帮助用户 **自动** 进行特征工程,神经网络架构搜索,超参调优以及模型压缩的轻量且强大的工具包。
xuanbaby's avatar
DTK-x  
xuanbaby committed
6

zhanggzh's avatar
zhanggzh committed
7
NNI 管理自动机器学习 (AutoML) 的 Experiment,**调度运行** 由调优算法生成的 Trial 任务来找到最好的神经网络架构和/或超参,支持**各种训练环境**,如本机,远程服务器,OpenPAI,Kubeflow,基于 K8S 的 FrameworkController(如,AKS 等), DLWorkspace (又称 DLTS), AML (Azure Machine Learning), AdaptDL(又称 ADL) ,和其他的云平台甚至 混合模式 。 DLTS),AML (Azure Machine Learning)AdaptDL(又称 ADL) ,和其他的云平台甚至混合模式。""
xuanbaby's avatar
DTK-x  
xuanbaby committed
8

zhanggzh's avatar
zhanggzh committed
9
10
11
12
13
## **使用场景**
* 想要在自己的代码、模型中试验不同的自动机器学习算法。
* 想要在不同的环境中加速运行自动机器学习。
* 想要更容易实现或试验新的自动机器学习算法的研究员或数据科学家,包括:超参调优算法,神经网络搜索算法以及模型压缩算法。
* 在机器学习平台中支持自动机器学习。
xuanbaby's avatar
DTK-x  
xuanbaby committed
14

zhanggzh's avatar
zhanggzh committed
15
## **安装**
xuanbaby's avatar
DTK-x  
xuanbaby committed
16

zhanggzh's avatar
zhanggzh committed
17
### **安装方式**
xuanbaby's avatar
DTK-x  
xuanbaby committed
18

zhanggzh's avatar
zhanggzh committed
19
#### **使用源码编译方式安装**
xuanbaby's avatar
DTK-x  
xuanbaby committed
20

zhanggzh's avatar
zhanggzh committed
21
编译之前,需要先安装对应版本python,安装相应的三方包依赖项,并配置DTK环境变量(以Centos7.x为例)。
xuanbaby's avatar
DTK-x  
xuanbaby committed
22
23

```bash
zhanggzh's avatar
zhanggzh committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 安装三方包的源
yum install  epel-release  -y

# 安装相关依赖项
yum install libffi-devel -y
yum install openssl-devel openssl -y
yum -y install sqlite-devel

# 若python内未包含相关项,需基于上面安装的三方包重新源码编译python,再配置python环境
pip3 install protobuf==3.20
pip3 install wheel
pip3 install jupyter
pip3 install jupyterlab==3.0.9
pip3 install colorama
pip3 install cloudpickle
pip3 install json_tricks
pip3 install 'typeguard<3'
pip3 install astor
pip3 install schema
python3 -m pip install --upgrade pip setuptools

# 下载DTK及hyhal并配置环境变量
# DTK tar包下载目录:光合社区/资源工具/DCU Toolkit/DTK23.10(https://cancon.hpccube.com:65024/1/main/DTK-23.10),根据系统选择对应DTK的tar包,并解压至/opt目录。
# hyhal tar包下载目录: 光合社区/资源工具DCU Toolkit/DTK23.10(https://cancon.hpccube.com:65024/1/main/DTK-23.10),并解压至/opt目>录。
export ROCM_PATH=/opt/dtk-23.10
source /opt/dtk-23.10/env.sh
xuanbaby's avatar
DTK-x  
xuanbaby committed
50
51
```

zhanggzh's avatar
zhanggzh committed
52
编译nni
xuanbaby's avatar
DTK-x  
xuanbaby committed
53
54

```bash
zhanggzh's avatar
zhanggzh committed
55
56
57
58
59
60
61
# 下载源码 
git clone -b dtk23.10-v2.10 http://developer.hpccube.com/codes/aicomponent/nni.git
cd nni
export NNI_RELEASE=2.10
python3 setup.py clean --all
python3 setup.py build_ts
python3 setup.py bdist_wheel -p manylinux1_x86_64
xuanbaby's avatar
DTK-x  
xuanbaby committed
62
63
```

zhanggzh's avatar
zhanggzh committed
64
安装nni
xuanbaby's avatar
DTK-x  
xuanbaby committed
65

zhanggzh's avatar
zhanggzh committed
66
67
68
```bash
# nni的whl包会在dist文件夹生成
pip3 install ./dist/nni*
xuanbaby's avatar
DTK-x  
xuanbaby committed
69
70
```

zhanggzh's avatar
zhanggzh committed
71
### **验证安装**
xuanbaby's avatar
DTK-x  
xuanbaby committed
72

zhanggzh's avatar
zhanggzh committed
73
tensorflow
xuanbaby's avatar
DTK-x  
xuanbaby committed
74

zhanggzh's avatar
zhanggzh committed
75
76
77
78
79
```bash
nnictl create --config nni/examples/trials/mnist-tfv1/config.yml
nnictl create --config nni/examples/trials/mnist-tfv2/config.yml
```
pytorch
xuanbaby's avatar
DTK-x  
xuanbaby committed
80

zhanggzh's avatar
zhanggzh committed
81
82
83
84
```bash
nnictl create --config nni/examples/trials/mnist-pytorch/config.yml
``` 
在命令行中等待输出 INFO: Successfully started experiment!。 此消息表明 Experiment 已成功启动。 通过命令行输出的 Web UI url 来访问 Experiment 的界面。 此消息表明 Experiment 已成功启动。 通过命令行输出的 Web UI url 来访问 Experiment 的界面。
xuanbaby's avatar
DTK-x  
xuanbaby committed
85

zhanggzh's avatar
zhanggzh committed
86
## **参考**
xuanbaby's avatar
DTK-x  
xuanbaby committed
87

zhanggzh's avatar
zhanggzh committed
88
[README_ORIGIN.md](https://developer.hpccube.com/codes/aicomponent/nni/-/blob/master/README_ORIGIN.md)
xuanbaby's avatar
DTK-x  
xuanbaby committed
89
90
91
92
93


## **License**

The entire codebase is under [MIT license](LICENSE)
zhanggzh's avatar
zhanggzh committed
94