Repository navigation
HyperParallel is a distributed parallelism library for large models. Use YAML to configure models, data, and parallel strategies, or integrate distributed tensors, model sharding, pipeline scheduling, and device memory management into an existing training workflow.
Capabilities
Model training and data
- Text and multimodal training.
TextTrainerandVLMTrainerbuild training workflows from YAML, load Hugging Face model configurations and pretrained weights, and apply model-specific parallel plans and operator replacements. Data, loss, optimizer, and checkpoint components can be replaced as needed. Model training guide - Online and offline data processing. Supports online tokenization and sample packing, dynamic token batching, offline Indexed Dataset, and blending multiple data sources. Distributed data loading supports batch distribution, prefetching, and resuming from saved progress. Data processing guide
- Training recipes and integrations. Includes online and offline Qwen3-30B-A3B training examples, a DeepSeek-V3.2 training recipe, and guidance for supervised fine-tuning of Qwen3-VL with LlamaFactory. Qwen3 training examples / DeepSeek-V3.2 recipe / Supervised fine-tuning guide
Distributed programming and hybrid parallelism
| Capability | Support |
|---|---|
| Distributed tensors (DTensor) | Uses DeviceMesh and layouts to describe tensor distribution. Supports operator layout inference, redistribution, distributed random number generation, and custom operator sharding and backward computation through custom_shard and DFunction. |
| Data parallelism (FSDP / HSDP) | Shards parameters, gradients, and optimizer state. Supports mixed precision, uneven parameter sharding, forward and backward parameter prefetching, collective fusion, and overlap of gradient communication with computation. |
| Tensor and sequence parallelism (TP / SP) | Provides declarative row-wise and column-wise sharding, sequence parallelism, and loss parallelism. MC2 fuses AllGather + MatMul and MatMul + ReduceScatter. |
| Context parallelism (CP) | Provides Colossal, Ulysses, and hybrid sharding, with asynchronous communication and Colossal load balancing. Includes DSA for DeepSeek-V3.2 and attention adaptations for Qwen3-MoE, Qwen3.5, and Kimi models. |
| Expert parallelism (EP / ETP) | Shards MoE experts and applies tensor parallelism within experts. Provides top-k routing, grouped expert computation, load balancing, and auxiliary loss components. |
| Pipeline parallelism (PP / VPP) | Supports GPipe, 1F1B, interleaved 1F1B, and PP+FSDP. Batched P2P communication, prefetching, and forward/backward overlap help hide expert communication. |
| Multimodal pipelining (MPipe) | Transpose scheduling distributes encoder and other preprocessing work across pipeline stages to reduce the load on the first stage. |
Interface definitions and examples are available in the parallelism guides and API reference.
Memory management and operator optimization
- Activation recomputation and offload. Supports selective recomputation, asynchronous CPU offload, and prefetching during the backward pass. Pipelines can schedule activation transfers by stage and microbatch. HyperOffload can plan tensor-level offload against an activation memory budget. Activation memory guide / HyperOffload
- Parameter and training state management. Supports deferred weight initialization and on-demand materialization, FSDP parameter and gradient offload, and shard-wise prefetch, update, and writeback for Adam/AdamW optimizer state. Sharded training guide / Optimizer state offload interface
- Operators and low-precision components. Provides chunked cross-entropy for large vocabularies, Gated DeltaNet, Kimi Delta Attention, and HiFloat8 and MXFP8 components for linear layers and grouped expert computation. Chunked loss guide / Low-precision components
- On-chip multicore parallelism. MegaMoE coordinates expert dispatch, grouped matrix multiplication, SwiGLU, and output combination across Ascend cores for BF16 MoE training. Multicore parallelism guide
Strategy search and compilation
- Parallel strategy search. SAPP-ND screens multidimensional parallel configurations against a device memory budget and estimates their performance. SAPP-PPB jointly optimizes layer assignment, pipeline stage balance, and recomputation. Strategy search guide
- Training compilation. Trainer can compile supported Transformer layers alongside parallel strategies and activation recomputation. Graph mode provides joint forward and backward graph capture, FSDP graph transformations, and pipeline-only examples with GPipe or 1F1B scheduling. Graph mode guide / Graph mode pipeline examples
Optimizers and checkpoint recovery
- Distributed optimizers. Provides AdamW, Muon, and
ChainedOptimizerfor combining optimizers across parameter groups. Training supports FP32 main parameters, gradient clipping and scaling, and learning rate scheduling. Optimizer guide - Distributed checkpointing (DCP). Saves training state in per-rank shards, supports asynchronous staging and writes, and reshards on load to match the target layout. Supports offline conversion to and from Hugging Face safetensors. Checkpoint guide
Generation and reinforcement learning
- Text generation. The
generateAPI supports greedy, top-k, and top-p sampling, KV caching, reuse of contiguous prefix caches, and TP/CP generation paths for adapted models. Generation examples - HyperParallel-RL (experimental). Includes a synchronous Qwen3 GRPO example with vLLM rollouts, weight synchronization between training and inference, and single-turn and multi-turn tool tasks. Provides PPO, GAE, and Critic components. Reinforcement learning guide
Downloads and installation
| Linux architecture | Python 3.10 | Python 3.11 | Python 3.12 |
|---|---|---|---|
| AArch64 | Download wheel | Download wheel | Download wheel |
| x86_64 | Download wheel | Download wheel | Download wheel |
Download the wheel that matches your machine architecture and Python version. For example, install the Linux AArch64 wheel for Python 3.11 after downloading it.
python -m pip install ./hyper_parallel-1.1.0-cp311-cp311-linux_aarch64.whlDevice runtime requirements, source builds, and multicore extension setup are covered in the installation guide.
Contributors
1372298, Aoalas, bbbbbinb, ch-l, ch-l1, changzherui, chenlan314, Cui-yshoho, DavidFFFan, davidhe91, donglinzhuo, dz-ssk, Etienne Fihol, fangyuxuan, gcw_IRmdSz7e, haiyangxin, hf1s, HuilanLee, hw-eric, IgorZan, jiahao2676-eng, jianzhnie, JiaqiSong-99, kingligh
kisnwangg, lei_xxx, Li-ai-git, Liang_Ziyi, lichen666, lichentrue, liuchongming74, liugagaga, Liviageng, luhao, luochao60, lzy0920232, Meng107, mxysfive, Nelson Lossing, nepdada, pengshuyuan, pierreleca, Probiotics5333, qhzhuang, rainyhorse, rongyue22, The-truthh, Thibaut-Tachon
tiandeyu-cs, tianzhenya, townwish4git, wang-hua-2019, wang-ziqi-code, wanghonghao, wangleiit03, wcrzlh, weixin_42266176, xingleixu123, xmoqian, xuxinkun_2026, xuxl1008, yangzhenzhang02, yao_yf, yooooo00, yu-chen-code, YYzz, zhangbuxue, zhangfeiran, zhaochunxu, zhouyaqiang2, zhouyunshu, Zjunyuan2026