NERV Toolkit

NOTE: This readme is in-progress.


First, make sure you have at least one implementation of BLAS and CUDA installed on your computer.

  • Clone NERV:

    git clone https://speechlab.sjtu.edu.cn/gitlab/nerv-dev/nerv.git
  • Checkout the latest tagged version (please change the tag name to the latest):

    git checkout beta-1.21
  • Download submodules (luajit, LuaRocks, Penlight, etc.):

    cd nerv
    git submodule init && git submodule update
  • Build NERV: you can specify either mkl or atlas to BLAS_TYPE. BLAS_BASE is the directory containing BLAS .so files. By default, atlas is used for BLAS_TYPE, /usr/lib/ is used for BLAS_BASE, and /usr/local/cuda is used for CUDA_BASE.

    # an example for compiling on SJTU Speechlab major cluster
    make BLAS_TYPE=mkl BLAS_BASE=/home/intel/mkl/lib/intel64/ CUDA_BASE=/usr/local/cuda
  • To include some new features (e.g. atomicCAS in CUDA), add corresponding flags to NERV_FEAT (e.g. NERV_FEAT=-D__NERV_FUTURE_CUDA_7) while making:

    make NERV_FEAT=-D__NERV_FUTURE_CUDA_7 BLAS_TYPE=mkl BLAS_BASE=/home/intel/mkl/lib/intel64/ CUDA_BASE=/usr/local/cuda
  • For speech tasks, you need to install related lua rocks (Lua packages):

    # clone and checkout speech repository to local directory nerv/speech
    # (suppose you're still at the root directory of NERV repo)
    git clone https://speechlab.sjtu.edu.cn/gitlab/nerv-dev/nerv-speech.git speech
    git checkout beta-1.21 # please change the tag name to the latest
    # build and install HTK I/O support, Kaldi I/O support, Kaldi decoding support, etc.
    make speech BLAS_TYPE=mkl BLAS_BASE=/home/intel/mkl/lib/intel64/ KALDI_BASE=/speechlab/tools/KALDI/kaldi-master/

Example & Tutorial

For speech tasks, please refer to tutorial/ in nerv-speech repository.


The basic rule is simple: just fork the original repository, then create a pull request (merge request) to the administrator of the project. If you want to fix any bugs in existing code, don't hesitate to create a pull (merge) request to the repository with clear and detailed analysis of the problem. If you want to add additional task-specific functionalities (modules) for speech to NERV, please create a LuaRocks-compliant package and also a pull (merge) request to the nerv-speech repository instead of nerv. Please refer to the collaboration rules in NERV's doc.