README.md 6.2 KB
Newer Older
S
strint 已提交
1
**OneFlow is a performance-centered and open-source deep learning framework.**
S
strint 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

- [Install OneFlow](#install-oneflow)
  - [System Requirements](#system-requirements)
  - [Install with Pip Package](#install-with-pip-package)
  - [Build from Source](#build-from-source)
  - [Troubleshooting](#troubleshooting)
  - [Advanced features](#advanced-features)
- [Getting Started](#getting-started)
- [Documentation](#documentation)
    - [Usage & Design Docs](#usage--design-docs)
    - [API Reference](#api-reference)
- [Model Zoo and Benchmark](#model-zoo-and-benchmark)
  - [CNNs(ResNet-50, VGG-16, Inception-V3, AlexNet)](#cnnsresnet-50-vgg-16-inception-v3-alexnet)
  - [Wide&Deep](#widedeep)
  - [BERT](#bert)
- [Communication](#communication)
- [Contributing](#contributing)
- [The Team](#the-team)
- [License](#license)

## Install OneFlow

  ### System Requirements
25

26
  - Python >= 3.5
S
Shenghang Tsai 已提交
27 28 29 30 31 32 33 34 35 36
  - CUDA Toolkit Linux x86_64 Driver
    | OneFlow |CUDA Driver Version|
    |---|---|
    | oneflow_cu102  | >= 440.33  |
    | oneflow_cu101  | >= 418.39  |
    | oneflow_cu100  | >= 410.48  |
    | oneflow_cu92  | >= 396.26  |
    | oneflow_cu91  | >= 390.46  |
    | oneflow_cu90  | >= 384.81  |

S
Shenghang Tsai 已提交
37 38 39
    - CUDA runtime is statically linked into OneFlow. OneFlow will work on a minimum supported driver, and any driver beyond. For more information, please refer to [CUDA compatibility documentation](https://docs.nvidia.com/deploy/cuda-compatibility/index.html).

    - Support for latest stable version of CUDA will be prioritized. Please upgrade your Nvidia driver to version 440.33 or above and install `oneflow_cu102` if possible.
40

S
strint 已提交
41
  ### Install with Pip Package
42

S
Shenghang Tsai 已提交
43
  - To install latest release of OneFlow with CUDA support:
44

45
    ```
S
Shenghang Tsai 已提交
46
    python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow_cu102 --user
47
    ```
48

S
Shenghang Tsai 已提交
49 50
  - To install OneFlow with legacy CUDA support, run one of:
    ```
S
Shenghang Tsai 已提交
51 52 53 54 55
    python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow_cu101 --user
    python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow_cu100 --user
    python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow_cu92 --user
    python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow_cu91 --user
    python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow_cu90 --user
S
Shenghang Tsai 已提交
56 57
    ```

S
Shenghang Tsai 已提交
58 59 60 61 62 63
  - If you are in China, you could run this to have pip download packages from domestic mirror of pypi:
    ```
    python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    ```
    For more information on this, please refer to [pypi 镜像使用帮助](https://mirror.tuna.tsinghua.edu.cn/help/pypi/)

S
Shenghang Tsai 已提交
64 65 66 67
  - CPU-only OneFlow is not available for now.

  - Releases are built with G++/GCC 4.8.5, cuDNN 7 and MKL 2020.0-088.

S
strint 已提交
68
### Build from Source
69

S
Shenghang Tsai 已提交
70
1. #### System Requirements to Build OneFlow
71

S
Shenghang Tsai 已提交
72
    - Please use a newer version of CMake to build OneFlow. You could download cmake release from [here](https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz).
73

S
Shenghang Tsai 已提交
74
    - Please make sure you have G++ and GCC >= 4.8.5 installed. Clang is not supported for now.
75

S
Shenghang Tsai 已提交
76 77 78 79 80 81 82 83 84 85
    - To install dependencies, run:

      ```
      yum-config-manager --add-repo https://yum.repos.intel.com/setup/intelproducts.repo && \
      rpm --import https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
      yum update -y && yum install -y epel-release && \
      yum install -y intel-mkl-64bit-2020.0-088 nasm swig rdma-core-devel
      ```

      On CentOS, if you have MKL installed, please update the environment variable:
86

S
Shenghang Tsai 已提交
87 88 89
      ```
      export LD_LIBRARY_PATH=/opt/intel/lib/intel64_lin:/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH
      ```
H
Houjiang Chen 已提交
90

S
Shenghang Tsai 已提交
91
      If you don't want to build OneFlow with MKL, you could install OpenBLAS:
H
Houjiang Chen 已提交
92

S
Shenghang Tsai 已提交
93
      ```
S
Shenghang Tsai 已提交
94
      sudo yum -y install openblas-devel
S
Shenghang Tsai 已提交
95
      ```
H
Houjiang Chen 已提交
96

97
2. #### Clone Source Code
H
Houjiang Chen 已提交
98

99
    Clone source code and submodules (faster, recommended)
H
Houjiang Chen 已提交
100

101 102
    ```
    git clone https://github.com/Oneflow-Inc/oneflow
S
Shenghang Tsai 已提交
103
    cd oneflow
104 105
    git submodule update --init --recursive
    ```
H
Houjiang Chen 已提交
106

107
    Or you could also clone the repo with `--recursive` flag to clone third_party submodules together
H
Houjiang Chen 已提交
108

109 110 111
    ```
    git clone https://github.com/Oneflow-Inc/oneflow --recursive
    ```
H
Houjiang Chen 已提交
112

113
3. #### Build and Install OneFlow
H
Houjiang Chen 已提交
114

115 116 117 118 119 120
    ```
    cd build
    cmake ..
    make -j$(nproc)
    make pip_install
    ```
H
Houjiang Chen 已提交
121

122
### Troubleshooting
H
Houjiang Chen 已提交
123

S
Shenghang Tsai 已提交
124
Please refer to [troubleshooting](docs/source/troubleshooting.md) for common issues you might encounter when compiling and running OneFlow.
H
Houjiang Chen 已提交
125

S
strint 已提交
126
### Advanced features
H
Houjiang Chen 已提交
127

128
- #### XRT
H
Houjiang Chen 已提交
129

S
Shenghang Tsai 已提交
130
  You can check this [doc](oneflow/xrt/README.md) to obtain more details about how to use XLA and TensorRT with OneFlow.
S
strint 已提交
131 132 133 134 135 136

## Getting Started
3 minutes to run MNIST.
1. Clone the demo code from OneFlow documentation
```
git clone https://github.com/Oneflow-Inc/oneflow-documentation.git
S
Shenghang Tsai 已提交
137
cd oneflow-documentation/cn/docs/code/quick_start/
S
strint 已提交
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
```
2. Run it in Python
```
python mlp_mnist.py
```

3. Oneflow is running and you got the training loss
```
2.7290366
0.81281316
0.50629824
0.35949975
0.35245502
...
```
More info on this demo, please refer to [doc on quick start](http://docs.oneflow.org/quick_start/quickstart_in_3_min.html).

## Documentation
#### Usage & Design Docs
* [link](http://docs.oneflow.org/)
#### API Reference
* [link](https://oneflow-api.readthedocs.io/en/latest/)

## Model Zoo and Benchmark
* [link](https://github.com/Oneflow-Inc/OneFlow-Benchmark)
### CNNs(ResNet-50, VGG-16, Inception-V3, AlexNet)
S
ShawnXuan 已提交
164
* [CNNs](https://github.com/Oneflow-Inc/OneFlow-Benchmark/tree/master/Classification/cnns)
S
strint 已提交
165 166

### Wide&Deep
S
ShawnXuan 已提交
167
* [OneFlow-WDL](https://github.com/Oneflow-Inc/OneFlow-Benchmark/tree/master/ClickThroughRate/WideDeepLearning)
S
strint 已提交
168
### BERT
S
Shenghang Tsai 已提交
169
* [BERT](https://github.com/Oneflow-Inc/OneFlow-Benchmark/tree/master/LanguageModeling/BERT)
S
strint 已提交
170 171 172 173 174 175 176 177 178 179 180 181 182

## Communication
* Github issues : any install, bug, feature issues.
* [www.oneflow.org](http://www.oneflow.org) : brand related information.

## Contributing
*  [link](http://docs.oneflow.org/contribute/intro.html)

## The Team
OneFlow was originally developed by [OneFlow Inc](http://www.oneflow.org) and [Zhejiang Lab](http://www.zhejianglab.com/).

## License
[Apache License 2.0](LICENSE)