LoongForge README

项目的 README,来自 github.com/baidu-baige/LoongForge。合并为一个 markdown 文件:README.md。

English | 简体中文

LoongForge

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

Docs  ·  Blog  ·  Performance  ·  Quick Start  ·  Supported Models  ·  Awesome Projects

Featured|HelloGitHub AtomGit star

GitHub stars Apache 2.0 license Docker images on Docker Hub PRs welcome

Join our Discord Join our WeChat group Find us on RedNote Follow us on Zhihu Follow us on X

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.


Example: training the embodied model DreamZero on LoongForge reaches 4.38× the open-source baseline's throughput, with loss curves staying aligned

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

⭐ Give us a Star to help more people discover LoongForge and grow the community.

🏗️ Architecture

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

LoongForge architecture: a Megatron backend for LLM / VLM / diffusion models, alongside a torch-native backend for embodied models

🔥 Latest News

📅 More
  • [2026/07] 🐳 Unified the prebuilt Docker images — all model families (LLM / VLM / Embodied / Diffusion) now share a single image.
  • [2026/07] 🤖 Released LoongForge-Embodied, a torch-native DDP/FSDP training subsystem for embodied models (Pi0.5, GR00T-N1.6/N1.7, xVLA, LingBot-VA, FastWAM, DreamZero, and Cosmos3), with up to 4.38× speedup.
  • [2026/07] ✨ Added training support for DeepSeek-V4-Flash / DeepSeek-V4-Pro.
  • [2026/07] ✨ Added training support for Qwen-Image-Edit-2511.
  • [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]

🤖 Embodied Models

Data processing, training, and evaluation for Vision-Language-Action (VLA) and World-Action (WAM) models, with 1.79×–4.38× training throughput over open-source baselines across benchmarked models. [Docs] (Paper coming soon)

LoongForge-Embodied architecture: an integrated data pipeline, accelerated model training with an extensible model registry, acceleration toolkit and distributed training, and integrated evaluation

Data

Human Demonstration (Input) Ego2Robot Output Examples (Multiple Robot Morphologies)
First-person video of a human manipulation task The same action retargeted onto multiple robot morphologies
First-person video of a human manipulation task The same action retargeted onto multiple robot morphologies

Training

Evaluation

ModelBenchmarkSuiteBaselineLoongForge
Pi0.5LIBEROSpatial97.0%99.6%
Object99.0%99.6%
Goal98.0%98.8%
Long96.0%97.0%
Avg.97.50%98.75%
RoboTwinEasy67.91%77.56%
GR00T N1.7LIBEROSpatial97.65%98.0%
Object98.45%98.5%
Goal97.50%96.5%
Long94.35%95.5%
Avg.96.99%97.13%
SimplerEnvBridge62.3%62.6%
Fractal72.5%72.1%
FastWAMLIBEROSpatial98.2%97.0%
Object99.2%99.6%
Goal97.8%97.2%
Long95.8%94.2%
Avg.97.75%97.00%
LingBot-VALIBEROLong78.8%84.6%
RoboTwinEasy86.1%87.6%
Hard85.1%85.7%

🚀 LLM · VLM · Diffusion

Built on the Megatron backend, supporting large-scale pre-training and SFT for LLMs and VLMs, as well as diffusion model training. Key optimizations for each scenario:

LLM

VLM

Diffusion

Compatibility

📖 Deep-dive: LLM · VLM

📊 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

Using NVIDIA GPU as an example, pull the prebuilt image and start a container (requires the NVIDIA Container Toolkit):

docker pull loongforge/loongforge:latest
mkdir -p workspace
docker run --gpus all --ipc=host -it --rm \
  -v "$(pwd)/workspace:/workspace/data" \
  -w /workspace/LoongForge \
  loongforge/loongforge:latest bash

The example above mounts ./workspace to /workspace/data inside the container, for storing weights, datasets, and training outputs — these persist after the container exits.

For more installation options including source builds, see: Full GPU installation guide · Kunlun XPU installation guide

2. Pick a tutorial — by hardware and modality

3. Launch example

Launch scripts for every supported model are already included in this repo: NVIDIA GPU scripts live under examples/, Kunlun XPU scripts under examples_xpu/ — see Supported Models for the full list.

The example below walks through DDP fine-tuning of Pi0.5 on LIBERO (single node, 8 GPUs); run all commands inside the container above.

① Prepare weights, tokenizer, and dataset (hf is the Hugging Face CLI):

hf download lerobot/pi05_base --local-dir /workspace/data/pi05_base
hf download google/paligemma-3b-pt-224 --local-dir /workspace/data/paligemma-3b-pt-224
hf download lerobot/libero_10 --repo-type dataset --local-dir /workspace/data/libero_10

② Launch training (paths are set via environment variables; defaults to 20 steps to validate the workflow):

