How deepseek-ai/deepep-ascend works
DeepEP-Ascend is an Ascend NPU communication library exposed through Python buffer APIs backed by a C++ extension. Its principal workflow routes MoE tokens through EP dispatch and combine; separate APIs provide PP send/receive, Bucket collectives and Engram remote-memory access. The graph also shows shared communication/runtime layers. README statements support the product capabilities; some subsystem-to-kernel links rely on the SOURCE INDEX, so unsampled implementation details are not expanded.
Main entry points: ep.hpp EP buffer runtime · python_api.cpp Python bindings · pp.hpp PP send/receive · bucket.hpp Bucket runtime
Components 23
Python API
- Python bindings
csrc/python_api.cpp - Buffer allocator
deep_ep/buffers/allocator.py
Communication Buffers
- EPBuffer API
deep_ep/buffers/ep.py - EP buffer runtime
csrc/buffers/ep.hpp - PPBuffer
deep_ep/buffers/pp.py - PP send/receive
csrc/buffers/pp.hpp - BucketBuffer
deep_ep/buffers/bucket.py - Bucket runtime
csrc/buffers/bucket.hpp - EngramBuffer
csrc/buffers/engram.hpp - Buffer lifecycle
csrc/buffers/base.hpp
Device Kernels
- EP dispatch/combine
csrc/kernels/ep/dispatch.hpp - PP kernel
csrc/kernels/pp/pp_send_recv.hpp - Bucket all-gather
csrc/kernels/bucket/all_gather.hpp - Engram fetch
csrc/kernels/engram/engram.hpp
Runtime and Communication
- Communication context
csrc/kernels/comm/api.hpp - HCCL transport
csrc/kernels/comm/hccl.hpp - Communication barrier
csrc/comm/barrier.hpp - Stream access
csrc/comm/stream.hpp - NPU events
csrc/utils/event.hpp - Runtime JIT
csrc/runtime/jit.hpp
Other components
- ML application
- Ascend device
- HCCL/HCOMM, UBMEM, URMA
Connections 30
- ML application → EPBuffer API: calls
README.md - ML application → PPBuffer: calls
README.md - ML application → BucketBuffer: calls
README.md - ML application → EngramBuffer: calls
README.md - EPBuffer API → EP buffer runtime: invokes
- Python bindings → EP buffer runtime: binds
csrc/python_api.cpp - Python bindings → PP send/receive: binds
csrc/python_api.cpp - Python bindings → Bucket runtime: binds
csrc/python_api.cpp - Python bindings → EngramBuffer: binds
csrc/python_api.cpp - EP buffer runtime → EP dispatch/combine: launches
csrc/buffers/ep.hpp - EP dispatch/combine → Runtime JIT: compiles through
csrc/kernels/ep/dispatch.hpp - PPBuffer → PP send/receive: delegates
- PP send/receive → PP kernel: uses
csrc/buffers/pp.hpp - PP kernel → Runtime JIT: compiles through
csrc/kernels/pp/pp_send_recv.hpp - BucketBuffer → Buffer allocator: uses
deep_ep/buffers/bucket.py - Bucket runtime → Bucket all-gather: uses
csrc/buffers/bucket.hpp - BucketBuffer → Bucket runtime: invokes
- EngramBuffer → Engram fetch: uses
csrc/buffers/engram.hpp - Engram fetch → Runtime JIT: compiles through
csrc/kernels/engram/engram.hpp - EP buffer runtime → Buffer lifecycle: inherits
csrc/buffers/ep.hpp - EP buffer runtime → Communication context: uses
csrc/buffers/ep.hpp - PP send/receive → Buffer lifecycle: inherits
csrc/buffers/pp.hpp - Bucket runtime → Buffer lifecycle: inherits
csrc/buffers/bucket.hpp - EngramBuffer → Buffer lifecycle: inherits
csrc/buffers/engram.hpp - Communication context → HCCL transport: uses
csrc/kernels/comm/api.hpp - Communication barrier → Communication context: launches through
csrc/comm/barrier.hpp - Communication barrier → Stream access: synchronizes
csrc/comm/barrier.hpp - Communication context → Runtime JIT: uses
csrc/kernels/comm/api.hpp - HCCL/HCOMM, UBMEM, URMA → HCCL transport: provides communication
README.md - Ascend device → EP dispatch/combine: executes
README.md