LoongForge README

The project's README from github.com/baidu-baige/LoongForge. As one markdown file: README.md.

English | 简体中文

LoongForge

Train LLMs, VLMs, diffusion and embodied models, faster.

GitHub stars Docker images on Docker Hub PRs welcome Join our Discord Join our WeChat group

Training throughput speedup up to 5.04x over open-source baselines 40+ ready-to-run model examples Runs on NVIDIA GPUs and Kunlun XPUs Proven in production with runs up to 5,000+ XPUs

🌐 Website  ·  📖 Docs  ·  ✍️ Blog  ·  ⚡ Quick Start  ·  📊 Performance  ·  🏛️ Supported Models  ·  💬 Contact Us


Example: embodied-model training on LoongForge — DreamZero at 4.38× baseline throughput, loss curves aligned

DreamZero training run compared side by side: LoongForge reaches 4.38x the baseline throughput while the training loss curves stay aligned

💡 Why LoongForge?

LoongForge is an open-source training framework developed by the Baidu AI Cloud Baige team, built to deliver faster training for mainstream LLMs, VLMs, diffusion, and embodied models, thereby significantly reducing costs.

🐉 LoongForge is named after the traditional Chinese loong boat (龙舟), a symbol of coordinated power and forward momentum.

🏗️ Architecture

Since optimal training strategies differ across model families and scales, LoongForge adopts a multi-backend architecture.

LoongForge architecture: a patched-Megatron stack for LLMs, VLMs and diffusion models alongside a torch-native stack for embodied models

🔥 Latest News

📅 More
  • [2026/06] 🤖 Expanded VLA coverage with GR00T N1.6; 2.3× speedup on GR00T training. [blog]
  • [2026/05] ⚡ Accelerated Wan 2.2 training by 116%, and added CP and data packing support.
  • [2026/05] ✨ Added training support for Kimi K2.5 / K2.6, and introduced INT4 / NVFP4 PTQ.
  • [2026/05] 🎉 v0.1.0 — first official tagged release of LoongForge.
  • [2026/05] 🌟 Powered the training and public release of LLaVA-OneVision-2.0.
  • [2026/04] 🧩 Added training support for MiniMax-M2.7 on both NVIDIA GPU and Kunlun XPU.
  • [2026/04] 🚀 LoongForge source code publicly available on GitHub. [blog]
  • [2025/10] 🌟 Powered the training and public release of LLaVA-OneVision-1.5 under AIAK-Training-LLM, the predecessor of LoongForge. [blog]

✨ Key Features

🚀 Foundation Models

🧩 Multi-Modal Models

🤖 Embodied Models

🧰 Workflow & Compatibility

📖 Deep-dive: LLM · VLM · Embodied Model

📊 Performance

Training throughput speedups over mainstream open-source baselines — each model and its baseline were benchmarked on the same machine type with the same training hyperparameters:

LoongForge benchmark speedups over open-source baselines — from 1.45x on Qwen3-VL up to 5.04x on DeepSeek-V3.2 Lite

DeepSeek-V3.2 Lite reflects DSA operator-level optimizations and was validated on a reduced-layer configuration due to test-bed scale limits.
Numbers were measured at a point in time and may evolve as implementations change on both sides.

⚡ Quick Start

1. Install — use the unified prebuilt Docker image (one image for all model families) or build from source:

2. Pick a tutorial — by hardware and modality:

3. Find your model's scripts — ready-to-run launch scripts are available under examples/ / examples_xpu/, with configs in configs/models/.

🏛️ Supported Models

LoongForge supports a broad range of model families across LLM, VLM, diffusion, and embodied. Select a model below to open its training examples. For complete usage instructions, see the User Guide and the full model support matrix.

LLMVLMDiffusionEmbodied

🌟 Powered by LoongForge

Open-source models trained with LoongForge or its predecessor AIAK-Training-LLM:

Model Highlights
LLaVA-OneVision-2.0 Next-generation multimodal model, with new VideoCaption and Spatial datasets
Innovator-VL Scientific multimodal LLM for advanced reasoning
LLaVA-OneVision-1.5 Fully open framework for democratized multimodal training
Qianfan-VL Domain-enhanced vision-language models for enterprise, 3B–70B parameters

📂 Repository Layout

📁 Directory tree
LoongForge/
├── loongforge/                   # Core training framework
│   ├── train/                    # Training entry points & trainers
│   │   ├── pretrain/             #   Pretrain (LLM, VLM)
│   │   ├── sft/                  #   SFT (LLM, VLM, InternVL, ERNIE)
│   │   └── diffusion/            #   Diffusion (WAN, Qwen-Image)
│   ├── models/                   # Unified model abstractions
│   │   ├── foundation/           #   LLM backbones (LLaMA, Qwen, DeepSeek, ...)
│   │   ├── encoder/              #   Vision encoders (ViT, Qwen-VL, InternVL, ...)
│   │   ├── omni_models/          #   Multi-modal composition
│   │   ├── diffusion/            #   Diffusion models (WAN, Qwen-Image)
│   │   └── common/               #   Shared layers and utilities
│   ├── embodied/                 # LoongForge-Embodied: standalone torch-native (DDP/FSDP)
│   │                             #   embodied (VLA + world-action) subsystem — see loongforge/embodied/README.md
│   ├── data/                     # Data pipelines (multi-modal, video, DP balance)
│   ├── tokenizer/                # Tokenizers
│   └── utils/                    # Config map, constants, etc.
├── third_party/Loong-Megatron/   # Patched Megatron-LM (git submodule)
├── configs/                      # Hydra YAML configs (models, data)
├── examples/                     # GPU launch scripts
├── examples_xpu/                 # Kunlun XPU launch scripts
├── tools/                        # Checkpoint conversion, data preprocessing
├── ops/                          # Custom fused operators (incl. open-sourced TileLang)
├── patches/                      # TransformerEngine patches
├── docker/                       # Dockerfiles (GPU & XPU)
├── tests/                        # E2E test suite (YAML-driven)
└── docs/                         # Documentation

