DjiNN is a unified Deep Neural Network (DNN) web-service that allows DNN based applications to make requests to DjiNN.


Visit our Downloads page to get the latest version of DjiNN and the Tonic applications.



Djinn uses Caffe* for the DNN forward pass computation. Additionally, Tonic Suite depends on the following packages:

*Building Caffe

If you have built Tonic Suite, which means you should already have Caffe installed, skip this step.

Caffe is under active development and since some of the latest changes may break downstream projects, we provide users with a snapshot version at our Downloads page that is verified to build with Tonic Suite. Caffe can be built using different libraries as detailed here and we recommend reading their installation process to get familiar with the process.

$ tar xzf caffe.tar.gz
$ cd caffe;
$ ./
$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libboost-all-dev libhdf5-serial-dev libopenblas-dev

Copy Makefile.config.example to Makefile.config and set the flags following the intended build environment.

$ make -j 4
$ make distribute

Set the Caffe installation path in common/Makefile.config, for example CAFFE=/home/jahausw/tools/caffe/distribute

Build the tonic library (libtonic.a) and download the pretrained models in common/weights:

$ tar xzf djinn-1.0.tar.gz
$ cd common
$ make
$ cd weights
$ ./

Building the DjiNN server

In service/, build the DjiNN server:

$ make -j 4

Running the DjiNN server

Before running the Tonic applications, start the DjiNN service as follows:

$ ./djinn --common ../common/ --weights weights/ --portno 8080 --gpu 1 --debug 0 --nets nets.txt

The above command will launch the DjiNN service using the GPU to process all the received requests. If “–gpu 0″ is passed to ./dnn-server, DjiNN service will use the CPU to process requests instead. The nets.txt file defines all the networks DjiNN should load at initialization from common/configs and common/weights.

After the DjiNN service is started, open a new terminal, navigate to the Tonic Suite folder to send requests to DjiNN. You need to build the corresponding Tonic application in order to utilize the DjiNN server. To build the Tonic applications, follow these instructions.

The following is an example of how to send an IMC request to DjiNN:

$ cd djinn/tonic-suite/img
$ ./tonic-img --task imc --djinn 1 --input imc-list.txt --hostname localhost --portno 8080

The above command is analogous for all the IMG (imc, dig, face) , ASR and NLP (pos, chk, ner) applications.

Several parameters can be passed to ./tonic-img to configure the applications to run. “–task” configures which type of image request (imc, dig or face) will be launched. “–djinn” configures to use DjiNN service or process the task locally. “–hostname” and “–portno” configure the IP address and port number of DjiNN service.

Citing DjiNN

If you use DjiNN in your research, please cite the official publication [1].

[1] [pdf] Johann Hauswald, Yiping Kang, Michael A. Laurenzano, Quan Chen, Cheng Li, Ronald Dreslinski, Trevor Mudge, Jason Mars, and Lingjia Tang. Djinn and Tonic: DNN as a Service and Its Implications for Future Warehouse Scale Computers. In Proceedings of the 42nd Annual International Symposium on Computer Architecture (ISCA), ISCA ’15, New York, NY, USA, 2015. ACM. Acceptance Rate: 19%
author = {Hauswald, Johann and Kang, Yiping and Laurenzano, Michael A. and Chen, Quan and Li, Cheng and Dreslinski, Ronald and Mudge, Trevor and Mars, Jason and Tang, Lingjia},
title = {Djinn and Tonic: DNN as a Service and Its Implications for Future Warehouse Scale Computers},
booktitle = {Proceedings of the 42nd Annual International Symposium on Computer Architecture (ISCA)},
series = {ISCA '15},
year = {2015},
location = {Istanbul, Turkey},
publisher = {ACM},
address = {New York, NY, USA},
note = {Acceptance Rate: 19%},