aboutsummaryrefslogtreecommitdiff
path: root/README.rst
blob: e012510d48a1a85c8b2d47985866b8198eaaf8a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
NERV Toolkit
============

NOTE: This readme is in-progress.

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

- Clone NERV:
  
  ::

    bash
    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.

Contribution
------------
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.