Dkeras
Distributed Keras Engine, Make Keras faster with only one line of code.
Install / Use
/learn @dkeras-project/DkerasQuality Score
Category
Education & ResearchSupported Platforms
Tags
README
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:
<p align="center"> <img src="https://github.com/gndctrl2mjrtm/dkeras/blob/master/assets/inference_comparison.png?raw=true" alt="dKeras graph"/> </p>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
Installation
The first official release of dKeras will be available soon. For now, install from source.
pip install git+https://github.com/dkeras-project/dkeras
Requirements
- 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
Example
Original
model = ResNet50()
model.predict(data)
dKeras Version
from dkeras import dKeras
model = dKeras(ResNet50)
model.predict(data)
Full Example
from tensorflow.keras.applications import ResNet50
from dkeras import dKeras
import numpy as np
import ray
ray.init()
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
ray.init()
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))
model1.predict(test_data)
model2.predict(test_data)
model1.close()
model2.close()
Related Skills
claude-opus-4-5-migration
82.1kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
334.1kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
mcp-for-beginners
15.6kThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
TrendRadar
49.7k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
