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)

kimi
Searching Database…

What is this?An open-source training framework from Baidu's Baige team for LLMs, VLMs, diffusion and embodied models, built for faster training and lower cost on NVIDIA GPUs and Kunlun XPUs.
Is it a library I code against, or a set of ready-made training scripts?It's script-driven: you run ready-to-use launch scripts under examples/ (NVIDIA) or examplesxpu/ (Kunlun) with configs in configs/models/. Internally there are two backends — a patched Megatron-LM stack and a torch-native stack for embodied models.
How do I get it running?Pull the unified prebuilt Docker image (one image covers all model families) or build from source, then follow a tutorial for your hardware and modality and run your model's launch script from examples/.
Is the whole codebase Apache-2.0?Apache-2.0, but not uniformly: some files derive from third-party open-source projects, so check individual file headers for their copyright and attribution.
Do I need NVIDIA hardware, or does it run on anything else?NVIDIA GPUs or Baidu Kunlun XPUs — both are supported natively through a plugin design, each with its own install guide and tutorial set. No CPU-only mode is mentioned.
Why the name LoongForge?It's named after the traditional Chinese loong boat (龙舟), a symbol of coordinated power and forward momentum — fitting imagery for a distributed training framework.
What is TAOT?A Baidu technique for MoE training: topology-aware dynamic replica placement that balances expert-parallel load, cutting overhead by up to 74% over industry solutions, with a 1.43× speedup measured on a real training case.
Has anything real been trained with it?Yes — LLaVA-OneVision-1.5 and 2.0, Innovator-VL and the Qianfan-VL family (3B–70B parameters) were trained with LoongForge or its predecessor AIAK-Training-LLM, whose largest production runs reached 5,000+ XPUs.
Can I assemble a custom VLM from separate components?Yes — flexible multi-modal composition lets you pair interchangeable ViT and LLM components (the README shows GLM-5.2 + MoonViT) straight from config, with no custom model code, and tune parallelism per component.
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