Coder Social home page Coder Social logo

flashlight / flashlight Goto Github PK

View Code? Open in Web Editor NEW
5.1K 123.0 499.0 15.87 MB

A C++ standalone library for machine learning

Home Page: https://fl.readthedocs.io/en/latest/

License: MIT License

CMake 4.02% C++ 78.47% C 0.27% Python 0.30% Cuda 0.17% Shell 0.06% Jupyter Notebook 16.70%
flashlight machine-learning autograd cpp deep-learning neural-network ml

flashlight's Introduction

CircleCI Documentation Status Docker Image Build Status Join the chat at https://gitter.im/flashlight-ml/community

codecov

Docker Image for CUDA backend Docker Image for CPU backend

Install CUDA backend with vcpkg Install CPU backend with vcpkg

Flashlight is a fast, flexible machine learning library written entirely in C++ from the Facebook AI Research and the creators of Torch, TensorFlow, Eigen and Deep Speech. Its core features include:

  • Total internal modifiability including internal APIs for tensor computation.
  • A small footprint, with the core clocking in at under 10 MB and 20k lines of C++.
  • High-performance defaults featuring just-in-time kernel compilation with modern C++ via the ArrayFire tensor library.
  • An emphasis on efficiency and scale.

Native support in C++ and simple extensibility makes Flashlight a powerful research framework that enables fast iteration on new experimental setups and algorithms with little unopinionation and without sacrificing performance. In a single repository, Flashlight provides apps for research across multiple domains:

Project Layout

Flashlight is broken down into a few parts:

  • flashlight/lib contains kernels and standalone utilities for audio processing and more.
  • flashlight/fl is the core tensor interface and neural network library using the ArrayFire tensor library by default.
  • flashlight/pkg are domain packages for speech, vision, and text built on the core.
  • flashlight/app are applications of the core library to machine learning across domains.

Quickstart

First, build and install Flashlight and link it to your own project.

Sequential forms a sequence of Flashlight Modules for chaining computation.

Implementing a simple convnet is easy.
#include <flashlight/fl/flashlight.h>

Sequential model;

model.add(View(fl::Shape({IM_DIM, IM_DIM, 1, -1})));
model.add(Conv2D(
    1 /* input channels */,
    32 /* output channels */,
    5 /* kernel width */,
    5 /* kernel height */,
    1 /* stride x */,
    1 /* stride y */,
    PaddingMode::SAME; /* padding mode */,
    PaddingMode::SAME; /* padding mode */));
model.add(ReLU());
model.add(Pool2D(
    2 /* kernel width */,
    2 /* kernel height */,
    2 /* stride x */,
    2 /* stride y */));
model.add(Conv2D(32, 64, 5, 5, 1, 1, PaddingMode::SAME, PaddingMode::SAME));
model.add(ReLU());
model.add(Pool2D(2, 2, 2, 2));
model.add(View(fl::Shape({7 * 7 * 64, -1})));
model.add(Linear(7 * 7 * 64, 1024));
model.add(ReLU());
model.add(Dropout(0.5));
model.add(Linear(1024, 10));
model.add(LogSoftmax());

Performing forward and backward computation is straightforwards:

auto output = model.forward(input);
auto loss = categoricalCrossEntropy(output, target);
loss.backward();

See the MNIST example for a full tutorial including a training loop and dataset abstractions.

Variable is a tape-based abstraction that wraps Flashlight tensors. Tape-based Automatic differentiation in Flashlight is simple and works as you'd expect.

Autograd Example
auto A = Variable(fl::rand({1000, 1000}), true /* calcGrad */);
auto B = 2.0 * A;
auto C = 1.0 + B;
auto D = log(C);
D.backward(); // populates A.grad() along with gradients for B, C, and D.

Building and Installing

Install with vcpkg | With Docker | From Source | From Source with vcpkg | Build Your Project with Flashlight

Requirements

At minimum, compilation requires:

  • A C++ compiler with good C++17 support (e.g. gcc/g++ >= 7)
  • CMake — version 3.10 or later, and make
  • A Linux-based operating system.

See the full dependency list for more details if building from source.

Instructions for building/installing Python bindings can be found here.

Flashlight Build Setups

Flashlight can be broken down into several components as described above. Each component can be incrementally built by specifying the correct build options.

There are two ways to work with Flashlight:

  1. As an installed library that you link to with your own project. This is best for building standalone applications dependent on Flashlight.
  2. With in-source development where the Flashlight project source is changed and rebuilt. This is best if customizing/hacking the core framework or the Flashlight-provided app binaries.

Flashlight can be built in one of two ways:

  1. With vcpkg, a C++ package manager.
  2. From source by installing dependencies as needed.

Installing Flashlight with vcpkg

Library Installation with vcpkg

Flashlight is most-easily built and installed with vcpkg. Both the CUDA and CPU backends are supported with vcpkg. For either backend, first install Intel MKL. For the CUDA backend, install CUDA >= 9.2, cuDNN, and NCCL. Then, after installing vcpkg, install the libraries and core with:

./vcpkg/vcpkg install flashlight-cuda # CUDA backend, OR
./vcpkg/vcpkg install flashlight-cpu  # CPU backend

To install Flashlight apps, check the features available for installation by running ./vcpkg search flashlight-cuda or ./vcpkg search flashlight-cpu. Each app is a "feature": for example, ./vcpkg install flashlight-cuda[asr] installs the ASR app with the CUDA backend.

Below is the currently-supported list of features (for each of flashlight-cuda and flashlight-cpu):

flashlight-{cuda/cpu}[lib]      # Flashlight libraries
flashlight-{cuda/cpu}[nn]       # Flashlight neural net library
flashlight-{cuda/cpu}[asr]      # Flashlight speech recognition app
flashlight-{cuda/cpu}[lm]       # Flashlight language modeling app
flashlight-{cuda/cpu}[imgclass] # Flashlight image classification app

Flashlight app binaries are also built for the selected features and are installed into the vcpkg install tree's tools directory.

Integrating Flashlight into your own project with is simple using vcpkg's CMake toolchain integration.

From-Source Build with vcpkg

First, install the dependencies for your backend of choice using vcpkg (click to expand the below):

Installing CUDA Backend Dependencies with vcpkg

To build the Flashlight CUDA backend from source using dependencies installed with vcpkg, install CUDA >= 9.2, cuDNN, NCCL, and Intel MKL, then build the rest of the dependencies for the CUDA backend based on which Flashlight features you'd like to build:

./vcpkg install \
    cuda intel-mkl fftw3 cub kenlm                \ # if building flashlight libraries
    arrayfire[cuda] cudnn nccl openmpi cereal stb \ # if building the flashlight neural net library
    gflags glog                                   \ # if building any flashlight apps
    libsndfile                                    \ # if building the flashlight asr app
    gtest                                           # optional, if building tests
Installing CPU Backend Dependencies with vcpkg

To build the Flashlight CPU backend from source using dependencies installed with vcpkg, install Intel MKL, then build the rest of the dependencies for the CPU backend based on which Flashlight features you'd like to build:

./vcpkg install \
    intel-mkl fftw3 kenlm                              \ # for flashlight libraries
    arrayfire[cpu] gloo[mpi] openmpi onednn cereal stb \ # for the flashlight neural net library
    gflags glog                                        \ # for the flashlight runtime pkg (any flashlight apps using it)
    libsndfile                                         \ # for the flashlight speech pkg
    gtest                                                # optional, for tests
Build Using the vcpkg Toolchain File

To build Flashlight from source with these dependencies, clone the repository:

git clone https://github.com/flashlight/flashlight.git && cd flashlight
mkdir -p build && cd build

Then, build from source using vcpkg's CMake toolchain:

cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DFL_BUILD_ARRAYFIRE=ON \
    -DCMAKE_TOOLCHAIN_FILE=[path to your vcpkg clone]/scripts/buildsystems/vcpkg.cmake
make -j$(nproc)
make install -j$(nproc) # only if you want to install Flashlight for external use

To build a subset of Flashlight's features, see the build options below.

Building from Source

To build from source, first install the below dependencies. Most are available with your system's local package manager.

Some dependencies marked below are downloaded and installed automatically if not found on the local system. FL_BUILD_STANDALONE determines this behavior — if disabled, dependencies won't be downloaded and built when building Flashlight.

Once all dependencies are installed, clone the repository:

git clone https://github.com/flashlight/flashlight.git && cd flashlight
mkdir -p build && cd build

Then build all Flashlight components with:

cmake .. -DCMAKE_BUILD_TYPE=Release -DFL_BUILD_ARRAYFIRE=ON [...build options]
make -j$(nproc)
make install

Setting the MKLROOT environment variable (export MKLROOT=/opt/intel/oneapi/mkl/latest or export MKLROOT=/opt/intel/mkl on most Linux-based systems) can help CMake find Intel MKL if not initially found.

To build a smaller subset of Flashlight features/apps, see the build options below for a complete list of options.

To install Flashlight in a custom directory, use CMake's CMAKE_INSTALL_PREFIX argument. Flashlight libraries can be built as shared libraries using CMake's BUILD_SHARED_LIBS argument.

Flashlight uses modern CMake and IMPORTED targets for most dependencies. If a dependency isn't found, passing -D<package>_DIR to your cmake command or exporting <package>_DIR as an environment variable equal to the path to <package>Config.cmake can help locate dependencies on your system. See the documentation for more details. If CMake is failing to locate a package, check to see if a corresponding issue has already been created before creating your own.

Minimal setup on macOS

On MacOS, ArrayFire can be installed with homebrew and the Flashlight core can be built as follows:

brew install arrayfire
cmake .. \
      -DFL_ARRAYFIRE_USE_OPENCL=ON \
      -DFL_USE_ONEDNN=OFF \
      -DFL_BUILD_TESTS=OFF \
      -DFL_BUILD_EXAMPLES=OFF \
      -DFL_BUILD_SCRIPTS=OFF \
      -DFL_BUILD_DISTRIBUTED=OFF
make -j$(nproc)

Dependencies

Dependencies marked with * are automatically downloaded and built from source if not found on the system. Setting FL_BUILD_STANDALONE to OFF disables this behavior.

Dependencies marked with ^ are required if building with distributed training enabled (FL_BUILD_DISTRIBUTED — see the build options below). Distributed training is required for all apps.

Dependencies marked with are installable via vcpkg. See the instructions for installing those dependencies above for doing a Flashlight from-source build.

