README.md 3.0 KB
Newer Older
W
Will Zhang 已提交
1 2
# Oneflow

3
### Install OneFlow
4

S
Shenghang Tsai 已提交
5
  #### System Requirements to Run OneFlow
6

7
  - Python >= 3.5
8 9 10 11
  - Nvidia Linux x86_64 driver version >= 440.33

  #### Install Pip package

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

14
    ```
15
    python3 -m pip install oneflow_cu102 --user
16
    ```
17

S
Shenghang Tsai 已提交
18 19 20 21 22 23 24 25 26 27 28
  - To install OneFlow with legacy CUDA support, run one of:
    ```
    python3 -m pip install oneflow_cu101
    python3 -m pip install oneflow_cu100
    python3 -m pip install oneflow_cu92
    python3 -m pip install oneflow_cu91
    python3 -m pip install oneflow_cu90
    ```

  - 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. For more information, please refer to [CUDA compatibility documentation](https://docs.nvidia.com/deploy/cuda-compatibility/index.html).

29
  - To install nightly release of OneFlow:
30

31
    ```
32
    python3 -m pip install --find-links https://oneflow-inc.github.io/nightly oneflow_cu102 --user
33
    ```
34

S
Shenghang Tsai 已提交
35 36 37 38
  - CPU-only OneFlow is not available for now.

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

39
### Build OneFlow from Source
40

S
Shenghang Tsai 已提交
41
1. #### System Requirements to Build OneFlow
42

S
Shenghang Tsai 已提交
43
    - 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).
44

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

S
Shenghang Tsai 已提交
47 48 49 50 51 52 53 54 55 56
    - 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:
57

S
Shenghang Tsai 已提交
58 59 60
      ```
      export LD_LIBRARY_PATH=/opt/intel/lib/intel64_lin:/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH
      ```
H
Houjiang Chen 已提交
61

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

S
Shenghang Tsai 已提交
64
      ```
S
Shenghang Tsai 已提交
65
      sudo yum -y install openblas-devel
S
Shenghang Tsai 已提交
66
      ```
H
Houjiang Chen 已提交
67

68
2. #### Clone Source Code
H
Houjiang Chen 已提交
69

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

72 73
    ```
    git clone https://github.com/Oneflow-Inc/oneflow
S
Shenghang Tsai 已提交
74
    cd oneflow
75 76
    git submodule update --init --recursive
    ```
H
Houjiang Chen 已提交
77

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

80 81 82
    ```
    git clone https://github.com/Oneflow-Inc/oneflow --recursive
    ```
H
Houjiang Chen 已提交
83

84
3. #### Build and Install OneFlow
H
Houjiang Chen 已提交
85

86 87 88 89 90 91
    ```
    cd build
    cmake ..
    make -j$(nproc)
    make pip_install
    ```
H
Houjiang Chen 已提交
92

93
### Troubleshooting
H
Houjiang Chen 已提交
94

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

97
### Advanced Features
H
Houjiang Chen 已提交
98

99
- #### XRT
H
Houjiang Chen 已提交
100

S
Shenghang Tsai 已提交
101
  You can check this [doc](oneflow/xrt/README.md) to obtain more details about how to use XLA and TensorRT with OneFlow.