Chatglm_lora_multi-gpu  by liangwq

ChatGLM toolkit for multi-GPU finetuning, inference, and applications

created 2 years ago
407 stars

Top 72.6% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a framework for fine-tuning and deploying large language models, specifically ChatGLM, with a focus on multi-GPU utilization and integration of various AI applications. It targets researchers and developers looking to extend LLM capabilities with custom data, plugins, and advanced features like image generation, retrieval, and digital human creation.

How It Works

The project leverages DeepSpeed and Accelerate for efficient multi-GPU training and inference, enabling distributed execution of LLM fine-tuning. It supports LoRA for parameter-efficient fine-tuning and integrates with tools like LangChain for knowledge-based retrieval and agent construction. The architecture allows for modular expansion with specific application examples provided for tasks such as real-time drawing, retrieval-augmented generation, and AI-powered digital humans.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Multi-GPU fine-tuning command example: torchrun --nproc_per_node=2 multi_gpu_fintune_belle.py --dataset_path data/alpaca ... --deepspeed ds_config_zero3.json
  • Requires Python, PyTorch, DeepSpeed, and Accelerate. Specific application examples may have additional dependencies and higher GPU memory requirements (e.g., 24GB for some generation tasks).

Highlighted Details

  • Supports multi-GPU fine-tuning using DeepSpeed (Zero3) and Accelerate.
  • Integrates LoRA for efficient fine-tuning.
  • Includes examples for LangChain-based knowledge retrieval, real-time drawing, retrieval-based image generation, and AI digital humans.
  • Demonstrates RLHF (Reinforcement Learning from Human Feedback) and Stable Diffusion LoRA training.
  • Provides batch inference capabilities for efficient deployment.

Maintenance & Community

The repository is maintained by liangwq. Links to CSDN and Zhihu articles are provided for theoretical explanations of various components.

Licensing & Compatibility

The repository's license is not explicitly stated in the README. Compatibility for commercial use or closed-source linking would require clarification of the license.

Limitations & Caveats

Some advanced features, like automated multi-module operation for poster generation, are noted as requiring manual intervention and are planned for future automation. The RLHF implementation is described as "naive" and expected to evolve. The README mentions that the DDP (Distributed Data Parallel) method has not been tested.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.