Component Backend Dependencies
libraries CUDA CUDA >= 9.2, CUB*† (if CUDA < 11)
CPU A BLAS library (Intel MKL >= 2018, OpenBLAS†, etc)
core Any ArrayFire >= 3.7.3†, an MPI library^(OpenMPI†, etc),  cereal*† >= 1.3.0, stb*†
CUDA CUDA >= 9.2, NCCL^, cuDNN
CPU oneDNN† >= 2.5.2, gloo (with MPI)*^†
app: all Any Google Glog†, Gflags
app: asr Any libsndfile*† >= 10.0.28, a BLAS library (Intel MKL >= 2018, OpenBLAS†, etc), flashlight/text*
app: imgclass Any -
app: imgclass Any -
app: lm Any flashlight/text*
tests Any Google Test (gtest, with gmock)*† >= 1.10.0

Build Options

The Flashlight CMake build accepts the following build options (prefixed with -D when running CMake from the command line):

Name Options Default Value Description
FL_BUILD_ARRAYFIRE ON, OFF ON Build Flashlight with the ArrayFire backend.
ON, OFF ON Downloads/builds some dependencies if not found.
FL_BUILD_LIBRARIES ON, OFF ON Build the Flashlight libraries.
ON, OFF ON Build the Flashlight neural net library.
ON, OFF ON Build with distributed training; required for apps.
FL_BUILD_CONTRIB ON, OFF ON Build contrib APIs subject to breaking changes.
FL_BUILD_APPS ON, OFF ON Build applications (see below).
FL_BUILD_APP_ASR ON, OFF ON Build the automatic speech recognition application.
FL_BUILD_APP_IMGCLASS ON, OFF ON Build the image classification application.
FL_BUILD_APP_LM ON, OFF ON Build the language modeling application.
FL_BUILD_APP_ASR_TOOLS ON, OFF ON Build automatic speech recognition app tools.
FL_BUILD_TESTS ON, OFF ON Build tests.
FL_BUILD_EXAMPLES ON, OFF ON Build examples.
FL_BUILD_EXPERIMENTAL ON, OFF OFF Build experimental components.
CMAKE_BUILD_TYPE See docs. Debug See the CMake documentation.
CMAKE_INSTALL_PREFIX [Directory] See docs. See the CMake documentation.

Building Your Own Project with Flashlight

Flashlight is most-easily linked to using CMake. Flashlight exports the following CMake targets when installed:

  • flashlight::flashlight — contains flashlight libraries as well as the flashlight core autograd and neural network library.
  • flashlight::fl_pkg_runtime — contains flashlight core as well as common utilities for training (logging / flags / distributed utils).
  • flashlight::fl_pkg_vision — contains flashlight core as well as common utilities for vision pipelines.
  • flashlight::fl_pkg_text — contains flashlight core as well as common utilities for dealing with text data.
  • flashlight::fl_pkg_speech — contains flashlight core as well as common utilities for dealing with speech data.
  • flashlight::fl_pkg_halide — contains flashlight core and extentions to easily interface with halide.

Given a simple project.cpp file that includes and links to Flashlight:

#include <iostream>

#include <flashlight/fl/flashlight.h>

int main() {
  fl::init();
  fl::Variable v(fl::full({1}, 1.), true);
  auto result = v + 10;
  std::cout << "Tensor value is " << result.tensor() << std::endl; // 11.000
  return 0;
}

The following CMake configuration links Flashlight and sets include directories:

cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(myProject project.cpp)

find_package(flashlight CONFIG REQUIRED)
target_link_libraries(myProject PRIVATE flashlight::flashlight)

With a vcpkg Flashlight Installation

If you installed Flashlight with vcpkg, the above CMake configuration for myProject can be built by running:

cd project && mkdir build && cd build
cmake .. \
  -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg clone]/scripts/buildsystems/vcpkg.cmake \
  -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

With a From-Source Flashlight Installation

If using a from-source installation of Flashlight, Flashlight will be found automatically by CMake:

cd project && mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

If Flashlight is installed in a custom location using a CMAKE_INSTALL_PREFIX, passing -Dflashlight_DIR=[install prefix]/share/flashlight/cmake as an argument to your cmake command can help CMake find Flashlight.

Building and Running Flashlight with Docker

Flashlight and its dependencies can also be built with the provided Dockerfiles; see the accompanying Docker documentation for more information.

Contributing and Contact

Contact: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]

Flashlight is being very actively developed. See CONTRIBUTING for more on how to help out.

Acknowledgments

Some of Flashlight's code is derived from arrayfire-ml.

Citing

You can cite Flashlight using:

@misc{kahn2022flashlight,
      title={Flashlight: Enabling Innovation in Tools for Machine Learning},
      author={Jacob Kahn and Vineel Pratap and Tatiana Likhomanenko and Qiantong Xu and Awni Hannun and Jeff Cai and Paden Tomasello and Ann Lee and Edouard Grave and Gilad Avidov and Benoit Steiner and Vitaliy Liptchinsky and Gabriel Synnaeve and Ronan Collobert},
      year={2022},
      eprint={2201.12465},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}

License

Flashlight is under an MIT license. See LICENSE for more information.

flashlight's People

Contributors

0xjc avatar akhti avatar an918tw avatar andresy avatar avidov avatar benborder avatar brettkoonce avatar bwasti avatar dependabot[bot] avatar galv avatar jacobkahn avatar jubick1337 avatar lnicco avatar lunixbochs avatar massens avatar mtmd avatar padentomasello avatar pavelzw avatar pcpliu avatar r-barnes avatar realdoug avatar seaotocinclus avatar stanislavglebik avatar strongerxi avatar syhw avatar vineelpratap avatar williamtambellini avatar xuqiantong avatar yfeldblum avatar zpao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flashlight's Issues

make failed

Hi, I am working on installing flashlight to linux CentOS 7 server and having problem now.
my g++ version is,

g++ (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I am installing flashlight using these script sequentially,

  1. git clone --recursive https://github.com/facebookresearch/flashlight.git
  2. cd flashlight
  3. mkdir -p build && cd build
  4. sudo cmake3 .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CUDA -DArrayFire_DIR=/opt/arrayfire-no-gl/share/ArrayFire/cmake/
  5. sudo make -j16 # this line makes Error.
  6. sudo make install
    And 5th line makes this error message.
In file included from /home/minds/flashlight/flashlight/distributed/DistributedApi.cpp:9:0:
/home/minds/flashlight/flashlight/distributed/DistributedApi.h:33:68: error: converting to 'const std::unordered_map<std::basic_string<char>, std::basic_string<char> >' from initializer list would use explicit constructor 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = std::basic_string<char>; _Tp = std::basic_string<char>; _Hash = std::hash<std::basic_string<char> >; _Pred = std::equal_to<std::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::basic_string<char>, std::basic_string<char> > >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = long unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<std::basic_string<char> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<std::basic_string<char> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<const std::basic_string<char>, std::basic_string<char> > >]'
     const std::unordered_map<std::string, std::string>& params = {});
                                                                    ^
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/distributed/DistributedApi.cpp.o] Error 1
make[1]: *** [CMakeFiles/flashlight.dir/all] Error 2
make: *** [all] Error 2

I searched many documents and one of the solutions can be downgrading g++ version.
Should I downgrade g++ version to 4.8 or lower? I wonder Is there any other solutions.

cmake failed on CPU backend

Hi,

It's on Ubuntu 18.04 and I have installed ArrayFire.
I got the following errors when I want to install flashlight.

CMake Error at /usr/local/share/ArrayFire/cmake/ArrayFireConfig.cmake:131 (get_property):
get_property given invalid argument "RELEASE".
Call Stack (most recent call first):
CMakeLists.txt:63 (find_package)

CMake Error at /usr/local/share/ArrayFire/cmake/ArrayFireConfig.cmake:131 (get_property):
get_property given invalid argument "RELEASE".
Call Stack (most recent call first):
CMakeLists.txt:63 (find_package)

-- ArrayFire found (include: /usr/local/include, library: )
CMake Error at CMakeLists.txt:77 (message):
ArrayFire CPU not found: cannot build CPU backend

-- Configuring incomplete, errors occurred!
See also "/home/akatsuki/flashlight/build/CMakeFiles/CMakeOutput.log".

Could not build with CPU backend

Hello everyone,

I attempted to compile the flashlight from source but failed.

After successfully installing mkl-dnn/arrayfire/floo/googletest, I did the following to compile flashlight:

mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CPU

I got the compiling errors as follows:

