Model Compression & Acceleration Module for sageLLM
Project description
sagellm-compression
Model Compression & Acceleration Module for sageLLM inference engine.
Overview
This package provides model compression and acceleration techniques for LLM inference:
- Quantization (Task3.1)
- Sparsity (Task3.2)
- Speculative decoding (Task3.3)
- Kernel fusion (Task3.4)
- CoT acceleration (Task3.5)
Installation
# 从 PyPI 安装(自动安装依赖)
pip install isagellm-compression
🚀 开发者快速开始
git clone git@github.com:intellistream/sagellm-compression.git
cd sagellm-compression
./quickstart.sh # 一键安装开发环境(含依赖)
# 或手动安装
pip install -e ".[dev]"
运行测试:
pytest tests/ -v
💡
isagellm-protocol和isagellm-backend会自动从 PyPI 安装。
Quick Start
from sagellm_compression import QuantizationConfig, apply_quantization
# Apply INT8 quantization
config = QuantizationConfig(
method="int8",
per_channel=True
)
quantized_model = apply_quantization(model, config)
Team Assignment
- Task3.1 Quantization: 项翔老师团队
- Task3.2 Sparsity: 万瑶老师团队
- Task3.3 Speculative Decoding: 张书豪老师团队
- Task3.4 Kernel Fusion: 王雄老师团队
- Task3.5 CoT Acceleration: 张书豪老师团队
Supported Techniques
Quantization
- INT8/INT4 weight quantization
- Per-channel/per-tensor quantization
- Dynamic activation quantization
Sparsity
- Structured pruning
- Unstructured pruning
- N:M sparsity
Acceleration
- Speculative decoding with draft models
- Kernel fusion (Flash Attention, etc.)
- Chain-of-Thought acceleration
Dependencies
isagellm-protocol>=0.1.0- Protocol definitionsisagellm-backend>=0.1.0- Backend abstraction
Development
Quick Setup
# Install pre-commit hooks
pip install pre-commit
pre-commit install
# Run pre-commit manually
pre-commit run --all-files
Testing & Quality
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Format & lint (via pre-commit)
pre-commit run --all-files
# Or manually
ruff format .
ruff check .
mypy src/
Pre-commit Hooks
This project uses pre-commit hooks to ensure code quality:
- ruff: Linting and auto-fixing
- ruff-format: Code formatting
- mypy: Type checking
- Standard checks (trailing whitespace, YAML/TOML validation, etc.)
All code is automatically formatted on commit. To skip hooks temporarily:
git commit --no-verify
License
Private - IntelliStream Research Project
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file isagellm_compression-0.1.0-cp311-none-any.whl.
File metadata
- Download URL: isagellm_compression-0.1.0-cp311-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c72d468b530478a5141cf7908ad3ac58c5f747c6d237648e1c456fe398a6b266
|
|
| MD5 |
8864d6a17ea2d877a1ab8c63fb39d62b
|
|
| BLAKE2b-256 |
7eadd079725e6487f3fa5a001800d996b1e9b7accafa9f69a6439d805f51154f
|