Installation

Platform Compatibility

Currently DynaML installs and runs on *nix platforms.

Pre-requisites

  • sbt
  • A modern HTML5 enabled browser (to view plots generated by Wisp)
  • BLAS, LAPACK and ARPACK binaries for your platform. In case they are not installed, it is possible to disable this feature by commenting out (//) the section of the build.sbt file given below.
  "org.scalanlp" % "breeze-natives_2.11" % "0.11.2" % "compile",

Tip

Using the install script

There are two scripts for building DynaML.

  • install.sh: This builds the binary and adds a symlink to the system path (sudo priviledges needed).
  • sbt-shell.sh: This starts the sbt shell, for build/compile/test workflows.
$ ./install.sh 8096m

sbt-shell.sh and install.sh both take three parameters.

  1. The JVM heap size to use for the packaged executable (defaults to 4096m).
  2. Whether to use GPU accelerated tensorflow (defaults to False).
  3. Whether to use a user compiled/built tensorflow library (True) or a pre-packaged one (False, the default).

Note

TensorFlow Nvidia GPU support

If you want to use Nvidia GPU acceleration when DynaML calls TensorFlow, giving the appropriate flags to install.sh or sbt-shell.sh should work, but in order for your GPU to be actually utilised, you must ensure that:

  • Your Nvidia GPU is compliant, i.e. has a compute capability of atleast 4.1

  • Cuda v9.0 is installed on your system and its installation location is added to LD_LIBRARY_PATH bash variable.

  • cuDNN v7 is installed on your system and is appended to LD_LIBRARY_PATH

Using user compiled TensorFlow

By default, DynaML uses the Tensorflow dynamic library bundled with TensorFlow Scala distribution, but it is possible for the user to build Tensorflow from source for their platform. For example, to use DynaML with Cuda 10.0, we would need to build the tensorflow binary with Cuda 10.x, add it to LD_LIBRARY_PATH and build DynaML with the corresponding flag set to True. In most applications, the bundled TensorFlow is adequate for user requirements.

Steps

  1. Clone the repository.
$ git clone https://github.com/transcendent-ai-labs/DynaML.git
  1. Use the sbt shell launcher sbt-shell.sh:

    # Build with GPU support and use user-built 
    # Tensorflow binary (accessible in LD_LIBRARY_PATH)
    $ ./sbt-shell.sh 8096m True True
    

    The sbt shell will open

    [info] Loading project definition from ~/DynaML/project
    [info] Set current project to DynaML
    sbt:DynaML>
    
  2. Build the source

    sbt:DynaML>stage
    
  3. After the project builds, exit from the sbt console and execute the DynaML start script from the bash shell. Make sure you have execute permissions on the DynaML start script.

    $ ./target/universal/stage/bin/dynaml
    

    You should see the prompt.

    Welcome to DynaML v2.0-SNAPSHOT 
    Interactive Scala shell for Machine Learning Research
    
    Currently running on:
    (Scala 2.12.10 Java 11.0.7)
    
    DynaML>
    

Comments