[  1%] Performing build step for 'cereal'
[  1%] No install step for 'cereal'
[  1%] Completed 'cereal'
[  1%] Built target cereal
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/backend/cpu/Conv2D.cpp.o
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:18:0:
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/MkldnnUtils.h: In constructor ‘fl::detail::MkldnnStream::MkldnnStream()’:
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/MkldnnUtils.h:26:44: error: ‘mkldnn::stream::kind’ has not been declared
   MkldnnStream() : stream_(mkldnn::stream::kind::eager) {}
                                            ^~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/MkldnnUtils.h: At global scope:
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/MkldnnUtils.h:77:27: error: ‘primitive_desc’ in ‘struct mkldnn::memory’ does not name a type
     const mkldnn::memory::primitive_desc& desc);
                           ^~~~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp: In function ‘fl::Variable fl::conv2d(const fl::Variable&, const fl::Variable&, const fl::Variable&, int, int, int, int, int, int, int)’:
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:86:28: error: ‘mkldnn::memory::format’ has not been declared
   auto formatAny = memory::format::any;
                            ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:90:29: error: ‘mkldnn::memory::format’ has not been declared
   auto formatNCHW = memory::format::nchw;
                             ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:92:31: error: ‘mkldnn::memory::format’ has not been declared
       (groups == 1) ? memory::format::oihw : memory::format::goihw;
                               ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:92:54: error: ‘mkldnn::memory::format’ has not been declared
       (groups == 1) ? memory::format::oihw : memory::format::goihw;
                                                      ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:178:75: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
       {{{mInputDims}, dataType, formatNCHW}, mkldnnEngine}, inputRaw.get());
                                                                           ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:181:77: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
       {{{mOutputDims}, dataType, formatNCHW}, mkldnnEngine}, outputRaw.get());
                                                                             ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:185:23: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
       weightsRaw.get());
                       ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:193:37: error: ‘using element_type = struct mkldnn::convolution_forward::primitive_desc {aka struct mkldnn::convolution_forward::primitive_desc}’ has no member named ‘src_primitive_desc’; did you mean ‘primitive_desc’?
   auto inputPrimDesc = fwdPrimDesc->src_primitive_desc();
                                     ^~~~~~~~~~~~~~~~~~
                                     primitive_desc
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:194:39: error: ‘using element_type = struct mkldnn::convolution_forward::primitive_desc {aka struct mkldnn::convolution_forward::primitive_desc}’ has no member named ‘weights_primitive_desc’; did you mean ‘primitive_desc’?
   auto weightsPrimDesc = fwdPrimDesc->weights_primitive_desc();
                                       ^~~~~~~~~~~~~~~~~~~~~~
                                       primitive_desc
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:195:38: error: ‘using element_type = struct mkldnn::convolution_forward::primitive_desc {aka struct mkldnn::convolution_forward::primitive_desc}’ has no member named ‘dst_primitive_desc’; did you mean ‘primitive_desc’?
   auto outputPrimDesc = fwdPrimDesc->dst_primitive_desc();
                                      ^~~~~~~~~~~~~~~~~~
                                      primitive_desc
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:202:23: error: unable to deduce ‘auto’ from ‘outputMemoryInit’
   auto outputMemory = outputMemoryInit;
                       ^~~~~~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:204:15: error: ‘primitive_desc’ is not a member of ‘mkldnn::memory’
       memory::primitive_desc(outputPrimDesc)) {
               ^~~~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:211:29: error: ‘mkldnn::memory::format’ has not been declared
   auto formatBias = memory::format::x;
                             ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:213:73: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
       {{{mBiasDims}, dataType, formatBias}, mkldnnEngine}, biasRaw.get());
                                                                         ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:228:51: error: ‘struct mkldnn::stream’ has no member named ‘submit’
   detail::MkldnnStream::getInstance().getStream().submit(network);
                                                   ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp: In lambda function:
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:265:11: error: ‘inputMD’ is not captured
           inputMD,
           ^~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:130:8: note: ‘<typeprefixerror>inputMD’ declared here
   auto inputMD = memory::desc({mInputDims}, dataType, formatAny);
        ^~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:266:11: error: ‘weightMD’ is not captured
           weightMD,
           ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:132:8: note: ‘<typeprefixerror>weightMD’ declared here
   auto weightMD = memory::desc({mWeightDims}, dataType, formatWeight);
        ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:267:11: error: ‘outputMD’ is not captured
           outputMD,
           ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:131:8: note: ‘<typeprefixerror>outputMD’ declared here
   auto outputMD = memory::desc({mOutputDims}, dataType, formatAny);
        ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:281:38: error: ‘formatNCHW’ is not captured
           {{{mOutputDims}, dataType, formatNCHW}, mkldnnEngineBwd},
                                      ^~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:90:8: note: ‘<typeprefixerror>formatNCHW’ declared here
   auto formatNCHW = memory::format::nchw;
        ^~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:282:30: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
           gradOutputRaw.get());
                              ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:285:37: error: ‘formatNCHW’ is not captured
           {{{mInputDims}, dataType, formatNCHW}, mkldnnEngineBwd},
                                     ^~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:90:8: note: ‘<typeprefixerror>formatNCHW’ declared here
   auto formatNCHW = memory::format::nchw;
        ^~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:286:29: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
           gradInputRaw.get());
                             ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:289:38: error: ‘formatWeight’ is not captured
           {{{mWeightDims}, dataType, formatWeight}, mkldnnEngineBwd},
                                      ^~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:91:8: note: ‘<typeprefixerror>formatWeight’ declared here
   auto formatWeight =
        ^~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:290:26: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
           weightRaw.get());
                          ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:301:30: error: unable to deduce ‘auto’ from ‘gradInputMemoryInit’
       auto gradInputMemory = gradInputMemoryInit;
                              ^~~~~~~~~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:304:19: error: ‘primitive_desc’ is not a member of ‘mkldnn::memory’
           memory::primitive_desc(gradInputPrimitiveDesc)) {
                   ^~~~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:316:55: error: ‘struct mkldnn::stream’ has no member named ‘submit’
       detail::MkldnnStream::getInstance().getStream().submit(networkBackwards);
                                                       ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:344:13: error: ‘inputMD’ is not captured
             inputMD,
             ^~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:130:8: note: ‘<typeprefixerror>inputMD’ declared here
   auto inputMD = memory::desc({mInputDims}, dataType, formatAny);
        ^~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:345:13: error: ‘weightMD’ is not captured
             weightMD,
             ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:132:8: note: ‘<typeprefixerror>weightMD’ declared here
   auto weightMD = memory::desc({mWeightDims}, dataType, formatWeight);
        ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:346:13: error: ‘biasMD’ is not captured
             biasMD,
             ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:133:8: note: ‘<typeprefixerror>biasMD’ declared here
   auto biasMD = memory::desc({mBiasDims}, dataType, formatAny);
        ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:347:13: error: ‘outputMD’ is not captured
             outputMD,
             ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:131:8: note: ‘<typeprefixerror>outputMD’ declared here
   auto outputMD = memory::desc({mOutputDims}, dataType, formatAny);
        ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:356:13: error: ‘inputMD’ is not captured
             inputMD,
             ^~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:130:8: note: ‘<typeprefixerror>inputMD’ declared here
   auto inputMD = memory::desc({mInputDims}, dataType, formatAny);
        ^~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:357:13: error: ‘weightMD’ is not captured
             weightMD,
             ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:132:8: note: ‘<typeprefixerror>weightMD’ declared here
   auto weightMD = memory::desc({mWeightDims}, dataType, formatWeight);
        ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:358:13: error: ‘outputMD’ is not captured
             outputMD,
             ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:131:8: note: ‘<typeprefixerror>outputMD’ declared here
   auto outputMD = memory::desc({mOutputDims}, dataType, formatAny);
        ^~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:373:37: error: ‘formatNCHW’ is not captured
           {{{mInputDims}, dataType, formatNCHW}, mkldnnEngineBwd},
                                     ^~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:90:8: note: ‘<typeprefixerror>formatNCHW’ declared here
   auto formatNCHW = memory::format::nchw;
        ^~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:374:34: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
           inputRawBackwards.get());
                                  ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:377:38: error: ‘formatNCHW’ is not captured
           {{{mOutputDims}, dataType, formatNCHW}, mkldnnEngineBwd},
                                      ^~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:90:8: note: ‘<typeprefixerror>formatNCHW’ declared here
   auto formatNCHW = memory::format::nchw;
        ^~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:378:30: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
           gradOutputRaw.get());
                              ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:381:38: error: ‘formatWeight’ is not captured
           {{{mWeightDims}, dataType, formatWeight}, mkldnnEngineBwd},
                                      ^~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:250:3: note: the lambda has no capture-default
   ](std::vector<Variable>& inputs, const Variable& grad_output) {
   ^
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:91:8: note: ‘<typeprefixerror>formatWeight’ declared here
   auto formatWeight =
        ^~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:382:31: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
           gradWeightsRaw.get());
                               ^
In file included from /home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:14:0:
/usr/local/include/mkldnn.hpp:900:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&)
     memory(const desc &md, const engine &aengine)
     ^~~~~~
/usr/local/include/mkldnn.hpp:900:5: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const mkldnn::memory::desc&’
/usr/local/include/mkldnn.hpp:889:5: note: candidate: mkldnn::memory::memory(const mkldnn::memory::desc&, const mkldnn::engine&, void*)
     memory(const desc &md, const engine &aengine, void *ahandle) {
     ^~~~~~
/usr/local/include/mkldnn.hpp:889:5: note:   candidate expects 3 arguments, 2 provided
/usr/local/include/mkldnn.hpp:577:8: note: candidate: mkldnn::memory::memory(const mkldnn::memory&)
 struct memory: public handle<mkldnn_memory_t> {
        ^~~~~~
/usr/local/include/mkldnn.hpp:577:8: note:   candidate expects 1 argument, 2 provided
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:386:52: error: ‘using element_type = struct mkldnn::convolution_backward_weights::primitive_desc {aka struct mkldnn::convolution_backward_weights::primitive_desc}’ has no member named ‘src_primitive_desc’; did you mean ‘primitive_desc’?
       auto inputPrimitiveDesc = bwdWeightPrimDesc->src_primitive_desc();
                                                    ^~~~~~~~~~~~~~~~~~
                                                    primitive_desc
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:388:30: error: ‘using element_type = struct mkldnn::convolution_backward_weights::primitive_desc {aka struct mkldnn::convolution_backward_weights::primitive_desc}’ has no member named ‘diff_dst_primitive_desc’; did you mean ‘primitive_desc’?
           bwdWeightPrimDesc->diff_dst_primitive_desc();
                              ^~~~~~~~~~~~~~~~~~~~~~~
                              primitive_desc
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:390:30: error: ‘using element_type = struct mkldnn::convolution_backward_weights::primitive_desc {aka struct mkldnn::convolution_backward_weights::primitive_desc}’ has no member named ‘diff_weights_primitive_desc’; did you mean ‘diff_weights_desc’?
           bwdWeightPrimDesc->diff_weights_primitive_desc();
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                              diff_weights_desc
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:396:32: error: unable to deduce ‘auto’ from ‘gradWeightsMemoryInit’
       auto gradWeightsMemory = gradWeightsMemoryInit;
                                ^~~~~~~~~~~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:398:19: error: ‘primitive_desc’ is not a member of ‘mkldnn::memory’
           memory::primitive_desc(gradWeightsPrimitiveDesc)) {
                   ^~~~~~~~~~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:405:33: error: ‘mkldnn::memory::format’ has not been declared
       auto formatBias = memory::format::x;
                                 ^~~~~~
/home/vuh/works/tools/flashlight/flashlight/autograd/backend/cpu/Conv2D.cpp:408:33: error: no matching function for call to ‘mkldnn::memory::memory(<brace-enclosed initializer list>, void*)’
           biasRawBackwards.get());

It looks to me that the errors are related to MKL-DNN package. But I had no problem with cmake at all and cmake can link to installed mkl-dnn.

Would you able to help me on this? Thanks!

Design questions

Guys,
This is some design questions more than an 'issue' in the normal sense, that I'd be interested to hear your opinions on,

Let's suppose that instead of af::array you were using a class Tensor which you controlled, that implemented all the basic tensor functionality, and which had a fairly imperative interface (i.e. no expression-tree/jit magic happening behind the scenes).

In order to enable autograd, do you think would be better to just implement autograd by augmenting class Tensor itself with autograd machinery (so to get a plain old Tensor you would just set calcGrad = false)? The Torch/PyTorch people seem to be moving in that direction, if I correctly understand their response to an issue I raised there, and I assume they must have reasons for that choice. E.g. I suppose it avoids a bunch of indirection or wrapping, and it must avoid having to decide what to with mixed-type arguments. Personally I feel like it would make the code harder to wrap one's head around, though (and might lead to unnecessary expensive atomic operatins with shared_ptr's). LMK what you think about this.

