Git Product home page Git Product logo

flashmodels's Introduction

Flash Models

Flash Models is a library containing models accelerated by TorchAcc, a PyTorch training acceleration framework based on PyTorch/XLA.

Currently, it hosts common open-source large language models, with plans to expand to include models from other domains such as vision.

Setup

Clone the code and install the required dependencies:

# Start a container using the Docker image with TorchAcc.
sudo docker run  --gpus all --net host --ipc host --shm-size 10G -it --rm --cap-add=SYS_PTRACE registry.cn-hangzhou.aliyuncs.com/pai-dlc/acc:r2.3.0-cuda12.1.0-py3.10-nightly bash

# Clone the code and install the requirements.
git clone https://github.com/AlibabaPAI/FlashModels.git
cd ./FlashModels
pip install -r requirements.txt

Training

Each model supports two types of tasks:

  • training with TorchAcc
  • training without TorchAcc (Pytorch cuda native mode)

Here is an example of llama training tasks on a single worker with multiple devices (GPU or TPU):

  • Training with TorchAcc
./examples/run.sh \
    --model ./hf_models/config/llama-7b \
    --accelerator acc \
    --gc \
    --mbs 24 \
    --fsdp 8 \
    --bf16
  • Training without TorchAcc
./examples/run.sh \
    --model ./hf_models/config/llama-7b \
    --accelerator cuda \
    --gc \
    --mbs 8 \
    --fsdp 8 \
    --bf16

Models

Models available in this repository:

Model FSDP TP PP GC BF16 FP16
LLaMA-2
QWen
ChatGLM
Olmo
Baichuan
ChatGLM
Gpt2
Gemma

Performance

TODO

flashmodels's People

Contributors

anw90 avatar seventeen17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.