llmq  by IST-DASLab

Quantized LLM training in pure CUDA/C++

Created 9 months ago
250 stars

Top 100.0% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

<2-3 sentences summarising what the project addresses and solves, the target audience, and the benefit.> IST-DASLab/llmq provides a high-performance, pure CUDA/C++ framework for training quantized Large Language Models (LLMs). It targets medium-sized, multi-GPU setups, enabling efficient LLM training and fine-tuning on accessible hardware with significant speed and memory benefits.

How It Works

This project implements LLM training in pure CUDA/C++, inspired by llm.c, focusing on efficient quantized training. It leverages low-bit precision for computations and optimizer states to reduce memory and accelerate training. The architecture supports multi-GPU parallelism and advanced techniques like activation recomputation and host memory offloading for maximizing model size and throughput.

Quick Start & Requirements

Builds require C++20, CUDA 12+, NCCL, cuDNN; CMake manages dependencies. Primary build: cmake -S . -B build && cmake --build build --parallel --target train. Data prep uses scripts/tokenize_data.py. Training requires specifying models, data, and optimization parameters. Dependencies include gcc-13, cmake, ninja-build, git, and specific CUDA/cuDNN/NCCL versions. Python 3.12+ for bindings/scripts.

Highlighted Details

  • Performance: High TPS rates, with benchmarks showing over 300k TPS for smaller models on 4x RTX 4090 GPUs and high SOL utilization (up to 82%).
  • Memory Optimization: Extensive control over activation recomputation (e.g., --recompute-block) and offloading of optimizer states/weights to host memory, enabling larger models.
  • Quantization Flexibility: Supports low-bit data types for matrix multiplications (e4m3) and optimizer states (bf16), with options for persistent quantized weights.
  • Python Bindings: Optional Python bindings available for integration with Python workflows, with pre-built wheels provided.

Maintenance & Community

Inspired by Andrej Karpathy's llm.c. No specific details on active maintainers, community channels, or a public roadmap are provided.

Licensing & Compatibility

The license type is not explicitly stated in the README, a critical omission for adoption decisions. Python bindings are built against specific CUDA versions (12.8, 13.0) and compute capabilities.

Limitations & Caveats

tokenize_data has limited dataset support. FP32 attention backward pass is non-deterministic. Python bindings offer coarse-grained operations and lack multi-process support. The absence of a stated license is a significant adoption blocker.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera) and Stas Bekman Stas Bekman(Author of "Machine Learning Engineering Open Book"; Research Engineer at Snowflake).

InternEvo by InternLM

0.2%
420
Lightweight training framework for model pre-training
Created 2 years ago
Updated 10 months ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI).

rtp-llm by alibaba

1.1%
1k
LLM inference engine for diverse applications
Created 2 years ago
Updated 19 hours ago
Starred by Peter Norvig Peter Norvig(Author of "Artificial Intelligence: A Modern Approach"; Research Director at Google), Alexey Milovidov Alexey Milovidov(Cofounder of Clickhouse), and
29 more.

llm.c by karpathy

0.3%
31k
LLM training in pure C/CUDA, no PyTorch needed
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.