You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 5.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. # MegEngine
  2. ![MegEngine Logo](logo.png)
  3. English | [中文](README_CN.md)
  4. MegEngine is a fast, scalable and easy-to-use deep learning framework, with auto-differentiation.
  5. ------
  6. ## Installation
  7. **NOTE:** MegEngine now only supports Linux platform with Python 3.5 or higher. On Windows 10 you could try [WSL(Windows Subsystem for Linux)](https://docs.microsoft.com/en-us/windows/wsl) to use Linux within Windows.
  8. ### Binaries
  9. Commands to install from binaries via pip wheels are as follows:
  10. ```bash
  11. pip3 install megengine -f https://megengine.org.cn/whl/mge.html
  12. ```
  13. ## Build from Source
  14. ### Prerequisites
  15. Most of the dependencies of MegEngine are located in `third_party` directory, and you do
  16. not need to install these by yourself. you can prepare these repositories by executing:
  17. ```bash
  18. ./third_party/prepare.sh
  19. ./third_party/install-mkl.sh
  20. ```
  21. But some dependencies should be manually installed:
  22. * [CUDA](https://developer.nvidia.com/cuda-toolkit-archive)(>=10.1), [cuDNN](https://developer.nvidia.com/cudnn)(>=7.6)are required when building MegEngine with CUDA support (default ON)
  23. * [TensorRT](https://docs.nvidia.com/deeplearning/sdk/tensorrt-archived/index.html)(>=5.1.5) is required when building with TensorRT support (default ON)
  24. * LLVM/Clang(>=6.0) is required when building with Halide JIT support (default ON)
  25. * Python(>=3.5), Numpy, SWIG(>=3.0) are required to build Python modules. (default ON)
  26. ### Build
  27. MegEngine prefers `Out-Of-Source` flavor, and compile in a `mostly-static` way.
  28. Here are the instructions:
  29. 1. Make a directory for the build.
  30. ```bash
  31. mkdir -p build
  32. cd build
  33. ```
  34. 2. Generate build configurations by `CMake`.
  35. For CUDA build:
  36. ```bash
  37. cmake .. -DMGE_WITH_TEST=ON
  38. ```
  39. For CPU only build, use `-DMGE_WITH_CUDA=OFF`:
  40. ```bash
  41. cmake .. -DMGE_WITH_CUDA=OFF -DMGE_WITH_TEST=ON
  42. ```
  43. For deployment with C++ only, use `-DMGE_INFERENCE_ONLY=ON`, and turn off test with `-DMGE_WITH_TEST=OFF`:
  44. ```bash
  45. cmake .. -DMGE_INFERENCE_ONLY=ON -DMGE_WITH_TEST=OFF
  46. ```
  47. Use `-DCMAKE_INSTALL_PREFIX=YOUR_PATH` to specify the install path.
  48. 3. Start to build.
  49. ```bash
  50. make -j$(nproc)
  51. ```
  52. 4. [optional] Install the library if compiled for deployment at step 2.
  53. ```bash
  54. make install
  55. ```
  56. Here are some other useful options for the build.
  57. * `MGE_ARCH` specifies which arch MegEngine are building for. (default AUTO)
  58. * `MGE_WITH_DISTRIBUTED` if multiple machine distributed support is enabled. (default ON)
  59. * `MGE_WITH_PYTHON_MODULE` if build python module. (default ON)
  60. * `MGE_BLAS` chooses `MKL` or `OpenBLAS` as BLAS library for MegEngine. (default `MKL`)
  61. * `MGE_CUDA_GENCODE` supplies the `-gencode` option for `nvcc`. (default not supply)
  62. * `MGE_DISABLE_FLOAT16` if disable float16 support. (default OFF)
  63. * `MGE_ENABLE_EXCEPTIONS` if enable exception support in C++. (default ON)
  64. * `MGE_ENABLE_LOGGING` if enable logging in MegEngine. (default AUTO)
  65. More options can be found by:
  66. ```bash
  67. cd build
  68. cmake -LAH .. 2>/dev/null| grep -B 1 'MGE_' | less
  69. ```
  70. ## How to Contribute
  71. * MegEngine adopts [Contributor Covenant](https://contributor-covenant.org) to maintain our community. Please read the [Code of Conduct](CODE_OF_CONDUCT.md) to get more information.
  72. * Every contributor of MegEngine must sign a Contributor License Agreement (CLA) to clarify the intellectual property license granted with the contributions. For more details, please refer [Contributor License Agreement](CONTRIBUTOR_LICENSE_AGREEMENT.md)
  73. * You can help MegEngine better in many ways:
  74. * Write code.
  75. * Improve [documentation](https://github.com/MegEngine/Docs).
  76. * Answer questions on [MegEngine Forum](https://discuss.megengine.org.cn), or Stack Overflow.
  77. * Contribute new models in [MegEngine Model Hub](https://github.com/megengine/hub).
  78. * Try a new idea on [MegStudio](https://studio.brainpp.com).
  79. * Report or investigate [bugs and issues](https://github.com/MegEngine/MegEngine/issues).
  80. * Review [Pull Requests](https://github.com/MegEngine/MegEngine/pulls).
  81. * Star MegEngine repo.
  82. * Reference MegEngine in your papers and articles.
  83. * Recommend MegEngine to your friends.
  84. * ...
  85. We believe we can build an open and friendly community and power humanity with AI.
  86. ## How to contact us
  87. * Issue: [github.com/MegEngine/MegEngine/issues](https://github.com/MegEngine/MegEngine/issues)
  88. * Email: [megengine-support@megvii.com](mailto:megengine-support@megvii.com)
  89. * Forum: [discuss.megengine.org.cn](https://discuss.megengine.org.cn)
  90. * QQ: 1029741705
  91. * OPENI: [openi.org.cn/MegEngine](https://www.openi.org.cn/html/2020/Framework_0325/18.html)
  92. ## Resources
  93. - [MegEngine](https://megengine.org.cn)
  94. - [MegStudio](https://studio.brainpp.com)
  95. - [Brain++](https://brainpp.megvii.com)
  96. ## License
  97. MegEngine is Licensed under the Apache License, Version 2.0
  98. Copyright (c) 2014-2020 Megvii Inc. All rights reserved.

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台