A couple more specific questions about the autograd.

  • I notice your SharedGrad::grad is a pointer to Variable, not a plain old af::array. Do you think it could possibly be a reasonable choice to just make the grad a plain old array/Tensor/whatever, assuming one controlled the interface of that type? Flashlight doesn't support 2nd order derivatives, so I assume support for that is not the reason you made it a Variable rather than an af::array.

The above is separate from the choice of whether to expose the type array/Tensor in Python or whatever, if one was going to go in that direction. I can imagine that wrapping both array/Tensor and Variable at the python level, if one were to do that, might get to be a hassle, and I assume that's why PyTorch only exposes the C++ type Variable. I just feel like it might be nice to have a separate Tensor class at the C++ level, with a simple interface where one doesn't have to worry about autograd issues. But the PyTorch people might see something that I don't.

  • Do you think it would be reasonable to consider, instead of giving SharedGrad a vector of Variable as inputs, to just give it a vector of shared_ptr? And if the gradFunc needs access to any of the inputs, just pass them in using bound variables? That would avoid the need for withoutData(), and might reduce the chance of ever running into reference cycles.

Build Error

Hi, there, since I don't have a CUDA compatible machine, I built Arrayfire without CUDA backend, just cpu backend.

I set backend to cpu in CMakeFile.txt as follows:
set(FLASHLIGHT_BACKEND "CPU" CACHE STRING "Backend with which to build Arrayfire ML")

When issuing "cmake .." I encountered many errors:

"

CMake Error in CMakeLists.txt:
Target "Common" INTERFACE_INCLUDE_DIRECTORIES property contains path:

"/home/michael/fb/flashlight/CUDA_TOOLKIT_INCLUDE-NOTFOUND"

which is prefixed in the source directory.

"

Any idea how I can get this fixed?

Thank you.

How to turn off training mode?

My test code is here:

fl::Variable cell_input(af::randn(af::dim4(768, 1, 1)), false);
fl::RNN attention_rnn(768, 1024, 1, fl::RnnMode::LSTM);
attention_rnn.eval();
attention_rnn.zeroGrad();
fl::Variable hx(af::randn(af::dim4(1024, 1)), false), cx(af::randn(af::dim4(1024, 1)), false);
for(int i = 0; i < 100; i++)
{
    auto result = attention_rnn.forward(cell_input, hx, cx);
    fl::Variable output, hidden_state, cell_state;
    std::tie(output, hidden_state, cell_state) = result;
}

I want to turn off training mode, but It seems not working. I profiled this code by Nsight Systems and I saw that CuDNN::RNNForwardTraining is always called.

How to turn off training mode?

Erroneous comment in BatchNorm.cpp

In BatchNorm.cpp, a comment says:

// The input tesor is in WHCN order and layout in COLUMN-MAJOR (arrayfire).

This is not true. Arrayfire uses HWCN, not WHCN. As I have mentioned in this issue, although within flashlight WHCN is equivalent to HWCN as long as you keep it consistent, this becomes a problem when we need to port from another framework such as Pytorch or Tensorflow into Flashlight. This threw me off big time as we were trying to port a Pytorch DNN to FL. We should change this comment or at least add some information in parentheses about the true data layout.

make install failed on Ubuntu16.04

After all tests passed, I ran the command make install, but the error occurred:

[  0%] Performing update step for 'cereal'
[  0%] Performing configure step for 'cereal'
loading initial cache file /data/zd/flashlight/build/cereal/tmp/cereal-cache-Release.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /data/zd/flashlight/build/cereal/src/cereal
[  1%] Performing build step for 'cereal'
[  1%] No install step for 'cereal'
[  1%] Completed 'cereal'
[  1%] Built target cereal
[  7%] Built target flashlight
[  7%] Performing update step for 'gtest'
[  7%] Performing configure step for 'gtest'
loading initial cache file /data/zd/flashlight/build/tests/googletest/tmp/gtest-cache-Release.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /data/zd/flashlight/build/tests/googletest/src/gtest
[  8%] Performing build step for 'gtest'
[ 50%] Built target gtest
[100%] Built target gtest_main
[  8%] No install step for 'gtest'
[  8%] Completed 'gtest'
[  8%] Built target gtest
[ 14%] Built target ModuleTest
[ 20%] Built target OptimTest
[ 26%] Built target MeterTest
[ 33%] Built target SerializationTest
[ 39%] Built target DatasetTest
[ 45%] Built target AutogradTest
[ 51%] Built target AllReduceTest
[ 57%] Built target AdaptiveClassification
[ 64%] Built target LinearRegression
[ 70%] Built target RnnLm
[ 76%] Built target DistributedTraining
[ 82%] Built target Perceptron
[ 88%] Built target Mnist
[ 94%] Built target Classification
[100%] Built target Xor
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/include/flashlight/cereal/cereal
CMake Error at cmake_install.cmake:36 (file):
  file INSTALL cannot make directory
  "/usr/local/include/flashlight/cereal/cereal": No such file or directory


Makefile:71: recipe for target 'install' failed
make: *** [install] Error 1

According to the installation:https://fl.readthedocs.io/en/latest/installation.html#build-requirements
I think that Cereal would be installed automatically with flashlight, so I didn't install it independently.

Upgrade to AF 3.6.2

Seen in the main CMake :
find_package(ArrayFire 3.6.1 REQUIRED)
Note: I have seen a 30% speed up when upgrading my soft to AF 3.6.2.

Installation error on CPU backend

Hi,

I have a macOS 10.14.2 system (CPU only),

Installing flashlight (as per https://fl.readthedocs.io/en/latest/installation.html) is failing on it with the error below, even though mkl is installed.

cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CPU
-- ArrayFire found (include: /opt/arrayfire/include, library: ArrayFire::afcuda)
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - guide - pthread - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - guide - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - guide - pthread - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - guide - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread - m]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- MKL not found
CMake Error at CMakeLists.txt:131 (message):
MKL required to build CPU backend

How to resolve the error?

Make test does not finish

After compiling flashlight (with ArrayFire-no-gl-v3.6.2) using CUDA backend, I tried running make test but it takes forever and never finishes the first test. Looking at htop, AutogradTest is in state S and utilizing 0.0% CPU.

Any suggestions as what might be the issue?
Thanks

Benefit over Pytorch C++ API

What is the benefit of using flashlight over the Pytorch C++ API? Both are made by facebook, both have roughly the same API and both are quite heavy (the ArrayFire .SO file is > 750MB). The name "flashlight" would indicate it is a lightweight Pytorch ... I love the idea of a complete C++ neural network library but don't know why one should use this over Pytorch. I think I read somewhere they were going to deprecate Caffe in favour of Pytorch which lead me to believe that Facebook were going to focus their efforts on Pytorch.
I appreciate this isn't an issue but a question.

Add support for AF unified backend

Seen in the main CMake :
message(FATAL_ERROR "Building FLASHLIGHT with the Unified backend is not currently supported")
If I could help, what does nt work with the unified backend ?

Build fails with the following error on Ubuntu

Trying to install flashlight by invoking make -j 4 , however results in the following error:

