Skip to content
Distributed Keras Engine, Make Keras faster with only one line of code.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets updated grph Sep 4, 2019
docs updated grph Sep 4, 2019
testing model.predict bug fixed Oct 3, 2019
LICENSE docs updated and minor bugs fixed Aug 20, 2019
requirements.txt moved main test to and -> Aug 12, 2019

dKeras logo

dKeras: Distributed Keras Engine

Make Keras faster with only one line of code.

dKeras is a distributed Keras engine that is built on top of Ray. By wrapping dKeras around your original Keras model, it allows you to use many distributed deep learning techniques to automatically improve your system's performance.

With an easy-to-use API and a backend framework that can be deployed from the laptop to the data center, dKeras simpilifies what used to be a complex and time-consuming process into only a few adjustments.

Why Use dKeras?

Distributed deep learning can be essential for production systems where you need fast inference but don't want expensive hardware accelerators or when researchers need to train large models made up of distributable parts.

This becomes a challenge for developers because they'll need expertise in not only deep learning but also distributed systems. A production team might also need a machine learning optimization engineer to use neural network optimizers in terms of precision changes, layer fusing, or other techniques.

Distributed inference is a simple way to get better inference FPS. The graph below shows how non-optimized, out-of-box models from default frameworks can be quickly sped up through data parallelism:

dKeras graph

Current Capabilities:

  • Data Parallelism Inference

Future Capabilities:

  • Model Parallelism Inference
  • Distributed Training
  • Easy Multi-model production-ready building
  • Data stream input distributed inference
  • PlaidML Support
  • Autoscaling
  • Automatic optimal hardware configuration
  • PBS/Torque support


The first official release of dKeras will be available soon. For now, install from source.

pip install git+


  • Python 3.6 or higher
  • ray
  • psutil
  • Linux (or OSX, dKeras works on laptops too!)
  • numpy

Coming Soon: PlaidML Support

dKeras will soon work alongside PlaidML, a "portable tensor compiler for enabling deep learning on laptops, embedded devices, or other devices where the available computing hardware is not well supported or the available software stack contains unpalatable license restrictions."

Distributed Inference



model = ResNet50()

dKeras Version

from dkeras import dKeras

model = dKeras(ResNet50)

Full Example

from tensorflow.keras.applications import ResNet50
from dkeras import dKeras
import numpy as np
import ray


data = np.random.uniform(-1, 1, (100, 224, 224, 3))

model = dKeras(ResNet50, init_ray=False, wait_for_workers=True, n_workers=4)
preds = model.predict(data)

Multiple Model Example

import numpy as np
from tensorflow.keras.applications import ResNet50, MobileNet

from dkeras import dKeras
import ray


model1 = dKeras(ResNet50, weights='imagenet', wait_for_workers=True, n_workers=3)
model2 = dKeras(MobileNet, weights='imagenet', wait_for_workers=True, n_workers=3)

test_data = np.random.uniform(-1, 1, (100, 224, 224, 3))


You can’t perform that action at this time.