📝 Citation

If you find LoongForge helpful, please cite this project:

@software{LoongForge2026,
  title  = {LoongForge: A high-performance framework for training LLMs, VLMs, diffusion, and embodied models},
  author = {{The LoongForge Authors}},
  year   = {2026},
  url    = {https://github.com/baidu-baige/LoongForge}
}

If you use TAOT for MoE training in LoongForge, you can cite our paper:

@article{zhang2026taot,
  title   = {{TAOT}: Topology-Aware Optimal Transport for Dynamic Expert Replica Placement in {MoE} Training},
  author  = {Zhang, Lingyun and Zhang, Henghua and Gu, Shilei and Mo, Kai and Han, Shuai and Li, Shiyong and Wang, Yanpeng and Shen, Dou},
  journal = {arXiv preprint arXiv:2608.03676},
  year    = {2026},
  url     = {https://arxiv.org/abs/2608.03676}
}

🤝 Contributing

We warmly welcome community contributions — bug reports, feature proposals, and PRs alike. Please read our Contributing Guidelines before submitting.

Thanks to all our contributors:

LoongForge contributors

🙏 Acknowledgments

LoongForge builds on NVIDIA's Megatron-LM and draws inspiration from many excellent open-source projects, including HuggingFace Transformers, LLaMA-Factory, Megatron-Bridge, and LeRobot, as well as the official implementations of the models it supports (e.g. OpenPI, NVIDIA Isaac GR00T). We sincerely thank these communities for their outstanding contributions, and would also like to extend our gratitude to the LINUX DO community for its welcoming space for technical discussion and support for open-source sharing.

💬 Contact Us

📄 License

LoongForge is released under the Apache License 2.0. Some files are derived from third-party open-source projects; please refer to the specific file headers for their respective copyright and attribution.

LoongForge (baidu-baige/LoongForge)

Searching Database…

这是什么?百度百舸团队开源的大模型训练框架,支持大语言模型(LLM)、多模态视觉模型(VLM)、扩散模型和具身智能模型的训练,目标是在 NVIDIA GPU 和昆仑 XPU 上实现更快的训练速度和更低的成本。
它是一个需要我写代码调用的库,还是一套现成的训练脚本?以脚本为主:你直接运行 examples/(NVIDIA)或 examplesxpu/(昆仑)下现成的启动脚本,配置文件放在 configs/models/ 里。内部有两套后端——一套是打过补丁的 Megatron-LM 训练栈,另一套是面向具身智能模型的纯 torch 训练栈。
我怎么把它跑起来?拉取统一的预构建 Docker 镜像(一个镜像覆盖所有模型家族),或从源码构建,然后按照适合你的硬件和模态的教程操作,从 examples/ 里运行你的模型对应的启动脚本。
整个代码库都是 Apache-2.0 协议吗?采用 Apache-2.0 协议,但并非完全统一:部分文件源自第三方开源项目,所以请查看各个文件头部的版权和署名信息。
必须有 NVIDIA 硬件吗,还是别的硬件也能跑?支持 NVIDIA GPU 或百度昆仑 XPU——两者都通过插件式设计原生支持,各自有独立的安装指南和教程。文档中没有提到纯 CPU 模式。
LoongForge 这个名字有什么由来?名字来自中国的传统龙舟——象征齐心协力、奋勇向前的力量,对分布式训练框架来说是很贴切的意象。
TAOT 是什么?百度的一种 MoE 训练技术:基于拓扑感知的动态副本放置,用来均衡专家并行的负载,相比业界方案最多可减少 74% 的开销,并在真实训练案例中实测获得 1.43 倍加速。
有真正用它训练出来的模型吗?有——LLaVA-OneVision-1.5 和 2.0、Innovator-VL 以及千帆 Qianfan-VL 系列(参数量 3B–70B)都是用 LoongForge 或其前身 AIAK-Training-LLM 训练的,其中最大规模的生产级训练用到了 5000 多个 XPU。
我能用不同的组件自由组装自己的 VLM 吗?可以——灵活的多模态组合能力让你直接通过配置,把可互换的 ViT 和 LLM 组件搭配起来(README 中的示例是 GLM-5.2 + MoonViT),完全不需要写自定义模型代码,还能按组件单独调整并行策略。
What are similar projects?ms-swift, verl, verl, sglang, ZDTaichu5.0-9B, unsloth, airllm, vllm
Size
55.5 MB
Stars
691
Age
5mo
Commits · 90 Days