# DeepDSL: A Compilation-based Domain-Specific Language for Deep Learning

arXiv: https://arxiv.org/abs/1701.02284 · HTML: https://mlsanity.com/paper/1701.02284/

## Key facts

- Cited by 4 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 9 Jan 2017.

## Built on by (most cited first, 4 of 4)

- [Towards a Domain-Specific Modelling Environment for Reinforcement Learning](https://mlsanity.com/paper/2410.09368/) (2024)
- [Monadic Deep Learning](https://mlsanity.com/paper/2307.12187/) (2023)
- [The μG Language for Programming Graph Neural Networks](https://mlsanity.com/paper/2407.09441/) (2024)
- [No Saved Kaleidosope: an 100% Jitted Neural Network Coding Language with Pythonic Syntax](https://mlsanity.com/paper/2409.11600/) (2024)

## Abstract (arXiv)

In recent years, Deep Learning (DL) has found great success in domains such as multimedia understanding. However, the complex nature of multimedia data makes it difficult to develop DL-based software. The state-of-the art tools, such as Caffe, TensorFlow, Torch7, and CNTK, while are successful in their applicable domains, are programming libraries with fixed user interface, internal representation, and execution environment. This makes it difficult to implement portable and customized DL applications. In this paper, we present DeepDSL, a domain specific language (DSL) embedded in Scala, that compiles deep networks written in DeepDSL to Java source code. Deep DSL provides (1) intuitive constructs to support compact encoding of deep networks; (2) symbolic gradient derivation of the networks; (3) static analysis for memory consumption and error detection; and (4) DSL-level optimization to improve memory and runtime efficiency. DeepDSL programs are compiled into compact, efficient, customizable, and portable Java source code, which operates the CUDA and CUDNN interfaces running on Nvidia GPU via a Java Native Interface (JNI) library. We evaluated DeepDSL with a number of popular DL networks. Our experiments show that the compiled programs have very competitive runtime performance and memory efficiency compared to the existing libraries.