/usr/bin/ld: warning: libGL.so.1, needed by /home/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfreetype.so.6, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfontconfig.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/home/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcDefaultSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Init_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Char_Index'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Load_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_New_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Glyph_To_Bitmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcNameParse'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcInitLoadConfigAndFonts'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcFontMatch'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternGetString'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Set_Pixel_Sizes'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Select_Charmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/Perceptron.dir/build.make:1480: recipe for target 'examples/Perceptron' failed
make[2]: *** [examples/Perceptron] Error 1
CMakeFiles/Makefile2:1515: recipe for target 'examples/CMakeFiles/Perceptron.dir/all' failed
make[1]: *** [examples/CMakeFiles/Perceptron.dir/all] Error 2
[ 32%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/Module.cpp.o
[ 33%] Building CXX object examples/CMakeFiles/AdaptiveClassification.dir/__/flashlight/optim/Utils.cpp.o
[ 33%] Building CXX object examples/CMakeFiles/DistributedTraining.dir/__/flashlight/nn/modules/Reorder.cpp.o
[ 33%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/Padding.cpp.o
[ 33%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/Pool2D.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/Reorder.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/RNN.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/Transform.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/DistributedTraining.dir/__/flashlight/nn/modules/RNN.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/DistributedTraining.dir/__/flashlight/nn/modules/Transform.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/DistributedTraining.dir/__/flashlight/nn/modules/View.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/DistributedTraining.dir/__/flashlight/nn/modules/WeightNorm.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/View.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/WeightNorm.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/nn/modules/Utils.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/DistributedTraining.dir/__/flashlight/nn/modules/Utils.cpp.o
[ 34%] Building CXX object examples/CMakeFiles/DistributedTraining.dir/__/flashlight/optim/Optimizers.cpp.o
[ 35%] Building CXX object examples/CMakeFiles/DistributedTraining.dir/__/flashlight/optim/Utils.cpp.o
[ 35%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/optim/Optimizers.cpp.o
[ 35%] Building CXX object examples/CMakeFiles/Xor.dir/__/flashlight/optim/Utils.cpp.o
[ 35%] Linking CXX executable LinearRegression
[ 35%] Linking CXX executable AdaptiveClassification
/usr/bin/ld: warning: libGL.so.1, needed by /home/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfreetype.so.6, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfontconfig.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/home/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcDefaultSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Init_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Char_Index'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Load_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_New_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Glyph_To_Bitmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcNameParse'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcInitLoadConfigAndFonts'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcFontMatch'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternGetString'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Set_Pixel_Sizes'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Select_Charmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/LinearRegression.dir/build.make:1480: recipe for target 'examples/LinearRegression' failed
make[2]: *** [examples/LinearRegression] Error 1
CMakeFiles/Makefile2:1404: recipe for target 'examples/CMakeFiles/LinearRegression.dir/all' failed
make[1]: *** [examples/CMakeFiles/LinearRegression.dir/all] Error 2
[ 35%] Linking CXX executable Classification
/usr/bin/ld: warning: libGL.so.1, needed by /home/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfreetype.so.6, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfontconfig.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/home/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcDefaultSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Init_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Char_Index'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Load_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_New_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Glyph_To_Bitmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcNameParse'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcInitLoadConfigAndFonts'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcFontMatch'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternGetString'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Set_Pixel_Sizes'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Select_Charmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/AdaptiveClassification.dir/build.make:1480: recipe for target 'examples/AdaptiveClassification' failed
make[2]: *** [examples/AdaptiveClassification] Error 1
CMakeFiles/Makefile2:1367: recipe for target 'examples/CMakeFiles/AdaptiveClassification.dir/all' failed
make[1]: *** [examples/CMakeFiles/AdaptiveClassification.dir/all] Error 2
/usr/bin/ld: warning: libGL.so.1, needed by /home/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfreetype.so.6, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfontconfig.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/home/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcDefaultSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Init_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Char_Index'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Load_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_New_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Glyph_To_Bitmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcNameParse'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcInitLoadConfigAndFonts'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcFontMatch'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternGetString'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Set_Pixel_Sizes'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Select_Charmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/Classification.dir/build.make:1480: recipe for target 'examples/Classification' failed
make[2]: *** [examples/Classification] Error 1
CMakeFiles/Makefile2:1589: recipe for target 'examples/CMakeFiles/Classification.dir/all' failed
make[1]: *** [examples/CMakeFiles/Classification.dir/all] Error 2
[ 35%] Linking CXX executable DistributedTraining
/usr/bin/ld: warning: libGL.so.1, needed by /home/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfreetype.so.6, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfontconfig.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/home/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcDefaultSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Init_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Char_Index'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Load_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_New_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Glyph_To_Bitmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcNameParse'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcInitLoadConfigAndFonts'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcFontMatch'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternGetString'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Set_Pixel_Sizes'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Select_Charmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/DistributedTraining.dir/build.make:1480: recipe for target 'examples/DistributedTraining' failed
make[2]: *** [examples/DistributedTraining] Error 1
CMakeFiles/Makefile2:1478: recipe for target 'examples/CMakeFiles/DistributedTraining.dir/all' failed
make[1]: *** [examples/CMakeFiles/DistributedTraining.dir/all] Error 2
[ 36%] Linking CXX executable Xor
/usr/bin/ld: warning: libGL.so.1, needed by /home/arrayfire/lib64/libafcuda.so.3.6.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfreetype.so.6, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libfontconfig.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXrandr.so.2, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXinerama.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXxf86vm.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libXcursor.so.1, needed by /home/arrayfire/lib64/libforge.so.1, not found (try using -rpath or -rpath-link)
/home/arrayfire/lib64/libglbinding.so.2: undefined reference to `glXGetProcAddress'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcDefaultSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageLoadCursor'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Init_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaQueryScreens'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XineramaIsActive'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSelectInput'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRampSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Char_Index'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Load_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Get_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_New_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigDestroy'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputPrimary'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Glyph_To_Bitmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeGetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentDisplay'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Glyph'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcNameParse'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `glXGetCurrentContext'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRAllocGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryExtension'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcInitLoadConfigAndFonts'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRUpdateConfiguration'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcFontMatch'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetScreenResourcesCurrent'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcConfig'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRGetCrtcGammaSize'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XF86VidModeSetGammaRamp'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_Face'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRSetCrtcGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcConfigSubstitute'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeOutputInfo'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Done_FreeType'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XcursorImageCreate'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FcPatternGetString'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRQueryVersion'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Set_Pixel_Sizes'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeScreenResources'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeGamma'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `FT_Select_Charmap'
/home/arrayfire/lib64/libforge.so.1: undefined reference to `XRRFreeCrtcInfo'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/Xor.dir/build.make:1480: recipe for target 'examples/Xor' failed
make[2]: *** [examples/Xor] Error 1
CMakeFiles/Makefile2:1626: recipe for target 'examples/CMakeFiles/Xor.dir/all' failed
make[1]: *** [examples/CMakeFiles/Xor.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Possible fix ? : /

Build fails on Ubuntu [CMake Error]

I am trying to setup flashlight on an Ubuntu machine. Have installed all the dependencies;

When I invoke : cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CUDA

I get the output as :

-- ArrayFire found (include: /home/hlc/my_software/arrayfire/include, library: ArrayFire::afcuda)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- CUDA found (library: /usr/local/cuda/lib64/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so include: /usr/local/cuda/include)
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Found CUDNN: (lib: /usr/local/cuda/lib64/libcudnn.so include: /usr/local/cuda/include)
-- CUDNN found (library: /usr/local/cuda/lib64/libcudnn.so include: /usr/local/cuda/include)
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Gloo not found
-- Determining NCCL version from the header file: /usr/include/nccl.h
-- NCCL_MAJOR_VERSION: 2
-- Found NCCL (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnccl.so)
-- NCCL found
-- MPI_CXX found
-- MPI_CXX compile flags: -pthread
-- MPI_CXX include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/openmpi/usr/lib/openmpi/include
-- MPI_CXX LINK flags path: -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags -pthread
-- MPI_CXX libraries: /usr/lib/openmpi/lib/libmpi_cxx.so/usr/lib/openmpi/lib/libmpi.so
-- MPI_C found
-- MPI_C compile flags: -pthread
-- MPI_C include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/openmpi/usr/lib/openmpi/include
-- MPI_C LINK flags path: -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags -pthread
-- MPI_C libraries: /usr/lib/openmpi/lib/libmpi.so
-- Configuring done
CMake Error at CMakeLists.txt:181 (add_library):
 Cannot find source file:
   /home/hlc/my_software/flashlight/flashlight/nn/modules/AdaptiveSoftMaxLoss.cpp
 Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm  .hpp .hxx .in .txx

CMake Error at tests/CMakeLists.txt:9 (add_executable):
 Cannot find source file:

   /home/hlc/my_software/flashlight/flashlight/nn/modules/AdaptiveSoftMaxLoss.cpp

 Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
 .hpp .hxx .in .txx
Call Stack (most recent call first):

 tests/CMakeLists.txt:40 (build_test)

CMake Error at examples/CMakeLists.txt:17 (add_executable):
 Cannot find source file:

   /home/hlc/my_software/flashlight/flashlight/nn/modules/AdaptiveSoftMaxLoss.cpp

 Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
 .hpp .hxx .in .txx
Call Stack (most recent call first):
 examples/CMakeLists.txt:32 (build_example)

-- Generating done

it seems can't find “flashlight/flashlight/nn/modules/AdaptiveSoftMaxLoss.cpp”
How do I solve this?

all tests failed when `make test`

when I make test, the following errors occurred:

Running tests...
Test project /home/zd/flashlight/build
    Start 1: AutogradTest
1/7 Test #1: AutogradTest .....................***Failed    0.00 sec
    Start 2: OptimTest
2/7 Test #2: OptimTest ........................***Failed    0.00 sec
    Start 3: ModuleTest
3/7 Test #3: ModuleTest .......................***Failed    0.00 sec
    Start 4: SerializationTest
4/7 Test #4: SerializationTest ................***Failed    0.00 sec
    Start 5: DatasetTest
5/7 Test #5: DatasetTest ......................***Failed    0.00 sec
    Start 6: MeterTest
6/7 Test #6: MeterTest ........................***Failed    0.00 sec
    Start 7: AllReduceTest
7/7 Test #7: AllReduceTest ....................***Failed    0.00 sec

0% tests passed, 7 tests failed out of 7

Total Test time (real) =   0.03 sec

The following tests FAILED:
	  1 - AutogradTest (Failed)
	  2 - OptimTest (Failed)
	  3 - ModuleTest (Failed)
	  4 - SerializationTest (Failed)
	  5 - DatasetTest (Failed)
	  6 - MeterTest (Failed)
	  7 - AllReduceTest (Failed)
Errors while running CTest
Makefile:106: recipe for target 'test' failed
make: *** [test] Error 8

My Ubuntu is 18.04 and cuda is 10.1.
I really don't know how to solve it.

AMD CPU

Does not support AMD CPUs due to MKL dependencies.

Perceptron example throws error

Hi. Thanks for this library. I installed flashlight using Arrayfire 3.6.2 in a docker container with ubuntu 18, cudnn7, and Cuda 10. I then built and ran the Perceptron example and got the following error:

/examples/build# ./Perceptron
ArrayFire v3.6.2 (CUDA, 64-bit Linux, build dc38ef1)
Platform: CUDA Toolkit 10, Driver: 410.48
[0] Quadro P5000, 16279 MB, CUDA Compute 6.1
terminate called after throwing an instance of 'std::invalid_argument'
what(): tensor for TensorDataset can't be 1-D or empty
Aborted (core dumped)

(My docker container is built from this Dockerfile https://github.com/paiforsyth/bin_fldocker/blob/master/Dockerfile which is based on an image from this Dockerfile https://github.com/paiforsyth/af_bin_docker/blob/master/Dockerfile )

Could NOT find CUDA (missing: CUDA_DIR)

Hi
I am building flashlisght with CUDA backend. I have Centos 7, CUDA 10.0, nvcc 10.0. When I run cmake as : cmake .. -DCMAKE_BUILD_TYPE=Release -DFL_BUILD_DISTRIBUTED=OFF

It gives following error :

-- Could NOT find CUDA (missing: CUDA_DIR)
-- CUDA not found
CMake Error at CMakeLists.txt:114 (message):
CUDA required to build CUDA backend

$PATH variable contains CUDA location. Can someone please tell me why I am getting this error ?

Install fails on Arch Linux. Throwing "cereal" error.

#uname -a: 4.19.9-arch1-1-ARCH

[  0%] Performing update step for 'gtest'
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/Variable.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/Functions.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/Utils.cpp.o
[  0%] Performing configure step for 'gtest'
loading initial cache file /home/cat/flashlight/build/tests/googletest/tmp/gtest-cache-Release.cmake
In file included from /home/cat/flashlight/flashlight/autograd/Variable.h:24,
                 from /home/cat/flashlight/flashlight/autograd/Utils.h:10,
                 from /home/cat/flashlight/flashlight/autograd/Utils.cpp:8:
/home/cat/flashlight/flashlight/common/Serialization.h:20:10: fatal error: cereal/access.hpp: No such file or directory
 #include <cereal/access.hpp>
          **^~~~~~~~~~~~~~~~~~~**
compilation terminated.
In file included from /home/cat/flashlight/flashlight/autograd/Variable.h:24,
                 from /home/cat/flashlight/flashlight/autograd/Functions.cpp:23:
/home/cat/flashlight/flashlight/common/Serialization.h:20:10: fatal error: cereal/access.hpp: No such file or directory
 #include <cereal/access.hpp>
          **^~~~~~~~~~~~~~~~~~~**
compilation terminated.
make[2]: *** [CMakeFiles/flashlight.dir/build.make:89: CMakeFiles/flashlight.dir/flashlight/autograd/Utils.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
**In file included from /home/cat/flashlight/flashlight/autograd/Variable.h:24,
                 from /home/cat/flashlight/flashlight/autograd/Variable.cpp:16:
/home/cat/flashlight/flashlight/common/Serialization.h:20:10: fatal error: cereal/access.hpp: No such file or directory
 #include <cereal/access.hpp>
          **^~~~~~~~~~~~~~~~~~~**
compilation terminated.
make[2]: *** [CMakeFiles/flashlight.dir/build.make:76: CMakeFiles/flashlight.dir/flashlight/autograd/Functions.cpp.o] Error 1
make[2]: *** [CMakeFiles/flashlight.dir/build.make:63: CMakeFiles/flashlight.dir/flashlight/autograd/Variable.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:969: CMakeFiles/flashlight.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cat/flashlight/build/tests/googletest/src/gtest
[  1%] Performing build step for 'gtest'
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
[ 50%] Built target gtest
[100%] Built target gtest_main
[  1%] No install step for 'gtest'
[  1%] Completed 'gtest'
[  1%] Built target gtest
make: *** [Makefile:141: all] Error 2

Make test fails on CPU backend

Hi
I was encountering a number of errrors in 'make test' after compilation on CPU backend.
As suggested in other threads, I ran the individual tests one by one, and noted the errors thrown by each. I also ran arrayfire tests, where only one failed out of 123. I've mentioned that output in the end too.

FLASHLIGHT

50% tests passed, 5 tests failed out of 10

Total Test time (real) =  38.68 sec

The following tests FAILED:
	  1 - AutogradTest (Failed)
	  3 - ModuleTest (Failed)
	  4 - SerializationTest (Failed)
	  8 - AllReduceTest (OTHER_FAULT)
	  9 - ContribModuleTest (Failed)
Errors while running CTest

When I ran the tests one by one, the following outputs were recorded:
AutogradTest

[  PASSED  ] 51 tests.
[  FAILED  ] 4 tests, listed below:
[  FAILED  ] AutogradTest.WeightNormConv
[  FAILED  ] AutogradTest.Rnn
[  FAILED  ] AutogradTest.Lstm
[  FAILED  ] AutogradTest.Gru

ModuleTest

[  PASSED  ] 13 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ModuleTest.RNNFwd

SerializationTest

[  PASSED  ] 13 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SerializationTest.LeNet

AllReduceTest

terminate called after throwing an instance of 'std::runtime_error'
  what():  Asynchronous allReduce not yet supported for Gloo backend

ContribModuleTest

[  PASSED  ] 2 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ModuleTest.ResidualFwd

The types of messages thrown with the errors were:

  1. AutogradTest, ModuleTest and SerializationTest :
unknown file: Failure
C++ exception with description "rnn not yet implemented on CPU" thrown in the test body.
  1. AllReduceTest:
unknown file: Failure
C++ exception with description "Asynchronous allReduce not yet supported for Gloo backend" thrown in the test body.
  1. ContribModuleTest:
unknown file: Failure
C++ exception with description "BatchNorm CPU backend doesn't support momentum." thrown in the test body.

ARRAYFIRE

The following tests FAILED:
	  1 - spdlog-utests (Not Run)
	 79 - test_pinverse_cpu (Failed)

The first one was not present in the directory. I ran the second one separately to get the following output:

[  FAILED  ] 1 test, listed below:
[  FAILED  ] Pinverse/3.Large, where TypeParam = af::af_cdouble

Clearly, most of the errrors are occurring because a number of models are not supported on CPU backend. Does it imply that I can continue with my wav2letter installation and expect correct results?

[I'm installing flashlight as a dependency to wav2letter]

Setting MPI_C and MPI_CXX

Hi,

I am getting an error when building flashlight:

cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CUDA
-- ArrayFire found (include: /home/vraunak/cnns/arrayfire/include, library: ArrayFire::afcuda)
-- CUDA found (library: /usr/lib/x86_64-linux-gnu/libcudart_static.a;-pthread;dl;/usr/lib/x86_64-linux-gnu/librt.so include: /usr/include)
-- Found CUDNN: (lib: /usr/lib/x86_64-linux-gnu/libcudnn.so include: /usr/include)
-- CUDNN found (library: /usr/lib/x86_64-linux-gnu/libcudnn.so include: /usr/include)
-- Gloo found
-- Determining NCCL version from the header file: /usr/include/nccl.h
-- NCCL_MAJOR_VERSION: 2
-- Found NCCL (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnccl.so)
-- NCCL found
-- MPI not found
CMake Error at flashlight/distributed/CMakeLists.txt:67 (message):
MPI_C and MPI_CXX not found; required to build flashlight distributed
Call Stack (most recent call first):
CMakeLists.txt:240 (include)

-- Configuring incomplete, errors occurred!

I tried setting up MPI_C & MPI_CXX to the correct paths in the openmpi bin folder, still the error persists.

Passing the paths to cmake still gives the same error.

-DMPI_CXX_COMPILER=/home/vraunak/openmpi/bin/mpicc -DMPI_C_COMPILER=/home/vraunak/openmpi/bin/mpicxx

How to resolve the error?

squeeze and unsqueeze?

Is there an equivalent of torch.squeeze and torch.unsqueeze?

If not, we'll give it a shot implementing. It would be great if you could guide us where to get started. Thanks

CUDNN not find

I have installed cudnn and export in .badhrc.
also try use cmake .. -DCUDNN_DIR. but build fail

SGDOptimizer momentum

Hi,
I found logic differences between arrayfire-ml and arrayfire momentum
In arrayfire-ml the update code is

af::array &velocity = m_velocities[i];

// Regular momentum
velocity = m_mu * velocity - m_lr * grad;
 if (m_use_nesterov) {
 // Update for nesterov momentum
 data = data + velocity * m_mu  - m_lr * grad;
 } else {
data = data + velocity;
 }

but arrayfire change to

 af::array& velocity = velocities_[i];

 // Regular momentum
 velocity = mu_ * velocity + grad;
 af::eval(velocity);
 if (useNesterov_) {
 // Update for nesterov momentum
 grad += velocity * mu_;
 } else {
 grad = velocity;
 }
 }
 data = data - lr_ * grad;

without Nesterov, the update of data in arrayfire-ml is :
data + mu * velocity - lr * grad
but arrayfire is
data - lr * mu * velocity - lr * grad

I think arrayfire-ml is correct, is herer any other consideration?
Thanks!

Portability to OSX

flashlight requires the Gloo framework to build, but Gloo has explicitly stated that they do not support OSX because of the lack of epoll.

Do you plan to add support for OSX builds?

Thank you!

Combining CPU and GPU

Guys, From CMakeLists.txt it looks like you compile Flashlight for a specific backend (CUDA or CPU, OPENCL), and there is reference to unified backend not being supported.

What does this mean in case, for instance, you wanted to set up something where some parts of the computation were done on GPU and some on CPU?

I sometimes have things I want to do where you need to do smallish computation that's very hard to implement on GPU (for instance, SVD), and it's the most efficient to just transfer it to CPU and do it there. Is this kind of thing supported as-is? I'd also like to understand to what extent Flashlight relies on ArrayFire for backend stuff (af::array operations), and what kinds of things it does itself.

MPI not found

-- MPI not found
CMake Error at flashlight/distributed/CMakeLists.txt:65 (message):
MPI_C and MPI_CXX not found; required to build flashlight distributed
Call Stack (most recent call first):
CMakeLists.txt:229 (include)

-- Configuring incomplete, errors occurred!
See also "/home/epbot/speechtotext/flashlight/build/CMakeFiles/CMakeOutput.log".
See also "/home/epbot/speechtotext/flashlight/build/CMakeFiles/CMakeError.log".

though my system has mpi ,

mpiexec --version
mpiexec (OpenRTE) 1.10.2

Report bugs to http://www.open-mpi.org/community/help/
#46~16.04.1-Ubuntu SMP
google cloud instance

Missing docs

Please see here, where the sections on Serialization, Utils and DistributedUtils are missing.

EDIT: It appears the docs have been moved here.

Linking error on running the tutorial example

g++ -std=c++11 -I ./arrayfire/include/ -I ./flashlight/ hello-fl.cpp -o hello-fl
/tmp/ccDZJtHk.o: In function `cereal::detail::Version<fl::Conv2D, cereal::detail::(anonymous namespace)::version_binding_tag>::registerVersion()':
hello-fl.cpp:(.text+0x13b): undefined reference to `typeinfo for fl::Conv2D'
/tmp/ccDZJtHk.o: In function `main':
hello-fl.cpp:(.text+0x1c6): undefined reference to `af::array af::constant<int>(int, long long, af_dtype)'
hello-fl.cpp:(.text+0x1de): undefined reference to `fl::Variable::Variable(af::array, bool)'
hello-fl.cpp:(.text+0x1ea): undefined reference to `af::array::~array()'
hello-fl.cpp:(.text+0x20e): undefined reference to `fl::operator+(fl::Variable const&, double const&)'
hello-fl.cpp:(.text+0x236): undefined reference to `fl::Variable::array() const'
hello-fl.cpp:(.text+0x243): undefined reference to `af::print(char const*, af::array const&)'
hello-fl.cpp:(.text+0x282): undefined reference to `af::array::~array()'
/tmp/ccDZJtHk.o: In function `fl::Module::~Module()':
hello-fl.cpp:(.text._ZN2fl6ModuleD2Ev[_ZN2fl6ModuleD5Ev]+0xd): undefined reference to `vtable for fl::Module'
/tmp/ccDZJtHk.o: In function `fl::CategoricalCrossEntropy::CategoricalCrossEntropy(fl::ReduceMode)':
hello-fl.cpp:(.text._ZN2fl23CategoricalCrossEntropyC2ENS_10ReduceModeE[_ZN2fl23CategoricalCrossEntropyC5ENS_10ReduceModeE]+0x17): undefined reference to `fl::BinaryModule::BinaryModule()'
hello-fl.cpp:(.text._ZN2fl23CategoricalCrossEntropyC2ENS_10ReduceModeE[_ZN2fl23CategoricalCrossEntropyC5ENS_10ReduceModeE]+0x1c): undefined reference to `vtable for fl::CategoricalCrossEntropy'
/tmp/ccDZJtHk.o: In function `void std::_Destroy<af::array>(af::array*)':
hello-fl.cpp:(.text._ZSt8_DestroyIN2af5arrayEEvPT_[_ZSt8_DestroyIN2af5arrayEEvPT_]+0x14): undefined reference to `af::array::~array()'
/tmp/ccDZJtHk.o: In function `cereal::detail::PolymorphicVirtualCaster<fl::Module, fl::Transform>::PolymorphicVirtualCaster()':
hello-fl.cpp:(.text._ZN6cereal6detail24PolymorphicVirtualCasterIN2fl6ModuleENS2_9TransformEEC2Ev[_ZN6cereal6detail24PolymorphicVirtualCasterIN2fl6ModuleENS2_9TransformEEC5Ev]+0x4a): undefined reference to `typeinfo for fl::Module'
hello-fl.cpp:(.text._ZN6cereal6detail24PolymorphicVirtualCasterIN2fl6ModuleENS2_9TransformEEC2Ev[_ZN6cereal6detail24PolymorphicVirtualCasterIN2fl6ModuleENS2_9TransformEEC5Ev]+0x5e): undefined reference to `typeinfo for fl::Transform'
/tmp/ccDZJtHk.o: In function `cereal::detail::PolymorphicVirtualCaster<fl::Module, fl::WeightNorm>::PolymorphicVirtualCaster()':
hello-fl.cpp:(.text._ZN6cereal6detail24PolymorphicVirtualCasterIN2fl6ModuleENS2_10WeightNormEEC2Ev[_ZN6cereal6detail24PolymorphicVirtualCasterIN2fl6ModuleENS2_10WeightNormEEC5Ev]+0x4a): undefined reference to `typeinfo for fl::Module'
hello-fl.cpp:(.text._ZN6cereal6detail24PolymorphicVirtualCasterIN2fl6ModuleENS2_10WeightNormEEC2Ev[_ZN6cereal6detail24PolymorphicVirtualCasterIN2fl6ModuleENS2_10WeightNormEEC5Ev]+0x5e): undefined reference to `typeinfo for fl::WeightNorm'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::Sigmoid>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl7SigmoidEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl7SigmoidEEC5Ev]+0x36): undefined reference to `typeinfo for fl::Sigmoid'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::Tanh>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl4TanhEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl4TanhEEC5Ev]+0x36): undefined reference to `typeinfo for fl::Tanh'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::ReLU>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl4ReLUEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl4ReLUEEC5Ev]+0x36): undefined reference to `typeinfo for fl::ReLU'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::LeakyReLU>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl9LeakyReLUEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl9LeakyReLUEEC5Ev]+0x36): undefined reference to `typeinfo for fl::LeakyReLU'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::PReLU>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl5PReLUEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl5PReLUEEC5Ev]+0x36): undefined reference to `typeinfo for fl::PReLU'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::ELU>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl3ELUEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl3ELUEEC5Ev]+0x36): undefined reference to `typeinfo for fl::ELU'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::ThresholdReLU>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl13ThresholdReLUEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl13ThresholdReLUEEC5Ev]+0x36): undefined reference to `typeinfo for fl::ThresholdReLU'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::GatedLinearUnit>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl15GatedLinearUnitEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl15GatedLinearUnitEEC5Ev]+0x36): undefined reference to `typeinfo for fl::GatedLinearUnit'
/tmp/ccDZJtHk.o: In function `cereal::detail::OutputBindingCreator<cereal::BinaryOutputArchive, fl::Log>::OutputBindingCreator()':
hello-fl.cpp:(.text._ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl3LogEEC2Ev[_ZN6cereal6detail20OutputBindingCreatorINS_19BinaryOutputArchiveEN2fl3LogEEC5Ev]+0x36): undefined reference to `typeinfo for fl::Log'

trimmed logs

Caching cuDNN kernel choices

Pytorch as a functionality to cache the chosen cuDNN kernels when the input dimensions are identical to previous calls:

torch.backend.cudnn.benchmark = True

This improves throughput of a network by 30~40% (again, when the input dimensions of the network do not change).

Here is where the caching is implemented in Aten:
https://github.com/pytorch/pytorch/blob/358fb51e773b8ad509ec270caee5ec1c51d82f38/aten/src/ATen/native/cudnn/Conv.cpp#L340

Do you have any plans to add similar functionality? It would greatly improve throughput of our DNN engines built with Flashlight.

Thanks

Linking Error on Linux CPU Machine

Hi,

I was trying to install flashlight in cpu mode on a linux machine. I am getting a linking error:

$ make
[ 0%] Performing update step for 'cereal'
[ 0%] Performing configure step for 'cereal'
loading initial cache file /data/ASR5/vraunak/2019/speech/flashlight/build/cereal/tmp/cereal-cache-Release.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /data/ASR5/vraunak/2019/speech/flashlight/build/cereal/src/cereal
[ 1%] Performing build step for 'cereal'
[ 1%] No install step for 'cereal'
[ 1%] Completed 'cereal'
[ 1%] Built target cereal
[ 7%] Built target flashlight
[ 7%] Performing update step for 'gtest'
[ 7%] Performing configure step for 'gtest'
loading initial cache file /data/ASR5/vraunak/2019/speech/flashlight/build/tests/googletest/tmp/gtest-cache-Release.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /data/ASR5/vraunak/2019/speech/flashlight/build/tests/googletest/src/gtest
[ 8%] Performing build step for 'gtest'
[ 50%] Built target gtest
[100%] Built target gtest_main
[ 8%] No install step for 'gtest'
[ 8%] Completed 'gtest'
[ 8%] Built target gtest
[ 8%] Linking CXX executable ModuleTest
CMakeFiles/ModuleTest.dir/__/flashlight/distributed/backend/cpu/DistributedBackend.cpp.o: In function fl::distributedInit(fl::DistributedInit, int, int, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)': DistributedBackend.cpp:(.text+0x2d7): undefined reference to gloo::mpi::Context::createManaged()'
DistributedBackend.cpp:(.text+0x346): undefined reference to `gloo::mpi::Context::connectFullMesh(std::shared_ptrgloo::transport::Device&)'
collect2: error: ld returned 1 exit status
tests/CMakeFiles/ModuleTest.dir/build.make:1460: recipe for target 'tests/ModuleTest' failed
make[2]: *** [tests/ModuleTest] Error 1
CMakeFiles/Makefile2:1071: recipe for target 'tests/CMakeFiles/ModuleTest.dir/all' failed
make[1]: *** [tests/CMakeFiles/ModuleTest.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Even though gloo is installed correctly. How to resolve the error?

Thanks!

Naive question

Hi,

Thanks a lot for open sourcing this library :)
How is it different from Pytorch C++ API?

