Skip to main content

ferrum_engine/parallel/
mod.rs

1//! Multi-GPU Parallelism Module
2//!
3//! This module provides support for distributing model inference across
4//! multiple GPUs using various parallelism strategies:
5//!
6//! - Tensor Parallelism: Split tensor operations across GPUs
7//! - Pipeline Parallelism: Split model layers across GPUs
8//! - Data Parallelism: Process different batches on different GPUs
9//!
10//! ## Architecture
11//!
12//! ```text
13//! ┌─────────────────────────────────────────────────────────┐
14//! │                    DeviceManager                         │
15//! │  - Device discovery and capability detection             │
16//! │  - Resource allocation and monitoring                    │
17//! └─────────────────────────────────────────────────────────┘
18//!                              │
19//!          ┌───────────────────┼───────────────────┐
20//!          ▼                   ▼                   ▼
21//! ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
22//! │ TensorParallel  │ │ PipelineParallel│ │  DataParallel   │
23//! │   Executor      │ │   Executor      │ │   Executor      │
24//! └─────────────────┘ └─────────────────┘ └─────────────────┘
25//! ```
26
27pub mod config;
28pub mod device;
29pub mod executor;
30pub mod tensor_parallel;
31
32pub use config::{LayerDistribution, LayerRange, ParallelConfig, ParallelismType};
33pub use device::{global_device_manager, DeviceCapability, DeviceInfo, DeviceManager};
34pub use executor::{ParallelExecutor, ParallelExecutorFactory, ParallelStrategySelector};
35pub use tensor_parallel::{
36    LayerParallelType, TensorParallelConfig, TensorParallelGroup, TransformerParallelMapping,
37    WeightShard,
38};