Skip to main content

No project description provided

Project description

Red Coast (redco) is a lightweight and user-friendly tool designed to automate distributed training and inference for large models while simplifying the ML pipeline development process without necessitating MLSys expertise from users.

RedCoast supports Large Models + Complex Algorithms, in a lightweight and user-friendly manner:

Check out our Tech Report for more details!

RedCoast: A Lightweight Tool to Automate Distributed Training of LLMs on Any GPU/TPUs
Bowen Tan, Yun Zhu, Lijuan Liu, Hongyi Wang, Yonghao Zhuang, Jindong Chen, Eric Xing, Zhiting Hu
NAACL 2024, Demo / MLSys Workshop @ NeurIPS 2023
[Paper] [Twitter] [Slides] [Demo Video] [Documentation]
Best Demo Paper Runner Up @ NAACL 2024

Installation

Install RedCoast

pip install redco

Adjust Jax to GPU/TPU version

The command above would automatically install cpu version of jax, so the version of Jax need to be adjusted based on your device. For example, on GPUs,

pip install --upgrade "jax[cuda12]"

If you are using TPU/CPU/AMD/Apple, see here for corresponding installation commands.

Examples

Examples across a set of paradigms can be found in examples/, including

Exemplar large model settings

The table below shows runnable model LLM finetuning on different kinds of servers. Numbers inside the brackets are the maximum length in training. All the settings are with full precision (fp32) and Adam optimizer.

2 $\times$ 1080Ti
(2 $\times$ 10G)
4 $\times$ A100
(4 $\times$ 40G)
2 $\times$ TPU-v4
(2 hosts $\times$ 4 chips $\times$ 32G)
16 $\times$ TPU-v4
(16 hosts $\times$ 4 chips $\times$ 32G)
BART-Large (1024) LLaMA-7B (1024) T5-XL-11B (512) OPT-66B (512)
GPT2-Large (512) GPT-J-6B (1024) OPT-13B (1024)

Go to example/language_modeling and examples/text_to_text to try them out!

Reference

@inproceedings{tan-etal-2024-redcoast,
    title = "{R}ed{C}oast: A Lightweight Tool to Automate Distributed Training of {LLM}s on Any {GPU}/{TPU}s",
    author = "Tan, Bowen  and
      Zhu, Yun  and
      Liu, Lijuan  and
      Wang, Hongyi  and
      Zhuang, Yonghao  and
      Chen, Jindong  and
      Xing, Eric  and
      Hu, Zhiting",
    editor = "Chang, Kai-Wei  and
      Lee, Annie  and
      Rajani, Nazneen",
    booktitle = "Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 3: System Demonstrations)",
    month = jun,
    year = "2024",
    address = "Mexico City, Mexico",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.naacl-demo.14",
    pages = "137--147",
    abstract = "The recent progress of AI can be largely attributed to large language models (LLMs). However, their escalating memory requirements introduce challenges for machine learning (ML) researchers and engineers. Addressing this requires developers to partition a large model to distribute it across multiple GPUs or TPUs. This necessitates considerable coding and intricate configuration efforts with existing model parallel tools, such as Megatron-LM, DeepSpeed, and Alpa. These tools require users{'} expertise in machine learning systems (MLSys), creating a bottleneck in LLM development, particularly for developers without MLSys background. In this work, we present RedCoast (Redco), a lightweight and user-friendly tool crafted to automate distributed training and inference for LLMs, as well as to simplify ML pipeline development. The design of Redco emphasizes two key aspects. Firstly, to automate model parallelism, our study identifies two straightforward rules to generate tensor parallel strategies for any given LLM. Integrating these rules into Redco facilitates effortless distributed LLM training and inference, eliminating the need of additional coding or complex configurations. We demonstrate the effectiveness by applying Redco on a set of LLM architectures, such as GPT-J, LLaMA, T5, and OPT, up to the size of 66B. Secondly, we propose a mechanism that allows for the customization of diverse ML pipelines through the definition of merely three functions, avoiding redundant and formulaic code like multi-host related processing. This mechanism proves adaptable across a spectrum of ML algorithms, from foundational language modeling to complex algorithms like meta-learning and reinforcement learning. As a result, Redco implementations exhibit significantly fewer lines of code compared to their official counterparts. RedCoast (Redco) has been released under Apache 2.0 license at https://github.com/tanyuqian/redco.",
}

Acknowledgement

The name of this package is inspired by Red Coast Base, a key location in the story of Three Body. From Red Coast Base, humanity broadcasts its first message into the vast universe. We thank Cixin Liu for such a masterpiece!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redco-0.4.21.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

redco-0.4.21-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

Details for the file redco-0.4.21.tar.gz.

File metadata

  • Download URL: redco-0.4.21.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for redco-0.4.21.tar.gz
Algorithm Hash digest
SHA256 929b6bb8f39dfeafd3452239d1e7f6286b784521a20e6531ef9bb284b80871a3
MD5 fbcb7c5cd65d1e00e25b94b4c7fece4d
BLAKE2b-256 1ae80d7e59d30d7f3e8d6bb7f88587db2ecc100ae2e644758f43f87966e55aba

See more details on using hashes here.

File details

Details for the file redco-0.4.21-py3-none-any.whl.

File metadata

  • Download URL: redco-0.4.21-py3-none-any.whl
  • Upload date:
  • Size: 31.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for redco-0.4.21-py3-none-any.whl
Algorithm Hash digest
SHA256 3069b628adac022ddd99e287efa0f2ce8a15658d536e46b97e59827aaabb206b
MD5 e009a2b9695571ceb434f6a4295cf1b7
BLAKE2b-256 5190ad1db6beb7c1db3a827471329f52ae1ab51a2e6530f02b73d0d9a5a213ca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page