OLED-MoE separates model-independent expert execution from model integration and diffusion decoding.
terminal chat / HTTP server / benchmark CLI
|
Engine
|--------------------> dInfer backend
| decoding, KV cache, model shell
v
MoE runtime
|----> placement cache and static placement policy
|----> scheduler miss execution plan
|----> memory pinned host banks and GPU slots
`----> observability counters and timing
| Package | Responsibility |
|---|---|
core |
Backend-neutral identifiers, contexts, and plan types |
memory |
Pinned expert storage, checkpoint streaming, and GPU cache slots |
scheduler |
Converts cache hits and misses into an execution plan |
placement |
Static placement, cache priority, and layer-capacity control |
runtime |
Executes routed experts and combines weighted outputs |
models/llada2 |
LLaDA2 routing and MoE-module adaptation |
backends/dinfer |
The only dInfer import boundary |
engine |
Lifecycle and public inference facade |
server |
Serialized local chat service and HTTP application |
observability |
Per-layer and aggregate runtime metrics |
cli |
Chat, server, benchmark, and microbenchmark entry points |
core,scheduler,memory,placement, andruntimedo not import dInfer.- dInfer imports are confined to
backends/dinfer. - Model-specific routing and checkpoint conventions live under
modelsand model-named checkpoint loaders. - Runtime state belongs to an engine instance; process-global policy singletons are not used.
- CPU execution and transfer execution use separate resources so their thread pools and CUDA streams can be controlled independently.
At model construction, each supported dInfer MoE site is replaced with an OLED adapter. Dense weights remain in the model shell; expert projections are loaded into per-layer pinned host banks. OLED therefore does not create a second fully GPU-resident copy of the experts.
For each MoE invocation, the runtime:
- receives routed expert IDs and normalized top-k weights;
- classifies active experts as resident or missing;
- starts asynchronous copies for GPU-bound misses;
- computes resident routes while those copies are in flight;
- executes transferred and optional CPU-routed experts; and
- combines the partial outputs in a deterministic order.
The terminal and HTTP interfaces share LocalChatService. It owns one engine,
serializes requests, formats the full conversation with the model tokenizer, and
emits text after each completed diffusion block. The HTTP process intentionally
uses one worker because the engine and its expert cache are stateful.
The included server is intended for local development. It has no authentication, rate limiting, TLS termination, or multi-tenant scheduling. Bind to loopback and use a trusted tunnel or place it behind an appropriate production gateway.