Thanks for your time

Decoder changes after April 30th

I have just pull the latest changes since April 30th
I am getting much worse WER and slower decoding after which
Is it possible that there has a bug introduced?

The module BinaryCrossEntropy and the function binaryCrossEntropy behave differently

Hello,

The function binaryCrossEntropy performs no reduction whereas the module BinaryCrossEntropy performs a mean reduction. It would be good to have a flag with the default of mean reduction. I am on commit 6ec9dc7e9f57400801794b2e2f02317031883268.

Please see the example below.

Thanks,
Krishna

#include <iostream>
#include <arrayfire.h>
#include "flashlight/flashlight.h"


int main(){
    auto x = fl::Variable(af::randu(100), false);
    auto y = fl::Variable(af::randu(100), false);

    auto loss_1 = fl::binaryCrossEntropy(x, y).array();
    std::cout << loss_1.dims(0) << std::endl; 
    // => 100

    auto loss_fn = fl::BinaryCrossEntropy();
    auto loss_2 = loss_fn(x, y).array();
    std::cout << loss_2.dims(0) << std::endl;
    // => 1
}

Why only MKL

I am told (by a collaborator who is trying to install this on our grid) that this toolkit requires Intel MKL to work on CPU (while ArrayFire doesn't). Is this true and if so, why did you make this a requirement?

Build fails on Ubuntu [Cereal Error]

I am trying to setup flashlight on an Ubuntu machine. Have installed all the dependencies:

When I invoke : cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CUDA

I get the output as :

-- ArrayFire found (include: /home/arrayfire/include, library: ArrayFire::afcuda)
-- cereal found (include: /usr/bin)
-- cereal found
-- CUDA found (library: /usr/local/cuda/lib64/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so include: /usr/local/cuda/include)
-- Found CUDNN: (lib: /usr/lib/x86_64-linux-gnu/libcudnn.so include: /usr/include)
-- CUDNN found (library: /usr/lib/x86_64-linux-gnu/libcudnn.so include: /usr/include)
-- Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - iomp5 - pthread - m]
--   Library mkl_gf_lp64: /root/anaconda2/lib/libmkl_gf_lp64.so
--   Library mkl_gnu_thread: /root/anaconda2/lib/libmkl_gnu_thread.so
--   Library mkl_core: /root/anaconda2/lib/libmkl_core.so
--   Library iomp5: /root/anaconda2/lib/libiomp5.so
--   Library pthread: /usr/lib/x86_64-linux-gnu/libpthread.so
--   Library m: /usr/lib/x86_64-linux-gnu/libm.so
-- MKL found
-- A library with BLAS API found.
-- MKLDNN headers not found; please set CMAKE_INCLUDE_PATH or MKLDNN_ROOT
-- MKLDNN library not found; please set CMAKE_LIBRARY_PATH or MKLDNN_LIBRARY
-- MKLDNN not found
-- Could NOT find OpenCL (missing:  OpenCL_LIBRARY) (found version "1.2")
-- OpenCL not found
-- Gloo not found
-- Determining NCCL version from the header file: /usr/include/nccl.h
-- NCCL_MAJOR_VERSION: 2
-- Found NCCL (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnccl.so)
-- NCCL found
-- MPI_CXX found
-- MPI_CXX compile flags: 
-- MPI_CXX include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/usr/lib/openmpi/include/openmpi
-- MPI_CXX LINK flags path:  -Wl,-rpath  -Wl,/usr/lib/openmpi/lib  -Wl,--enable-new-dtags
-- MPI_CXX libraries: /usr/lib/openmpi/lib/libmpi_cxx.so/usr/lib/openmpi/lib/libmpi.so
-- MPI_C found
-- MPI_C compile flags: 
-- MPI_C include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/usr/lib/openmpi/include/openmpi
-- MPI_C LINK flags path:  -Wl,-rpath  -Wl,/usr/lib/openmpi/lib  -Wl,--enable-new-dtags
-- MPI_C libraries: /usr/lib/openmpi/lib/libmpi.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/flashlight/build

