GithubHelp home page GithubHelp logo

hhy5277 / megengine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from megengine/megengine

0.0 1.0 0.0 3.58 MB

MegEngine 是一个快速、可拓展、易于使用且支持自动求导的数值计算框架

Home Page: https://megengine.org.cn/

License: Other

CMake 0.30% Dockerfile 0.01% Shell 0.03% C++ 75.15% C 0.33% Makefile 0.02% Python 4.83% Cuda 19.14% SWIG 0.21%

megengine's Introduction

MegEngine

MegEngine Logo

English | 中文

MegEngine is a fast, scalable and easy-to-use numerical evaluation framework, with auto-differentiation.


Installation

NOTE: MegEngine now only supports Linux platform with Python 3.5 or higher. On Windows 10 you could try WSL(Windows Subsystem for Linux) to use Linux within Windows.

Binaries

Commands to install from binaries via pip wheels are as follows:

pip3 install megengine -f https://megengine.org.cn/whl/mge.html

Build from Source

Prerequisites

Most of the dependencies of MegEngine are located in third_party directory, and you do not need to install these by yourself. you can prepare these repositories by executing:

./third_party/prepare.sh
./third_party/install-mkl.sh

But some dependencies should be manually installed:

  • CUDA(>=10.1), cuDNN(>=7.6)are required when building MegEngine with CUDA support (default ON)
  • TensorRT(>=5.1.5) is required when building with TensorRT support (default ON)
  • LLVM/Clang(>=6.0) is required when building with Halide JIT support (default ON)
  • Python(>=3.5), Numpy, SWIG(>=3.0) are required to build Python modules. (default ON)

Build

MegEngine prefers Out-Of-Source flavor, and compile in a mostly-static way. Here are the instructions:

  1. Make a directory for the build.

    mkdir -p build
    cd build
  2. Generate build configurations by CMake.

    For CUDA build:

    cmake .. -DMGE_WITH_TEST=ON

    For CPU only build, use -DMGE_WITH_CUDA=OFF:

    cmake .. -DMGE_WITH_CUDA=OFF -DMGE_WITH_TEST=ON

    For deployment with C++ only, use -DMGE_INFERENCE_ONLY=ON, and turn off test with -DMGE_WITH_TEST=OFF:

    cmake .. -DMGE_INFERENCE_ONLY=ON -DMGE_WITH_TEST=OFF

    Use -DCMAKE_INSTALL_PREFIX=YOUR_PATH to specify the install path.

  3. Start to build.

    make -j$(nproc)
  4. [optional] Install the library if compiled for deployment at step 2.

    make install

Here are some other useful options for the build.

  • MGE_ARCH specifies which arch MegEngine are building for. (default AUTO)
  • MGE_WITH_DISTRIBUTED if multiple machine distributed support is enabled. (default ON)
  • MGE_WITH_PYTHON_MODULE if build python module. (default ON)
  • MGE_BLAS chooses MKL or OpenBLAS as BLAS library for MegEngine. (default MKL)
  • MGE_CUDA_GENCODE supplies the -gencode option for nvcc. (default not supply)
  • MGE_DISABLE_FLOAT16 if disable float16 support. (default OFF)
  • MGE_ENABLE_EXCEPTIONS if enable exception support in C++. (default ON)
  • MGE_ENABLE_LOGGING if enable logging in MegEngine. (default AUTO)

More options can be found by:

cd build
cmake -LAH .. 2>/dev/null| grep -B 1 'MGE_' | less

How to Contribute

We believe we can build an open and friendly community and power humanity with AI.

How to contact us

Resources

License

MegEngine is Licensed under the Apache License, Version 2.0

Copyright (c) 2014-2020 Megvii Inc. All rights reserved.

megengine's People

Contributors

megvii-mge avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.