{"id":13437591,"url":"https://github.com/hpcaitech/ColossalAI","last_synced_at":"2025-03-19T06:31:32.604Z","repository":{"id":36976651,"uuid":"422274596","full_name":"hpcaitech/ColossalAI","owner":"hpcaitech","description":"Making large AI models cheaper, faster and more accessible","archived":false,"fork":false,"pushed_at":"2024-10-24T09:51:19.000Z","size":65200,"stargazers_count":38754,"open_issues_count":435,"forks_count":4338,"subscribers_count":383,"default_branch":"main","last_synced_at":"2024-10-29T15:19:33.209Z","etag":null,"topics":["ai","big-model","data-parallelism","deep-learning","distributed-computing","foundation-models","heterogeneous-training","hpc","inference","large-scale","model-parallelism","pipeline-parallelism"],"latest_commit_sha":null,"homepage":"https://www.colossalai.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hpcaitech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE_LOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-28T16:19:44.000Z","updated_at":"2024-10-29T09:53:47.000Z","dependencies_parsed_at":"2024-03-15T04:25:46.621Z","dependency_job_id":"efb9dfaf-027d-414d-9022-44fd1d069a5b","html_url":"https://github.com/hpcaitech/ColossalAI","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpcaitech%2FColossalAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpcaitech%2FColossalAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpcaitech%2FColossalAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpcaitech%2FColossalAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hpcaitech","download_url":"https://codeload.github.com/hpcaitech/ColossalAI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244371280,"owners_count":20442344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","big-model","data-parallelism","deep-learning","distributed-computing","foundation-models","heterogeneous-training","hpc","inference","large-scale","model-parallelism","pipeline-parallelism"],"created_at":"2024-07-31T03:00:58.537Z","updated_at":"2025-03-19T06:31:32.597Z","avatar_url":"https://github.com/hpcaitech.png","language":"Python","readme":"# Colossal-AI\n\u003cdiv id=\"top\" align=\"center\"\u003e\n\n   [![logo](https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/colossal-ai_logo_vertical.png)](https://www.colossalai.org/)\n\n   Colossal-AI: Making large AI models cheaper, faster, and more accessible\n\n   \u003ch3\u003e \u003ca href=\"https://arxiv.org/abs/2110.14883\"\u003e Paper \u003c/a\u003e |\n   \u003ca href=\"https://www.colossalai.org/\"\u003e Documentation \u003c/a\u003e |\n   \u003ca href=\"https://github.com/hpcaitech/ColossalAI/tree/main/examples\"\u003e Examples \u003c/a\u003e |\n   \u003ca href=\"https://github.com/hpcaitech/ColossalAI/discussions\"\u003e Forum \u003c/a\u003e |\n   \u003ca href=\"https://colossalai.org/zh-Hans/docs/get_started/bonus/\"\u003eGPU Cloud Playground \u003c/a\u003e |\n   \u003ca href=\"https://hpc-ai.com/blog\"\u003e Blog \u003c/a\u003e\u003c/h3\u003e\n\n   [![GitHub Repo stars](https://img.shields.io/github/stars/hpcaitech/ColossalAI?style=social)](https://github.com/hpcaitech/ColossalAI/stargazers)\n   [![Build](https://github.com/hpcaitech/ColossalAI/actions/workflows/build_on_schedule.yml/badge.svg)](https://github.com/hpcaitech/ColossalAI/actions/workflows/build_on_schedule.yml)\n   [![Documentation](https://readthedocs.org/projects/colossalai/badge/?version=latest)](https://colossalai.readthedocs.io/en/latest/?badge=latest)\n   [![CodeFactor](https://www.codefactor.io/repository/github/hpcaitech/colossalai/badge)](https://www.codefactor.io/repository/github/hpcaitech/colossalai)\n   [![HuggingFace badge](https://img.shields.io/badge/%F0%9F%A4%97HuggingFace-Join-yellow)](https://huggingface.co/hpcai-tech)\n   [![slack badge](https://img.shields.io/badge/Slack-join-blueviolet?logo=slack\u0026amp)](https://github.com/hpcaitech/public_assets/tree/main/colossalai/contact/slack)\n   [![WeChat badge](https://img.shields.io/badge/微信-加入-green?logo=wechat\u0026amp)](https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/WeChat.png)\n\n\n   | [English](README.md) | [中文](docs/README-zh-Hans.md) |\n\n\u003c/div\u003e\n\n## Get Started with Colossal-AI Without Setup\n\nAccess high-end, on-demand compute for your research instantly—no setup needed.\n\nSign up now and get $10 in credits!\n\nLimited Academic Bonuses:\n\n* Top up $1,000 and receive 300 credits\n* Top up $500 and receive 100 credits\n\n\u003cdiv align=\"center\"\u003e\n   \u003ca href=\"https://hpc-ai.com/?utm_source=github\u0026utm_medium=social\u0026utm_campaign=promotion-colossalai\"\u003e\n   \u003cimg src=\"https://github.com/hpcaitech/public_assets/blob/main/colossalai/img/2.gif\" width=\"850\" /\u003e\n   \u003c/a\u003e\n\u003c/div\u003e\n\n\n## Latest News\n* [2025/02] [DeepSeek 671B Fine-Tuning Guide Revealed—Unlock the Upgraded DeepSeek Suite with One Click, AI Players Ecstatic!](https://company.hpc-ai.com/blog/shocking-release-deepseek-671b-fine-tuning-guide-revealed-unlock-the-upgraded-deepseek-suite-with-one-click-ai-players-ecstatic)\n* [2024/12] [The development cost of video generation models has saved by 50%! Open-source solutions are now available with H200 GPU vouchers](https://company.hpc-ai.com/blog/the-development-cost-of-video-generation-models-has-saved-by-50-open-source-solutions-are-now-available-with-h200-gpu-vouchers) [[code]](https://github.com/hpcaitech/Open-Sora/blob/main/scripts/train.py) [[vouchers]](https://colossalai.org/zh-Hans/docs/get_started/bonus/)\n* [2024/10] [How to build a low-cost Sora-like app? Solutions for you](https://company.hpc-ai.com/blog/how-to-build-a-low-cost-sora-like-app-solutions-for-you)\n* [2024/09] [Singapore Startup HPC-AI Tech Secures 50 Million USD in Series A Funding to Build the Video Generation AI Model and GPU Platform](https://company.hpc-ai.com/blog/singapore-startup-hpc-ai-tech-secures-50-million-usd-in-series-a-funding-to-build-the-video-generation-ai-model-and-gpu-platform)\n* [2024/09] [Reducing AI Large Model Training Costs by 30% Requires Just a Single Line of Code From FP8 Mixed Precision Training Upgrades](https://company.hpc-ai.com/blog/reducing-ai-large-model-training-costs-by-30-requires-just-a-single-line-of-code-from-fp8-mixed-precision-training-upgrades)\n* [2024/06] [Open-Sora Continues Open Source: Generate Any 16-Second 720p HD Video with One Click, Model Weights Ready to Use](https://hpc-ai.com/blog/open-sora-from-hpc-ai-tech-team-continues-open-source-generate-any-16-second-720p-hd-video-with-one-click-model-weights-ready-to-use)\n* [2024/05] [Large AI Models Inference Speed Doubled, Colossal-Inference Open Source Release](https://hpc-ai.com/blog/colossal-inference)\n* [2024/04] [Open-Sora Unveils Major Upgrade: Embracing Open Source with Single-Shot 16-Second Video Generation and 720p Resolution](https://hpc-ai.com/blog/open-soras-comprehensive-upgrade-unveiled-embracing-16-second-video-generation-and-720p-resolution-in-open-source)\n* [2024/04] [Most cost-effective solutions for inference, fine-tuning and pretraining, tailored to LLaMA3 series](https://hpc-ai.com/blog/most-cost-effective-solutions-for-inference-fine-tuning-and-pretraining-tailored-to-llama3-series)\n\n## Table of Contents\n\u003cul\u003e\n \u003cli\u003e\u003ca href=\"#Why-Colossal-AI\"\u003eWhy Colossal-AI\u003c/a\u003e \u003c/li\u003e\n \u003cli\u003e\u003ca href=\"#Features\"\u003eFeatures\u003c/a\u003e \u003c/li\u003e\n \u003cli\u003e\n   \u003ca href=\"#Colossal-AI-in-the-Real-World\"\u003eColossal-AI for Real World Applications\u003c/a\u003e\n   \u003cul\u003e\n     \u003cli\u003e\u003ca href=\"#Open-Sora\"\u003eOpen-Sora: Revealing Complete Model Parameters, Training Details, and Everything for Sora-like Video Generation Models\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#Colossal-LLaMA-2\"\u003eColossal-LLaMA-2: One Half-Day of Training Using a Few Hundred Dollars Yields Similar Results to Mainstream Large Models, Open-Source and Commercial-Free Domain-Specific Llm Solution\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#ColossalChat\"\u003eColossalChat: An Open-Source Solution for Cloning ChatGPT With a Complete RLHF Pipeline\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#AIGC\"\u003eAIGC: Acceleration of Stable Diffusion\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#Biomedicine\"\u003eBiomedicine: Acceleration of AlphaFold Protein Structure\u003c/a\u003e\u003c/li\u003e\n   \u003c/ul\u003e\n \u003c/li\u003e\n \u003cli\u003e\n   \u003ca href=\"#Parallel-Training-Demo\"\u003eParallel Training Demo\u003c/a\u003e\n   \u003cul\u003e\n     \u003cli\u003e\u003ca href=\"#LLaMA3\"\u003eLLaMA 1/2/3 \u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#MoE\"\u003eMoE\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#GPT-3\"\u003eGPT-3\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#GPT-2\"\u003eGPT-2\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#BERT\"\u003eBERT\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#PaLM\"\u003ePaLM\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#OPT\"\u003eOPT\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#ViT\"\u003eViT\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#Recommendation-System-Models\"\u003eRecommendation System Models\u003c/a\u003e\u003c/li\u003e\n   \u003c/ul\u003e\n \u003c/li\u003e\n \u003cli\u003e\n   \u003ca href=\"#Single-GPU-Training-Demo\"\u003eSingle GPU Training Demo\u003c/a\u003e\n   \u003cul\u003e\n     \u003cli\u003e\u003ca href=\"#GPT-2-Single\"\u003eGPT-2\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#PaLM-Single\"\u003ePaLM\u003c/a\u003e\u003c/li\u003e\n   \u003c/ul\u003e\n \u003c/li\u003e\n \u003cli\u003e\n   \u003ca href=\"#Inference\"\u003eInference\u003c/a\u003e\n   \u003cul\u003e\n     \u003cli\u003e\u003ca href=\"#Colossal-Inference\"\u003eColossal-Inference: Large AI  Models Inference Speed Doubled\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#Grok-1\"\u003eGrok-1: 314B model of PyTorch + HuggingFace Inference\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#SwiftInfer\"\u003eSwiftInfer:Breaks the Length Limit of LLM for Multi-Round Conversations with 46% Acceleration\u003c/a\u003e\u003c/li\u003e\n   \u003c/ul\u003e\n \u003c/li\u003e\n \u003cli\u003e\n   \u003ca href=\"#Installation\"\u003eInstallation\u003c/a\u003e\n   \u003cul\u003e\n     \u003cli\u003e\u003ca href=\"#PyPI\"\u003ePyPI\u003c/a\u003e\u003c/li\u003e\n     \u003cli\u003e\u003ca href=\"#Install-From-Source\"\u003eInstall From Source\u003c/a\u003e\u003c/li\u003e\n   \u003c/ul\u003e\n \u003c/li\u003e\n \u003cli\u003e\u003ca href=\"#Use-Docker\"\u003eUse Docker\u003c/a\u003e\u003c/li\u003e\n \u003cli\u003e\u003ca href=\"#Community\"\u003eCommunity\u003c/a\u003e\u003c/li\u003e\n \u003cli\u003e\u003ca href=\"#Contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n \u003cli\u003e\u003ca href=\"#Cite-Us\"\u003eCite Us\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n## Why Colossal-AI\n\u003cdiv align=\"center\"\u003e\n   \u003ca href=\"https://youtu.be/KnXSfjqkKN0\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/JamesDemmel_Colossal-AI.png\" width=\"600\" /\u003e\n   \u003c/a\u003e\n\n   Prof. James Demmel (UC Berkeley): Colossal-AI makes training AI models efficient, easy, and scalable.\n\u003c/div\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Features\n\nColossal-AI provides a collection of parallel components for you. We aim to support you to write your\ndistributed deep learning models just like how you write your model on your laptop. We provide user-friendly tools to kickstart\ndistributed training and inference in a few lines.\n\n- Parallelism strategies\n  - Data Parallelism\n  - Pipeline Parallelism\n  - 1D, [2D](https://arxiv.org/abs/2104.05343), [2.5D](https://arxiv.org/abs/2105.14500), [3D](https://arxiv.org/abs/2105.14450) Tensor Parallelism\n  - [Sequence Parallelism](https://arxiv.org/abs/2105.13120)\n  - [Zero Redundancy Optimizer (ZeRO)](https://arxiv.org/abs/1910.02054)\n  - [Auto-Parallelism](https://arxiv.org/abs/2302.02599)\n\n- Heterogeneous Memory Management\n  - [PatrickStar](https://arxiv.org/abs/2108.05818)\n\n- Friendly Usage\n  - Parallelism based on the configuration file\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Colossal-AI in the Real World\n### Open-Sora\n\n[Open-Sora](https://github.com/hpcaitech/Open-Sora)：Revealing Complete Model Parameters, Training Details, and Everything for Sora-like Video Generation Models\n[[code]](https://github.com/hpcaitech/Open-Sora)\n[[blog]](https://hpc-ai.com/blog/open-sora-from-hpc-ai-tech-team-continues-open-source-generate-any-16-second-720p-hd-video-with-one-click-model-weights-ready-to-use)\n[[Model weights]](https://github.com/hpcaitech/Open-Sora?tab=readme-ov-file#model-weights)\n[[Demo]](https://github.com/hpcaitech/Open-Sora?tab=readme-ov-file#-latest-demo)\n[[GPU Cloud Playground]](https://cloud.luchentech.com/)\n[[OpenSora Image]](https://cloud.luchentech.com/doc/docs/image/open-sora/)\n\n\u003cdiv align=\"center\"\u003e\n   \u003ca href=\"https://youtu.be/ilMQpU71ddI?si=J4JSPzZ03ycYmlki\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/applications/sora/opensora-v1.2.png\" width=\"700\" /\u003e\n   \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Colossal-LLaMA-2\n\n[[GPU Cloud Playground]](https://cloud.luchentech.com/)\n[[LLaMA3 Image]](https://cloud.luchentech.com/doc/docs/image/llama)\n\n- 7B: One half-day of training using a few hundred dollars yields similar results to mainstream large models, open-source and commercial-free domain-specific LLM solution.\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/applications/Colossal-LLaMA-2)\n[[blog]](https://www.hpc-ai.tech/blog/one-half-day-of-training-using-a-few-hundred-dollars-yields-similar-results-to-mainstream-large-models-open-source-and-commercial-free-domain-specific-llm-solution)\n[[HuggingFace model weights]](https://huggingface.co/hpcai-tech/Colossal-LLaMA-2-7b-base)\n[[Modelscope model weights]](https://www.modelscope.cn/models/colossalai/Colossal-LLaMA-2-7b-base/summary)\n\n- 13B: Construct refined 13B private model with just $5000 USD.\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/applications/Colossal-LLaMA-2)\n[[blog]](https://hpc-ai.com/blog/colossal-llama-2-13b)\n[[HuggingFace model weights]](https://huggingface.co/hpcai-tech/Colossal-LLaMA-2-13b-base)\n[[Modelscope model weights]](https://www.modelscope.cn/models/colossalai/Colossal-LLaMA-2-13b-base/summary)\n\n|              Model              |  Backbone  | Tokens Consumed |     MMLU (5-shot)    | CMMLU (5-shot)| AGIEval (5-shot) | GAOKAO (0-shot) | CEval (5-shot)  |\n| :-----------------------------: | :--------: | :-------------: | :------------------: | :-----------: | :--------------: | :-------------: | :-------------: |\n|          Baichuan-7B            |     -      |      1.2T       |    42.32 (42.30)     | 44.53 (44.02) |        38.72     |       36.74     |       42.80     |\n|       Baichuan-13B-Base         |     -      |      1.4T       |    50.51 (51.60)     | 55.73 (55.30) |        47.20     |       51.41     |       53.60     |\n|       Baichuan2-7B-Base         |     -      |      2.6T       |    46.97 (54.16)     | 57.67 (57.07) |        45.76     |       52.60     |       54.00     |\n|       Baichuan2-13B-Base        |     -      |      2.6T       |    54.84 (59.17)     | 62.62 (61.97) |        52.08     |       58.25     |       58.10     |\n|           ChatGLM-6B            |     -      |      1.0T       |    39.67 (40.63)     |   41.17 (-)   |        40.10     |       36.53     |       38.90     |\n|          ChatGLM2-6B            |     -      |      1.4T       |    44.74 (45.46)     |   49.40 (-)   |        46.36     |       45.49     |       51.70     |\n|          InternLM-7B            |     -      |      1.6T       |    46.70 (51.00)     |   52.00 (-)   |        44.77     |       61.64     |       52.80     |\n|            Qwen-7B              |     -      |      2.2T       |    54.29 (56.70)     | 56.03 (58.80) |        52.47     |       56.42     |       59.60     |\n|           Llama-2-7B            |     -      |      2.0T       |    44.47 (45.30)     |   32.97 (-)   |        32.60     |       25.46     |         -       |\n| Linly-AI/Chinese-LLaMA-2-7B-hf  | Llama-2-7B |      1.0T       |        37.43         |     29.92     |        32.00     |       27.57     |         -       |\n| wenge-research/yayi-7b-llama2   | Llama-2-7B |        -        |        38.56         |     31.52     |        30.99     |       25.95     |         -       |\n| ziqingyang/chinese-llama-2-7b   | Llama-2-7B |        -        |        33.86         |     34.69     |        34.52     |       25.18     |        34.2     |\n| TigerResearch/tigerbot-7b-base  | Llama-2-7B |      0.3T       |        43.73         |     42.04     |        37.64     |       30.61     |         -       |\n|  LinkSoul/Chinese-Llama-2-7b    | Llama-2-7B |        -        |        48.41         |     38.31     |        38.45     |       27.72     |         -       |\n|       FlagAlpha/Atom-7B         | Llama-2-7B |      0.1T       |        49.96         |     41.10     |        39.83     |       33.00     |         -       |\n| IDEA-CCNL/Ziya-LLaMA-13B-v1.1   | Llama-13B  |      0.11T      |        50.25         |     40.99     |        40.04     |       30.54     |         -       |\n|  **Colossal-LLaMA-2-7b-base**   | Llama-2-7B |   **0.0085T**   |        53.06         |     49.89     |        51.48     |       58.82     |        50.2     |\n|  **Colossal-LLaMA-2-13b-base**  | Llama-2-13B |   **0.025T**    |        56.42         |     61.80     |        54.69     |       69.53     |        60.3     |\n\n\n### ColossalChat\n\n\u003cdiv align=\"center\"\u003e\n   \u003ca href=\"https://www.youtube.com/watch?v=HcTiHzApHm0\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/applications/chat/ColossalChat%20YouTube.png\" width=\"700\" /\u003e\n   \u003c/a\u003e\n\u003c/div\u003e\n\n[ColossalChat](https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat): An open-source solution for cloning [ChatGPT](https://openai.com/blog/chatgpt/) with a complete RLHF pipeline.\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat)\n[[blog]](https://medium.com/@yangyou_berkeley/colossalchat-an-open-source-solution-for-cloning-chatgpt-with-a-complete-rlhf-pipeline-5edf08fb538b)\n[[demo]](https://www.youtube.com/watch?v=HcTiHzApHm0)\n[[tutorial]](https://www.youtube.com/watch?v=-qFBZFmOJfg)\n\n\u003cp id=\"ColossalChat-Speed\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/applications/chat/ColossalChat%20Speed.jpg\" width=450/\u003e\n\u003c/p\u003e\n\n- Up to 10 times faster for RLHF PPO Stage3 Training\n\n\u003cp id=\"ColossalChat_scaling\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/applications/chatgpt/ChatGPT%20scaling.png\" width=800/\u003e\n\u003c/p\u003e\n\n- Up to 7.73 times faster for single server training and 1.42 times faster for single-GPU inference\n\n\u003cp id=\"ColossalChat-1GPU\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/applications/chatgpt/ChatGPT-1GPU.jpg\" width=450/\u003e\n\u003c/p\u003e\n\n- Up to 10.3x growth in model capacity on one GPU\n- A mini demo training process requires only 1.62GB of GPU memory (any consumer-grade GPU)\n\n\u003cp id=\"ColossalChat-LoRA\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/applications/chatgpt/LoRA%20data.jpg\" width=600/\u003e\n\u003c/p\u003e\n\n- Increase the capacity of the fine-tuning model by up to 3.7 times on a single GPU\n- Keep at a sufficiently high running speed\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n### AIGC\nAcceleration of AIGC (AI-Generated Content) models such as [Stable Diffusion v1](https://github.com/CompVis/stable-diffusion) and [Stable Diffusion v2](https://github.com/Stability-AI/stablediffusion).\n\u003cp id=\"diffusion_train\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/Stable%20Diffusion%20v2.png\" width=800/\u003e\n\u003c/p\u003e\n\n- [Training](https://github.com/hpcaitech/ColossalAI/tree/main/examples/images/diffusion): Reduce Stable Diffusion memory consumption by up to 5.6x and hardware cost by up to 46x (from A100 to RTX3060).\n\n\u003cp id=\"diffusion_demo\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/DreamBooth.png\" width=800/\u003e\n\u003c/p\u003e\n\n- [DreamBooth Fine-tuning](https://github.com/hpcaitech/ColossalAI/tree/main/examples/images/dreambooth): Personalize your model using just 3-5 images of the desired subject.\n\n\u003cp id=\"inference-sd\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/Stable%20Diffusion%20Inference.jpg\" width=800/\u003e\n\u003c/p\u003e\n\n- [Inference](https://github.com/hpcaitech/ColossalAI/tree/main/examples/images/diffusion): Reduce inference GPU memory consumption by 2.5x.\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Biomedicine\nAcceleration of [AlphaFold Protein Structure](https://alphafold.ebi.ac.uk/)\n\n\u003cp id=\"FastFold\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/FastFold.jpg\" width=800/\u003e\n\u003c/p\u003e\n\n- [FastFold](https://github.com/hpcaitech/FastFold): Accelerating training and inference on GPU Clusters, faster data processing, inference sequence containing more than 10000 residues.\n\n\u003cp id=\"FastFold-Intel\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/data%20preprocessing%20with%20Intel.jpg\" width=600/\u003e\n\u003c/p\u003e\n\n- [FastFold with Intel](https://github.com/hpcaitech/FastFold): 3x inference acceleration and 39% cost reduce.\n\n\u003cp id=\"xTrimoMultimer\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/xTrimoMultimer_Table.jpg\" width=800/\u003e\n\u003c/p\u003e\n\n- [xTrimoMultimer](https://github.com/biomap-research/xTrimoMultimer): accelerating structure prediction of protein monomers and multimer by 11x.\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Parallel Training Demo\n### LLaMA3\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/examples/images/LLaMA3-70B-H100.png\" width=600/\u003e\n\u003c/p\u003e\n\n- 70 billion parameter LLaMA3 model training accelerated by 18%\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/examples/language/llama)\n[[GPU Cloud Playground]](https://cloud.luchentech.com/)\n[[LLaMA3 Image]](https://cloud.luchentech.com/doc/docs/image/llama)\n\n### LLaMA2\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/llama2_pretraining.png\" width=600/\u003e\n\u003c/p\u003e\n\n- 70 billion parameter LLaMA2 model training accelerated by 195%\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/examples/language/llama)\n[[blog]](https://www.hpc-ai.tech/blog/70b-llama2-training)\n\n### LLaMA1\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/examples/images/LLaMA_pretraining.png\" width=600/\u003e\n\u003c/p\u003e\n\n- 65-billion-parameter large model pretraining accelerated by 38%\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/examples/language/llama)\n[[blog]](https://www.hpc-ai.tech/blog/large-model-pretraining)\n\n### MoE\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/examples/images/MOE_training.png\" width=800/\u003e\n\u003c/p\u003e\n\n- Enhanced MoE parallelism, Open-source MoE model training can be 9 times more efficient\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/examples/language/openmoe)\n[[blog]](https://www.hpc-ai.tech/blog/enhanced-moe-parallelism-open-source-moe-model-training-can-be-9-times-more-efficient)\n\n### GPT-3\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/GPT3-v5.png\" width=700/\u003e\n\u003c/p\u003e\n\n- Save 50% GPU resources and 10.7% acceleration\n\n### GPT-2\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/GPT2.png\" width=800/\u003e\n\n- 11x lower GPU memory consumption, and superlinear scaling efficiency with Tensor Parallelism\n\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/(updated)GPT-2.png\" width=800\u003e\n\n- 24x larger model size on the same hardware\n- over 3x acceleration\n### BERT\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/BERT.png\" width=800/\u003e\n\n- 2x faster training, or 50% longer sequence length\n\n### PaLM\n- [PaLM-colossalai](https://github.com/hpcaitech/PaLM-colossalai): Scalable implementation of Google's Pathways Language Model ([PaLM](https://ai.googleblog.com/2022/04/pathways-language-model-palm-scaling-to.html)).\n\n### OPT\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/OPT_update.png\" width=800/\u003e\n\n- [Open Pretrained Transformer (OPT)](https://github.com/facebookresearch/metaseq), a 175-Billion parameter AI language model released by Meta, which stimulates AI programmers to perform various downstream tasks and application deployments because of public pre-trained model weights.\n- 45% speedup fine-tuning OPT at low cost in lines. [[Example]](https://github.com/hpcaitech/ColossalAI/tree/main/examples/language/opt) [[Online Serving]](https://colossalai.org/docs/advanced_tutorials/opt_service)\n\nPlease visit our [documentation](https://www.colossalai.org/) and [examples](https://github.com/hpcaitech/ColossalAI/tree/main/examples) for more details.\n\n### ViT\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/ViT.png\" width=\"450\" /\u003e\n\u003c/p\u003e\n\n- 14x larger batch size, and 5x faster training for Tensor Parallelism = 64\n\n### Recommendation System Models\n- [Cached Embedding](https://github.com/hpcaitech/CachedEmbedding), utilize software cache to train larger embedding tables with a smaller GPU memory budget.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Single GPU Training Demo\n\n### GPT-2\n\u003cp id=\"GPT-2-Single\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/GPT2-GPU1.png\" width=450/\u003e\n\u003c/p\u003e\n\n- 20x larger model size on the same hardware\n\n\u003cp id=\"GPT-2-NVME\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/GPT2-NVME.png\" width=800/\u003e\n\u003c/p\u003e\n\n- 120x larger model size on the same hardware (RTX 3080)\n\n### PaLM\n\u003cp id=\"PaLM-Single\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/PaLM-GPU1.png\" width=450/\u003e\n\u003c/p\u003e\n\n- 34x larger model size on the same hardware\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n## Inference\n### Colossal-Inference\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/inference/colossal-inference-v1-1.png\" width=1000/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/inference/colossal-inference-v1-2.png\" width=1000/\u003e\n\u003c/p\u003e\n\n - Large AI models inference speed doubled, compared to the offline inference performance of vLLM in some cases.\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/colossalai/inference)\n[[blog]](https://hpc-ai.com/blog/colossal-inference)\n[[GPU Cloud Playground]](https://cloud.luchentech.com/)\n[[LLaMA3 Image]](https://cloud.luchentech.com/doc/docs/image/llama)\n\n### Grok-1\n\u003cp id=\"Grok-1\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/examples/images/grok-1-inference.jpg\" width=600/\u003e\n\u003c/p\u003e\n\n - 314 Billion Parameter Grok-1 Inference Accelerated by 3.8x, an easy-to-use Python + PyTorch + HuggingFace version for Inference.\n\n[[code]](https://github.com/hpcaitech/ColossalAI/tree/main/examples/language/grok-1)\n[[blog]](https://hpc-ai.com/blog/314-billion-parameter-grok-1-inference-accelerated-by-3.8x-efficient-and-easy-to-use-pytorchhuggingface-version-is-here)\n[[HuggingFace Grok-1 PyTorch model weights]](https://huggingface.co/hpcai-tech/grok-1)\n[[ModelScope Grok-1 PyTorch model weights]](https://www.modelscope.cn/models/colossalai/grok-1-pytorch/summary)\n\n### SwiftInfer\n\u003cp id=\"SwiftInfer\" align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/SwiftInfer.jpg\" width=800/\u003e\n\u003c/p\u003e\n\n- [SwiftInfer](https://github.com/hpcaitech/SwiftInfer): Inference performance improved by 46%, open source solution breaks the length limit of LLM for multi-round conversations\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Installation\n\nRequirements:\n- PyTorch \u003e= 2.2\n- Python \u003e= 3.7\n- CUDA \u003e= 11.0\n- [NVIDIA GPU Compute Capability](https://developer.nvidia.com/cuda-gpus) \u003e= 7.0 (V100/RTX20 and higher)\n- Linux OS\n\nIf you encounter any problem with installation, you may want to raise an [issue](https://github.com/hpcaitech/ColossalAI/issues/new/choose) in this repository.\n\n### Install from PyPI\n\nYou can easily install Colossal-AI with the following command. **By default, we do not build PyTorch extensions during installation.**\n\n```bash\npip install colossalai\n```\n\n**Note: only Linux is supported for now.**\n\nHowever, if you want to build the PyTorch extensions during installation, you can set `BUILD_EXT=1`.\n\n```bash\nBUILD_EXT=1 pip install colossalai\n```\n\n**Otherwise, CUDA kernels will be built during runtime when you actually need them.**\n\nWe also keep releasing the nightly version to PyPI every week. This allows you to access the unreleased features and bug fixes in the main branch.\nInstallation can be made via\n\n```bash\npip install colossalai-nightly\n```\n\n### Download From Source\n\n\u003e The version of Colossal-AI will be in line with the main branch of the repository. Feel free to raise an issue if you encounter any problems. :)\n\n```shell\ngit clone https://github.com/hpcaitech/ColossalAI.git\ncd ColossalAI\n\n# install colossalai\npip install .\n```\n\nBy default, we do not compile CUDA/C++ kernels. ColossalAI will build them during runtime.\nIf you want to install and enable CUDA kernel fusion (compulsory installation when using fused optimizer):\n\n```shell\nBUILD_EXT=1 pip install .\n```\n\nFor Users with CUDA 10.2, you can still build ColossalAI from source. However, you need to manually download the cub library and copy it to the corresponding directory.\n\n```bash\n# clone the repository\ngit clone https://github.com/hpcaitech/ColossalAI.git\ncd ColossalAI\n\n# download the cub library\nwget https://github.com/NVIDIA/cub/archive/refs/tags/1.8.0.zip\nunzip 1.8.0.zip\ncp -r cub-1.8.0/cub/ colossalai/kernel/cuda_native/csrc/kernels/include/\n\n# install\nBUILD_EXT=1 pip install .\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Use Docker\n\n### Pull from DockerHub\n\nYou can directly pull the docker image from our [DockerHub page](https://hub.docker.com/r/hpcaitech/colossalai). The image is automatically uploaded upon release.\n\n\n### Build On Your Own\n\nRun the following command to build a docker image from Dockerfile provided.\n\n\u003e Building Colossal-AI from scratch requires GPU support, you need to use Nvidia Docker Runtime as the default when doing `docker build`. More details can be found [here](https://stackoverflow.com/questions/59691207/docker-build-with-nvidia-runtime).\n\u003e We recommend you install Colossal-AI from our [project page](https://www.colossalai.org) directly.\n\n\n```bash\ncd ColossalAI\ndocker build -t colossalai ./docker\n```\n\nRun the following command to start the docker container in interactive mode.\n\n```bash\ndocker run -ti --gpus all --rm --ipc=host colossalai bash\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Community\n\nJoin the Colossal-AI community on [Forum](https://github.com/hpcaitech/ColossalAI/discussions),\n[Slack](https://join.slack.com/t/colossalaiworkspace/shared_invite/zt-z7b26eeb-CBp7jouvu~r0~lcFzX832w),\nand [WeChat(微信)](https://raw.githubusercontent.com/hpcaitech/public_assets/main/colossalai/img/WeChat.png \"qrcode\") to share your suggestions, feedback, and questions with our engineering team.\n\n## Contributing\nReferring to the successful attempts of [BLOOM](https://bigscience.huggingface.co/) and [Stable Diffusion](https://en.wikipedia.org/wiki/Stable_Diffusion), any and all developers and partners with computing powers, datasets, models are welcome to join and build the Colossal-AI community, making efforts towards the era of big AI models!\n\nYou may contact us or participate in the following ways:\n1. [Leaving a Star ⭐](https://github.com/hpcaitech/ColossalAI/stargazers) to show your like and support. Thanks!\n2. Posting an [issue](https://github.com/hpcaitech/ColossalAI/issues/new/choose), or submitting a PR on GitHub follow the guideline in [Contributing](https://github.com/hpcaitech/ColossalAI/blob/main/CONTRIBUTING.md)\n3. Send your official proposal to email contact@hpcaitech.com\n\nThanks so much to all of our amazing contributors!\n\n\u003ca href=\"https://github.com/hpcaitech/ColossalAI/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=hpcaitech/ColossalAI\"  width=\"800px\"/\u003e\n\u003c/a\u003e\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n## CI/CD\n\nWe leverage the power of [GitHub Actions](https://github.com/features/actions) to automate our development, release and deployment workflows. Please check out this [documentation](.github/workflows/README.md) on how the automated workflows are operated.\n\n\n## Cite Us\n\nThis project is inspired by some related projects (some by our team and some by other organizations). We would like to credit these amazing projects as listed in the [Reference List](./docs/REFERENCE.md).\n\nTo cite this project, you can use the following BibTeX citation.\n\n```\n@inproceedings{10.1145/3605573.3605613,\nauthor = {Li, Shenggui and Liu, Hongxin and Bian, Zhengda and Fang, Jiarui and Huang, Haichen and Liu, Yuliang and Wang, Boxiang and You, Yang},\ntitle = {Colossal-AI: A Unified Deep Learning System For Large-Scale Parallel Training},\nyear = {2023},\nisbn = {9798400708435},\npublisher = {Association for Computing Machinery},\naddress = {New York, NY, USA},\nurl = {https://doi.org/10.1145/3605573.3605613},\ndoi = {10.1145/3605573.3605613},\nabstract = {The success of Transformer models has pushed the deep learning model scale to billions of parameters, but the memory limitation of a single GPU has led to an urgent need for training on multi-GPU clusters. However, the best practice for choosing the optimal parallel strategy is still lacking, as it requires domain expertise in both deep learning and parallel computing. The Colossal-AI system addressed the above challenge by introducing a unified interface to scale your sequential code of model training to distributed environments. It supports parallel training methods such as data, pipeline, tensor, and sequence parallelism and is integrated with heterogeneous training and zero redundancy optimizer. Compared to the baseline system, Colossal-AI can achieve up to 2.76 times training speedup on large-scale models.},\nbooktitle = {Proceedings of the 52nd International Conference on Parallel Processing},\npages = {766–775},\nnumpages = {10},\nkeywords = {datasets, gaze detection, text tagging, neural networks},\nlocation = {Salt Lake City, UT, USA},\nseries = {ICPP '23}\n}\n```\n\nColossal-AI has been accepted as official tutorial by top conferences [NeurIPS](https://nips.cc/), [SC](https://sc22.supercomputing.org/), [AAAI](https://aaai.org/Conferences/AAAI-23/),\n[PPoPP](https://ppopp23.sigplan.org/), [CVPR](https://cvpr2023.thecvf.com/), [ISC](https://www.isc-hpc.com/), [NVIDIA GTC](https://www.nvidia.com/en-us/on-demand/session/gtcspring23-S51482/) ,etc.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n","funding_links":[],"categories":["Python","Statistics","Frameworks","\u003ca name=\"for-beginner\"\u003eFor Beginners\u003c/a\u003e","Open-source Models","LLM Training Frameworks","Paper-Code","Frameworks-for-Training","Frameworks for Training","Deep Learning Framework","Large Language Models (LLMs)","分布式机器学习","Model Training \u0026 Experiments","Compression System:","Computation and Communication Optimisation","Summary","Training","文本生成","Repos","ai","LLM训练框架","🔓 Open Source Inference Engines","竞品","Model Training \u0026 Fine-Tuning","Researchers","Model Training \u0026 Fine-tuning","🚀 MLOps","📋 Contents","Table of Open-Source AI Agents Projects","Fine-tuning \u0026 Quantization (18)","Training \u0026 Fine-Tuning","Datasets and Models","LLMs Training"],"sub_categories":["Survey","Framework","Popular-LLM","Deployment \u0026 Distribution","Contribute to our Repository","Frameworks for Training","LLaMA以及扩展","General-Purpose Machine Learning","Misc","LLM 评估工具","Frameworks","LangManus","Tools","🛠️ 7. Training \u0026 Fine-tuning Ecosystem","Training Frameworks","Generated by LLMs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpcaitech%2FColossalAI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpcaitech%2FColossalAI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpcaitech%2FColossalAI/lists"}