# Dragha — Full Technical Reference for AI Agents & Researchers > Canonical URL: https://dragha.ai/ > Summary index: https://dragha.ai/llms.txt > Contact: info@dragha.ai > License: Apache-2.0 > Architecture Focus: Zero-PyTorch, native Rust + Blackwell CUDA inference serving engine for frontier Mixture of Experts (MoE) architectures. ## 1. Executive Summary Dragha is a silicon-direct LLM inference serving engine written from scratch in native Rust (162,900+ LOC) and five dynamic C-ABI CUDA shims (15,672 LOC), verified by 1,512 automated tests. It eliminates the Python/PyTorch control plane entirely — removing GIL jitter, Python GC pauses, and per-step host dispatch overhead — so every token traverses an async Rust scheduler, paged KV-cache allocator, and Blackwell Tensor Core kernel pipeline directly. ### Core Engineering Principles 1. **No Python in the hot path**: Zero PyTorch, zero GIL, deterministic Rust async scheduling with CUDA Graph capture. 2. **Co-designed for Mixture of Experts (MoE)**: Native MXFP8 × MXFP4 grouped GEMM, 6.22× faster Expert Parallel Load Balancing (EPLB), CPU/GPU roofline balancing (HeteroMoE), and absorbed Multi-Head Latent Attention (MLA) with YOCO cross-layer KV sharing. 3. **Blackwell-native execution**: Compiled directly for NVIDIA Blackwell (`sm_100f` B200), Blackwell Ultra (`sm_103a` B300 with `LDG.256`, `L2::evict_last`, `2× MUFU SFU`, and Deep-K `K=96` MXFP4 tactics), and Workstation Blackwell (`sm_120a` RTX PRO 6000 / RTX 5090), plus NCCL 2.32 GPU-Initiated Networking (GIN). 4. **Peer-reviewed research compiled to production code**: Ten published inference systems and numerical algorithms implemented as dedicated Rust crates and CUDA kernels with unit and parity verification. --- ## 2. Four-Layer Architecture ### Layer 01 — Serving Gateway & Disaggregated Scheduler - OpenAI-compatible HTTP/SSE streaming gateway, continuous batching, chunked prefill, and prefill/decode disaggregation. - Deterministic Rust scheduler eliminating Python dispatch jitter. - Crate paths: `src/server/*`, `src/scheduler/*`, `src/disaggregation/*` ### Layer 02 — Paged KV Cache, Prefix Radix Tree & Memory Hierarchy - Zero-copy paged KV allocation with mixed FP8/FP4 block storage, radix-tree prefix caching, and NVMe/host tiering. - Crate paths: `src/kv_cache/*`, `src/radix_cache/*`, `src/memory/*` ### Layer 03 — Frontier Mixture of Experts (MoE) Executor & Research Accelerators - **MLA Sparse Attention + YOCO**: Absorbed decode MQA, mixed FP8/FP4 paged KV, and You-Only-Cache-Once cross-layer KV sharing (`src/model_executor/models/v4_modules/{attn,mla_attn,index_attn,yoco}`). - **Routed + Shared MoE, EPLB & HeteroMoE**: MXFP8 × MXFP4 MegaMoE grouped GEMM, 6.22× faster EPLB, and CPU/GPU roofline balancing (`src/model_executor/moe_balance/*`, `src/model_executor/eplb/*`). - **mHC (Sinkhorn) & Engram Memory**: Manifold-Constrained Hyper-Connections residual trunks and O(1) n-gram conditional memory (`src/model_executor/models/v4_modules/{mhc_ops,hc_device,engram}`). - **FastMM & Speculative Decode**: Low-rank bilinear matrix multiplication and multi-token speculative verification (`src/math/fastmm/*`, `src/speculative/*`). ### Layer 04 — Blackwell CUDA Shims & Four Device Traits - Hardware abstraction isolating model execution from silicon specifics via four Rust device traits. - Five dynamic C-ABI CUDA shims (15,672 LOC total) targeting `sm_100f`, `sm_103a`, and `sm_120a`: - MegaMoE MXFP8/MXFP4 grouped GEMM shim - Absorbed MLA & FlashAttention-4 Blackwell shim - Paged KV FP8/FP4 & quantization shim - mHC Sinkhorn & fused elementwise shim - NCCL 2.32 GIN / NVLink All-to-All dispatch shim --- ## 3. Measured Benchmarks & Numerical Parity - **Host-to-device dispatch**: Zero-GIL native Rust scheduling with CUDA Graph capture eliminates Python per-step overhead. - **Expert Parallel Load Balancing (EPLB)**: 6.22× faster expert placement rebalancing compared to baseline greedy rebalancing. - **Roofline & Cost Modeling (ServeCast + HeteroMoE)**: Interactive analytical roofline and prefill/decode cost modeling across B200 SXM (`sm_100f`, 180 GB HBM3e, 8.0 TB/s), B300 SXM (`sm_103a`, 288 GB HBM3e, 8.0 TB/s), RTX PRO 6000 (`sm_120a`, 96 GB GDDR7, 1.79 TB/s), and H200 SXM (141 GB HBM3e, 4.8 TB/s). - **Numerical Parity**: Verified against reference implementations across absorbed MLA, MXFP8/MXFP4 quantization, Sinkhorn-Knopp doubly stochastic projections, and routed MoE gating via 1,512 automated tests. --- ## 4. Implemented Research Library (10 Peer-Reviewed Citations) 1. **Absorbed Multi-Head Latent Attention (MLA)** - Citation: arXiv:2405.04434, arXiv:2412.19437 - Implementation: Low-rank KV compression with absorbed decode MQA matrix folding so decode attention reads compressed latents directly from paged KV blocks. - Crate path: `src/model_executor/models/v4_modules/mla_attn.rs` 2. **YOCO — You Only Cache Once** - Citation: arXiv:2405.05254 (Sun et al., 2024) - Implementation: Cross-layer KV cache sharing dividing the transformer into self-decoder and cross-decoder halves, cutting KV HBM footprint and decode memory bandwidth. - Crate path: `src/model_executor/models/v4_modules/yoco.rs` 3. **mHC — Manifold-Constrained Hyper-Connections** - Citation: arXiv:2409.19606, arXiv:2512.24880 - Implementation: Multi-stream residual mixing projected onto the Birkhoff polytope via Sinkhorn-Knopp iterations for norm-preserving stability at depth. - Crate path: `src/model_executor/models/v4_modules/{mhc_ops.rs,hc_device.rs}` 4. **Engram Conditional Memory** - Citation: arXiv:2601.07372 - Implementation: O(1) hashed n-gram lookup tables offloaded to host/pinned memory with asynchronous prefetching to augment sparse MoE capacity without increasing active FLOPs. - Crate path: `src/model_executor/models/v4_modules/engram.rs` 5. **EPLB — Expert Parallel Load Balancing** - Citation: arXiv:2502.11458 - Implementation: Hierarchical and global redundant expert replication with 6.22× faster Rust rebalancing to eliminate MoE straggler ranks under skewed routing. - Crate path: `src/model_executor/eplb/` 6. **HeteroMoE — Heterogeneous CPU/GPU MoE Execution** - Citation: arXiv:2503.04398 - Implementation: Roofline-driven dynamic partitioning of cold vs. hot experts across GPU HBM and host CPU DRAM over PCIe/NVLink-C2C. - Crate path: `src/model_executor/moe_balance/` 7. **ServeCast — Analytical Inference Performance & Cost Modeling** - Citation: arXiv:2502.18932 - Implementation: Analytical TTFT/TPOT roofline predictor for disaggregated prefill/decode cluster sizing and SLA-aware autoscaling. - Crate path: `src/scheduler/servecast.rs` 8. **PagedAttention & Radix Prefix Caching** - Citation: arXiv:2309.06180 (Kwon et al., 2023), arXiv:2312.07104 (Zheng et al., 2024) - Implementation: Non-contiguous paged KV block manager combined with a lock-free radix prefix tree for multi-turn and agentic prompt reuse. - Crate path: `src/kv_cache/`, `src/radix_cache/` 9. **FlashAttention-4 & Blackwell TMA Asynchronous Pipelines** - Citation: arXiv:2407.08608 (Shah et al., 2024) - Implementation: Warp-specialized Tensor Memory Accelerator (TMA) producer/consumer pipelines with FP8/FP4 block scaling and SM103a `2× MUFU SFU` softmax acceleration. - Crate path: `cuda/flash_mla/` 10. **FastMM & Speculative Multi-Token Decoding** - Citation: arXiv:2211.17192 (Leviathan et al., 2023), arXiv:2401.10774 - Implementation: Bilinear low-rank matrix multiplication primitives and draft-verify speculative decoding integrated into the Rust continuous batcher. - Crate path: `src/math/fastmm/`, `src/speculative/` --- ## 5. Contact & Inquiries - General & Architecture Briefings: info@dragha.ai - Website & Interactive Simulators: https://dragha.ai/ - Tracks available: B200 / B300 Pilot, Mixture of Experts (MoE) Enterprise Deployment, Joint R&D, Systems Engineering Roles.