export CHECKPOINT_PATH=/workspace/data/pi05_base
export TOKENIZER_PATH=/workspace/data/paligemma-3b-pt-224
export DATA_PATH=/workspace/data/libero_10
export OUTPUT_DIR=/workspace/data/outputs/pi05

bash examples/embodied/pi05/run_pi05_ddp_finetune.sh

Logs and TensorBoard data are saved under OUTPUT_DIR. For FSDP / ZeRO-1 launch options and LIBERO evaluation, see the Pi0.5 tutorial.

🏛️ Supported Models

Click any model for its training examples; see configs/models/ for the matching parameter configs. See the model support matrix for all variants.

EmbodiedLLMVLMDiffusion

[!TIP] For VLMs, also see the custom composition example, which assembles a new model from a ViT and an LLM purely through configuration.

🌟 Awesome Projects Built with LoongForge

See more on the Projects page, and if you've built something with LoongForge (or its predecessor, AIAK-Training-LLM), let us know — we'd love to feature it.

From the Community

From the LoongForge Team

https://github.com/user-attachments/assets/8563afca-f79a-4a45-bb4f-36e06c0ccbcb

📝 Community Blogs

📂 Repository Layout

📁 Directory tree
LoongForge/
├── loongforge/                   # Core training framework
│   ├── train/                    # Training entry points and trainers
│   │   ├── pretrain/             #   Pretraining
│   │   ├── sft/                  #   Supervised fine-tuning
│   │   └── diffusion/            #   Diffusion training
│   ├── models/                   # Unified model abstractions
│   │   ├── foundation/           #   LLM backbones
│   │   ├── encoder/              #   Vision encoders
│   │   ├── omni_models/          #   Multimodal composition (encoder + projector + decoder)
│   │   ├── diffusion/            #   Diffusion models
│   │   └── common/               #   Shared base configs, layers and utilities
│   ├── embodied/                 # Embodied (VLA + world-action) training: models, data, trainers, distributed, eval
│   ├── data/                     # Data loading and processing pipelines
│   ├── tokenizer/                # Tokenizers
│   └── utils/                    # Config registry, constants and shared helpers
├── third_party/                  # Third-party dependencies and patches
│   ├── Loong-Megatron/            # Patched Megatron-LM (git submodule)
│   └── patches/                  # TransformerEngine patches
├── configs/                      # Hydra YAML configs (models, data)
├── examples/                     # Launch scripts for NVIDIA GPUs
├── examples_xpu/                 # Launch scripts for Kunlun XPUs
├── cookbook/                     # End-to-end project recipes built on LoongForge
├── tools/                        # Standalone dev tools: checkpoint conversion, data preprocessing, etc. (see tools/README.md)
├── ops/                          # Custom fused operators (incl. open-sourced TileLang)
├── docker/                       # Dockerfiles (GPU & XPU)
├── tests/                        # Test suites (E2E, regression, unit)
└── docs/                         # Documentation

📝 Citation

If you find LoongForge helpful, please consider citing 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 find TAOT helpful, please consider citing 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}
}

If you find LoongForge-VLDA helpful, please consider citing our paper:

@article{zhang2026vlda,
  title   = {{Vision-Language-Delta-Action}: Learning Compact Deltas as Actionable Transition Interfaces for Robotic Manipulation},
  author  = {Zhang, Lingsen and Li, Wei and He, Jie and Zhang, Henghua and Mo, Kai and Li, Shiyong and Wang, Yanpeng and Shao, Rui},
  journal = {arXiv preprint arXiv:2610.25874},
  year    = {2026},
  url     = {https://arxiv.org/abs/2610.25874}
}

🤝 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

💬 Contact Us

Channel What it's for
GitHub Issues Bug reports, usage questions, and feature requests
Developer Communities WeChat group, Xiaohongshu, and more
Email Enterprise adoption, large-scale deployment, partnership, or any other topic

🙏 Acknowledgments

LoongForge stands on the shoulders of the open-source community. Its Megatron backend builds on NVIDIA's Megatron-LM, and the project also draws on HuggingFace Transformers, LLaMA-Factory, Megatron-Bridge, LeRobot, and the official implementations of the models we support (e.g. OpenPI, NVIDIA Isaac GR00T).

We also thank the LINUX DO community for providing a welcoming space for technical discussion, and AtomGit for hosting LoongForge's official mirror.

📄 License

LoongForge is released under the Apache License 2.0; some files derive from third-party projects — see their file headers.

LoongForge (baidu-baige/LoongForge)

正在搜索数据库…

这是什么?百度百舸团队开源的大模型训练框架,支持大语言模型(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),完全不需要写自定义模型代码,还能按组件单独调整并行策略。
有哪些类似的项目?ms-swift, verl, verl, sglang, ZDTaichu5.0-9B, unsloth, airllm, EasyWAM
大小
93.9 MB
星标
863
时长
7个月
提交 · 90 天