Giter Club home page Giter Club logo

convdirect's Introduction

convDirect

The convDirect library provides different implementations of the direct convolution operation.

Compilation and installation

To compile and install all the convDirect implementations in the convDirect library, the next software should be available:

As convDirect also provides a direct call to convGemm, after cloning this project, the corresponding git submodule should be initialized with:

git submodule update --init

In case you want to update the convGemm submodule to the most recent version, the next command should be executed:

git submodule update --remote --merge

Please note that CMake is used to build convDirect. In case you require a more recent version of CMake, you can download it from https://cmake.org/download/ To install CMake from a compressed CMake archive, just uncompress it and add the 'cmake-VERSION-ARCH/bin' directory to the system PATH.

To compile and install the convDirect library, please execute the next commands:

cd build
cmake -D CMAKE_PREFIX_PATH="BLIS_INSTALL_PREFIX;TVM_INSTALL_PREFIX" -D CMAKE_INSTALL_PREFIX=INSTALL_PREFIX ..
make                 # Alternatively:  cmake --build . --clean-first
make install         # Alternatively:  cmake --install .

where BLIS_INSTALL_PREFIX is the prefix PATH where BLIS is installed, TVM_INSTALL_PREFIX is the prefix PATH where TVM is installed, if it is installed on a different path than BLIS, and INSTALL_PREFIX is the prefix PATH where lib/libconvDirect.so and include/convdirect.h will be installed.

The -D CMAKE_PREFIX_PATH=BLIS_INSTALL_PREFIX option on the first cmake command only is necessary if:

  1. BLIS is not installed in a system PATH,
  2. the environment variable LD_LIBRARY_PATH is not defined or does not include the BLIS_INSTALL_PREFIX PATH, and
  3. BLIS_INSTALL_PREFIX is different of INSTALL_PREFIX.

The same applies to TVM_INSTALL_PREFIX, but for Apache TVM.

As for the -D CMAKE_PREFIX_PATH=INSTALL_PREFIX option, it is only required if the convDirect library should be installed on a prefix PATH different of /usr/local.

For example, if BLIS is installed under ~/opt/hpca_pydtnn and the convDirect library should be installed also under that directory, the next commands are sufficient:

cd build
cmake -D CMAKE_INSTALL_PREFIX=~/opt/hpca_pydtnn ..
make                 # Alternatively:  cmake --build . --clean-first
make install         # Alternatively:  cmake --install . (this does not work with cmake older versions)

Performance evaluation of the different implementations

To evaluate all the provided implementations on convDirect, recompile convDirect adding the -D COMPILE_TESTS=ON option and execute the evaluation target. For example as in:

cd build
cmake -D CMAKE_INSTALL_PREFIX=~/opt/hpca_pydtnn -D COMPILE_TESTS=ON ..
make evaluation      # Alternatively:  cmake --build . --target=evaluation

A Python script is also provided to automatically process the evaluation results and generate the corresponding plots. Once the evaluation is completed, the instructions to run it locally or on another machine will be shown on screen. This script requires the next Python modules: numpy, pandas, tabulate, matplotlib.

Testing the different implementations

To test the different implementations against a reference convolution, recompile convDirect adding the -D COMPILE_TESTS=ON option and execute the all_close_test target. For example as in:

cd build
cmake -D CMAKE_INSTALL_PREFIX=~/opt/hpca_pydtnn -D COMPILE_TESTS=ON ..
make all_close_test  # Alternatively:  cmake --build . --target=all_close_test

Please note that the performance results shown while performing this test can not be accurate as only one iteration of each evaluated convolution is performed.

convdirect's People

Contributors

antodo avatar barrachi avatar enriquesquintana avatar martineh avatar mdolz avatar

Stargazers

 avatar  avatar

Watchers

 avatar

convdirect's Issues

Test convDirect implementations with PyDTNN

Dear convDirect team,

First thank you very much for this work and making it available to the community.

Currently, I am trying to reproduce the promising performance measurements of the article Performance–energy trade-offs of deep learning convolution algorithms on ARM processors.

However after some tries I cannot find a way to make it works in my case. Do you have any insights about how to test the direct convolutions implemented in this repository with the framework PyDTNN to reproduce your experiments ? I kind of stuck, lacking of documentation right now. Can you advise me where I should start with it ?

Any help will be kindly appreciated 🙂

Compile Error!

When run the 'make' command, two errors occurred. How can i solve this problem?

Error 1: src/convGemm/src/gemm_blis.c:33:68: error: ‘l3ukr_t’ undeclared (first use in this function); did you mean ‘ukr_t’?

Error 2: /src/convGemm/src/gemm_blis.c:33:76: error: expected ‘)’ before ‘BLIS_GEMM’

blis_gemm_kernel = bli_cntx_get_l3_nat_ukr_dt(BLIS_FLOAT, (l3ukr_t) BLIS_GEMM, blis_cntx)

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.