Followed by which when I invoke make -j 30 , I get the error as :

[  0%] Performing update step for 'gtest'
[  0%] Performing configure step for 'gtest'
loading initial cache file /home/flashlight/build/tests/googletest/tmp/gtest-cache-Release.cmake
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/Functions.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/BatchNorm.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/CudnnUtils.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/Utils.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/Conv2D.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/Variable.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/RNN.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/DistributedUtils.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/Pool2D.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/LayerNorm.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/distributed/DistributedApi.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/distributed/backend/cuda/DistributedBackend.cpp.o
[  0%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/AdaptiveSoftMaxLoss.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Pool2D.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Activations.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/BatchNorm.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Embedding.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Padding.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Conv2D.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/RNN.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Reorder.cpp.o
[  2%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Container.cpp.o
[  1%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Dropout.cpp.o
[  2%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Loss.cpp.o
[  2%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Transform.cpp.o
[  2%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Module.cpp.o
[  2%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/Init.cpp.o
[  2%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/View.cpp.o
[  2%] Building CXX object CMakeFiles/flashlight.dir/flashlight/nn/modules/Linear.cpp.o
-- Configuring done
-- Generating done
-- Build files have been written to: /home/flashlight/build/tests/googletest/src/gtest
In file included from /home/flashlight/flashlight/nn/modules/Padding.cpp:8:0:
/home/flashlight/flashlight/nn/modules/Padding.h:10:36: fatal error: cereal/types/utility.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:1094: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Padding.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Padding.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/flashlight/flashlight/nn/modules/Loss.h:19:0,
                 from /home/flashlight/flashlight/nn/modules/AdaptiveSoftMaxLoss.h:10,
                 from /home/flashlight/flashlight/nn/modules/AdaptiveSoftMaxLoss.cpp:10:
/home/flashlight/flashlight/nn/modules/Container.h:22:34: fatal error: cereal/types/tuple.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:854: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/AdaptiveSoftMaxLoss.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/AdaptiveSoftMaxLoss.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/LayerNorm.h:10,
                 from /home/flashlight/flashlight/nn/modules/LayerNorm.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/nn/modules/Container.cpp:16:0:
/home/flashlight/flashlight/nn/modules/Container.h:22:34: fatal error: cereal/types/tuple.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:998: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/LayerNorm.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/LayerNorm.cpp.o] Error 1
[  3%] Performing build step for 'gtest'
CMakeFiles/flashlight.dir/build.make:902: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Container.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Container.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/autograd/backend/cuda/Pool2D.cpp:10:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:206: recipe for target 'CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/Pool2D.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/Pool2D.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/RNN.h:11,
                 from /home/flashlight/flashlight/nn/modules/RNN.cpp:10:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Transform.h:10,
                 from /home/flashlight/flashlight/nn/modules/Transform.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Activations.h:18,
                 from /home/flashlight/flashlight/nn/modules/Activations.cpp:16:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:1166: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/RNN.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/RNN.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:1190: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Transform.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Transform.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:830: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Activations.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Activations.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/autograd/Utils.h:10,
                 from /home/flashlight/flashlight/autograd/Utils.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/nn/modules/Loss.h:19:0,
                 from /home/flashlight/flashlight/nn/modules/Loss.cpp:18:
/home/flashlight/flashlight/nn/modules/Container.h:22:34: fatal error: cereal/types/tuple.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:1046: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Loss.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Loss.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:110: recipe for target 'CMakeFiles/flashlight.dir/flashlight/autograd/Utils.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/autograd/Utils.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/autograd/backend/cuda/CudnnUtils.h:13,
                 from /home/flashlight/flashlight/autograd/backend/cuda/CudnnUtils.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/distributed/DistributedApi.h:13,
                 from /home/flashlight/flashlight/distributed/DistributedApi.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:182: recipe for target 'CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/CudnnUtils.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/CudnnUtils.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:542: recipe for target 'CMakeFiles/flashlight.dir/flashlight/distributed/DistributedApi.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/distributed/DistributedApi.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Pool2D.h:11,
                 from /home/flashlight/flashlight/nn/modules/Pool2D.cpp:10:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Reorder.h:10,
                 from /home/flashlight/flashlight/nn/modules/Reorder.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/BatchNorm.h:10,
                 from /home/flashlight/flashlight/nn/modules/BatchNorm.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:1142: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Reorder.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Reorder.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:878: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/BatchNorm.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/BatchNorm.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/Init.h:27,
                 from /home/flashlight/flashlight/nn/Init.cpp:21:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
make[3]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
CMakeFiles/flashlight.dir/build.make:1118: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Pool2D.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Pool2D.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:782: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/Init.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/Init.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Linear.h:18,
                 from /home/flashlight/flashlight/nn/modules/Linear.cpp:18:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Conv2D.h:11,
                 from /home/flashlight/flashlight/nn/modules/Conv2D.cpp:10:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:926: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Conv2D.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Conv2D.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/autograd/backend/cuda/RNN.cpp:12:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/autograd/backend/cuda/Conv2D.cpp:13:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:230: recipe for target 'CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/RNN.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/RNN.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/autograd/Variable.cpp:16:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:1022: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Linear.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Linear.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:158: recipe for target 'CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/Conv2D.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/Conv2D.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:62: recipe for target 'CMakeFiles/flashlight.dir/flashlight/autograd/Variable.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/autograd/Variable.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/DistributedUtils.h:12,
                 from /home/flashlight/flashlight/nn/modules/DistributedUtils.cpp:10:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/autograd/Functions.cpp:23:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:758: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/DistributedUtils.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/DistributedUtils.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Module.cpp:18:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:1070: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Module.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Module.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:86: recipe for target 'CMakeFiles/flashlight.dir/flashlight/autograd/Functions.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/autograd/Functions.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Dropout.h:18,
                 from /home/flashlight/flashlight/nn/modules/Dropout.cpp:16:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/View.h:10,
                 from /home/flashlight/flashlight/nn/modules/View.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:950: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Dropout.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Dropout.cpp.o] Error 1
CMakeFiles/flashlight.dir/build.make:1214: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/View.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/View.cpp.o] Error 1
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/nn/modules/Module.h:18,
                 from /home/flashlight/flashlight/nn/modules/Embedding.h:10,
                 from /home/flashlight/flashlight/nn/modules/Embedding.cpp:8:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:974: recipe for target 'CMakeFiles/flashlight.dir/flashlight/nn/modules/Embedding.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/nn/modules/Embedding.cpp.o] Error 1
[ 50%] Built target gtest
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/autograd/backend/cuda/BatchNorm.cpp:14:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:134: recipe for target 'CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/BatchNorm.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/autograd/backend/cuda/BatchNorm.cpp.o] Error 1
[100%] Built target gtest_main
[  3%] No install step for 'gtest'
In file included from /home/flashlight/flashlight/autograd/Variable.h:24:0,
                 from /home/flashlight/flashlight/distributed/DistributedApi.h:13,
                 from /home/flashlight/flashlight/distributed/backend/cuda/DistributedBackend.cpp:17:
/home/flashlight/flashlight/common/Serialization.h:18:29: fatal error: cereal/access.hpp: No such file or directory
compilation terminated.
CMakeFiles/flashlight.dir/build.make:590: recipe for target 'CMakeFiles/flashlight.dir/flashlight/distributed/backend/cuda/DistributedBackend.cpp.o' failed
make[2]: *** [CMakeFiles/flashlight.dir/flashlight/distributed/backend/cuda/DistributedBackend.cpp.o] Error 1
CMakeFiles/Makefile2:931: recipe for target 'CMakeFiles/flashlight.dir/all' failed
make[1]: *** [CMakeFiles/flashlight.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  3%] Completed 'gtest'
[  3%] Built target gtest
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Possibly its due to the Cereal library, I cloned the Github repo of Cereal, and as its mentioned it doesn't require any installation , I tried adding the path to environment variables as well as tried copying the cereal dir to /home/flashlight/flashlight/common/ directory, however still then the build process is unable to pickup cereal .

Am I missing something important here? Please let me know. Thanks

Cannot build Gloo backend without Gloo

Dear author, I always report an error when installing flashlight. I have already installed gloo. How can I solve this problem? Thank you

-- Gloo not found
CMake Error at flashlight/distributed/CMakeLists.txt:32 (message):
Cannot build Gloo backend without Gloo
Call Stack (most recent call first):
CMakeLists.txt:230 (include)

Distributed inference

  1. Is there a way to enable distributed inference, instead of training? I see that when you use eval() method on fl::sequence, it turns gradient off. So is running "training with gradient off" computationally equivalent to inference? If this is the case, then I guess there is no need to separately implement distributed inference, but if it is not, then I would love to know where to get started for my own implementation.

  2. is it possible to distribute the work ( both training and inference ) across multiple servers each with multiple GPUs, or does it only work for a single server with multiple GPU? If any of these features are missing, will they be coming out soon?

  3. Lastly, if distributed inference is not supported, what would be the recommended environment / library to enable distributed inference on multiple servers each with multiple GPUs?

make test Failed

Test project /home/ls/flashlight/build
Start 1: AutogradTest
1/7 Test #1: AutogradTest ..................... Passed 22.34 sec
Start 2: OptimTest
2/7 Test #2: OptimTest ........................ Passed 0.94 sec
Start 3: ModuleTest
3/7 Test #3: ModuleTest ....................... Passed 2.80 sec
Start 4: SerializationTest
4/7 Test #4: SerializationTest ................ Passed 5.70 sec
Start 5: DatasetTest
5/7 Test #5: DatasetTest ......................***Failed 1.30 sec
Start 6: MeterTest
6/7 Test #6: MeterTest ........................ Passed 0.86 sec
Start 7: AllReduceTest
7/7 Test #7: AllReduceTest ....................***Exception: Other 0.94 sec

71% tests passed, 2 tests failed out of 7

Total Test time (real) = 34.88 sec

The following tests FAILED:
5 - DatasetTest (Failed)
7 - AllReduceTest (OTHER_FAULT)
Errors while running CTest
Makefile:127: recipe for target 'test' failed
make: *** [test] Error 8

When I use "make test" command,the DatasetTest was failed.What modifications should I do to make the test process work?

data layout

Arrayfire's data layout is WHCN, so I was assuming flashlight would have the same layout but I found some code like this in CudnnUtils.cpp

  // reverse the arrays and cast to int type
  std::array<int, 4> strides = {(int)afstrides[3],
                                (int)afstrides[2],
                                (int)afstrides[1],
                                (int)afstrides[0]};
  1. What is the data layout of flashlight?
  2. why do you reverse the layout at the last moment before calling cuDNN?
  3. does that mean you also flip padding, stride, and dilation?

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.