Coder Social home page Coder Social logo

liuguoyou / miopen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rocm/miopen

0.0 3.0 0.0 4.72 MB

AMD's Machine Intelligence Library

Home Page: https://rocmsoftwareplatform.github.io/MIOpen/doc/html/

License: MIT License

Shell 0.62% CMake 2.28% C++ 52.47% C 34.76% Assembly 7.05% Batchfile 2.81%

miopen's Introduction

MIOpen

AMD's library for high peformance machine learning primitives. MIOpen supports two programming models -

  1. OpenCL
  2. HIP

Prerequisites

  • A ROCm enabled platform, more info here
  • Base software stack, which includes
    • OpenCL - OpenCL libraries and header files
    • HIP -
      • HIP and HCC libraries and header files
      • clang-ocl -- required
  • MIOpen relies on the miopengemm library to enable several functionalities that require GEMM. miopengemm is recommended but not required.
  • ROCm cmake modules can be installed from here

Please find the install instructions on the above dependencies on their respective repositories.

Configure with cmake

First create a build directory:

mkdir build; cd build;

Next configure cmake. The preferred backend for MIOpen can be set using the -DMIOPEN_BACKEND cmake variable.

For OpenCL, run:

cmake -DMIOPEN_BACKEND=OpenCL ..

The above assumes that OpenCL is installed in one of the standard locations. If not, then manually set these two cmake variables:

cmake -DMIOPEN_BACKEND=OpenCL -DOPENCL_LIBRARIES=<opencl-library-path> -DOPENCL_INCLUDE_DIRS<opencl-headers-path> ..

For HIP, run:

Set the C++ compiler to hcc.

cmake -DMIOPEN_BACKEND=HIP -DCMAKE_PREFIX_PATH="<hip-installed-path>;<hcc-installed-path>;<clang-ocl-installed-path>" ..

An example cmake step can be:

CXX=/opt/rocm/hcc/bin/hcc cmake -DMIOPEN_BACKEND=HIP -DCMAKE_PREFIX_PATH="/opt/rocm/hcc;/opt/rocm/hip" ..

By default the install location is set to '/opt/rocm', this can be set by using CMAKE_INSTALL_PREFIX:

cmake -DMIOPEN_BACKEND=OpenCL -DCMAKE_INSTALL_PREFIX=<miopen-installed-path> ..

Also, the path to database for network configs can be set using the MIOPEN_DB_PATH variable. By default it is set to where the database files would be installed. For development purposes, setting BUILD_DEV will set the path to the database files stored in the source directory:

cmake -DMIOPEN_BACKEND=OpenCL -DBUILD_DEV=On ..

The configuration can be changed after running cmake by using ccmake:

ccmake .. OR cmake-gui: cmake-gui ..

The ccmake program is not available on windows.

Building the library

The library can be built, from the build directory using the 'Release' configuration:

cmake --build . --config Release OR make

And can be installed by using the 'install' target:

cmake --build . --config Release --target install OR make install

This will install the library to the CMAKE_INSTALL_PREFIX path that was set.

Building the driver

MIOpen provides an application-driver which can be used to execute any one particular layer in isolation and measure performance and verification of the library.

The driver can be built using the MIOpenDriver target:

cmake --build . --config Release --target MIOpenDriver OR make MIOpenDriver

Documentation on how to run the driver is here

Running the tests

The tests can be run by using the 'check' target:

cmake --build . --config Release --target check OR make check

A single test can be built and ran, by doing:

cmake --build . --config Release --target test_tensor
./test/test_tensor

Building the documentation

HTML and PDF documentation can be built using:

cmake --build . --config Release --target doc OR make doc

This will build a local searchable web site inside the ./MIOpen/doc/html folder and a PDF document inside the ./MIOpen/doc/pdf folder.

Documentation is built using generated using Doxygen and should be installed separately.

HTML and PDFs are generated using Sphinx and Breathe, with the ReadTheDocs theme.

Requirements for both Sphinx, Breathe, and the ReadTheDocs theme can be filled for these in the MIOpen/doc folder:

pip install -r ./requirements.txt

Depending on your setup sudo may be required for the pip install.

Formatting the code

All the code is formatted using clang-format. To format a file, use:

clang-format-3.8 -style=file -i <path-to-source-file>

Also, githooks can be installed to format the code per-commit:

./.githooks/install

miopen's People

Contributors

pfultz2 avatar atamazov avatar drizztdourden avatar kirpich30000 avatar rgiduthuri avatar newling avatar rampitec avatar ce1adon avatar bragadeesh avatar jgoldsamd avatar ashishfarmer avatar bensander avatar poznano-amd avatar dagamayank avatar mikalaidrabovich avatar patflick avatar anoupouet avatar sunway513 avatar

Watchers

James Cloos avatar 刘国友 avatar  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.