The convGemm library performs the convolution operation using an implicit im2row or im2col over a GEMM operation with matrices in either the NHWC or NCHW format, respectively.
To compile and install the convGemm library, the BLIS library should be installed on the system following the next structure:
BLIS_INSTALL_PREFIX
|-- include/blis/blis.h
`-- lib/libblis.so
Once the BLIS library is installed, the next commands should be executed to compile and install the convGemm library:
cd build
cmake [-D CMAKE_PREFIX_PATH=BLIS_INSTALL_PREFIX] [-D CMAKE_INSTALL_PREFIX=INSTALL_PREFIX] ..
make # Alternatively: cmake --build . --clean-first
make install # Alternatively: cmake --install . (this does not work with cmake older versions)where BLIS_INSTALL_PREFIX is the prefix PATH where BLIS is installed and INSTALL_PREFIX is the prefix PATH
where lib/libconvGemm.so and include/convgemm.h will be installed.
The -D CMAKE_PREFIX_PATH=BLIS_INSTALL_PREFIX option of the cmake .. command only is necessary if:
- BLIS is not installed in a system PATH,
- the environment variable
LD_LIBRARY_PATHis not defined or does not include theBLIS_INSTALL_PREFIXPATH, and BLIS_INSTALL_PREFIXis different ofINSTALL_PREFIX.
As for the -D CMAKE_PREFIX_PATH=INSTALL_PREFIX option, it is only required if the convGemmNHWC library should be
installed on a prefix PATH different of /usr/local.
For example, if BLIS is installed under ~/opt/hpca_pydtnn and the convGemm library should be installed also under
that directory, the next commands should be executed:
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)To run the included tests, the next commands should be executed:
cd build
cmake -D CMAKE_INSTALL_PREFIX=~/opt/hpca_pydtnn -D COMPILE_TESTS=ON ..
make TEST_TO_BE_RUN # Alternatively: cmake --build . --target=TEST_TO_BE_RUNwhere TEST_TO_BE_RUN is one of the following:
- run_all_tests
- run_test_base
- run_test_trans
- run_test_back
The tests output files will be written to the build/tests/ subdirectory.