Skip to content

Commit daedd19

Browse files
committed
Merge realease/v1.1.0 into develop: translations, Dockerfile, benchmark section, changelog
Made-with: Cursor
2 parents a1e3d27 + d6f3e60 commit daedd19

10 files changed

Lines changed: 314 additions & 247 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ All notable changes to RabbitLLM are documented here.
9292
- **`samples/`** directory with sample text for long-context testing.
9393
- **Test suite**: `tests/test_kvcache.py`, `tests/test_kvikio_loader.py`, `tests/test_profiler.py`,
9494
`tests/test_base_model.py`, and 6 additional test modules.
95+
- **Dockerfile** for easier deployment: build from repo with `docker build -t rabbitllm .`, run with `--gpus all` for GPU inference. Installs RabbitLLM with optional `[gds]` extra. README Docker subsection documents build, run, and env vars (`HF_TOKEN`, `HF_HOME`). Makefile targets `docker-build` and `docker-run`.
96+
- **Benchmark section** in README: table of benchmark scripts (GDS/long-context, CPU vs CUDA, attention comparison) and link to [docs/BENCHMARK_HISTORY.md](docs/BENCHMARK_HISTORY.md) for detailed 72B results.
9597

9698
### Changed
9799
- **Pipeline extracted to `engine/pipeline.py`**: three strategies — `_no_prefetch_pipeline`,
@@ -106,6 +108,7 @@ All notable changes to RabbitLLM are documented here.
106108
summary line (e.g. `[offload_small_layers=True, prefetch_pin_memory=False]`).
107109
- README documents `use_gds`, `kv_cache_dir`, `offload_small_layers`, `cache_layers`, and
108110
the optional `[gds]` extra.
111+
- **Documentation and in-repo text translated to English**: `docs/TRANSFORMERS_UPGRADE_PLAN.md`, `docs/BENCHMARK_HISTORY.md`, `docs/COMPATIBILITY.md`, `docs/TROUBLESHOOTING.md`, and `example.py` (docstring and comments).
109112

110113
### Fixed
111114
- **RoPE decode correctness**: prefill `position_embeddings_cache` is no longer reused in decode

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# RabbitLLM — layer-streaming inference for 70B+ LLMs on consumer GPUs
2+
# Build: docker build -t rabbitllm .
3+
# Run (GPU): docker run --gpus all -it rabbitllm python scripts/inference_example.py --model Qwen/Qwen2.5-0.5B-Instruct
4+
# Run (help): docker run --rm rabbitllm
5+
6+
FROM python:3.12-slim
7+
8+
WORKDIR /app
9+
10+
# Install RabbitLLM from the build context with optional GDS (GPU Direct Storage) support.
11+
# For Flash Attention, use a image with CUDA and install rabbitllm[flash] separately.
12+
COPY pyproject.toml README.md ./
13+
COPY src/ src/
14+
COPY scripts/ scripts/
15+
COPY example.py ./
16+
17+
RUN pip install --no-cache-dir -e ".[gds]"
18+
19+
# Default: show inference script help (override with full command)
20+
CMD ["python", "scripts/inference_example.py", "--help"]

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: install dev lint format test test-cov typecheck clean bash
1+
.PHONY: install dev lint format test test-cov typecheck clean bash docker-build docker-run
22

33
install:
44
uv sync --extra gds
@@ -23,5 +23,11 @@ typecheck:
2323
clean:
2424
rm -rf build/ dist/ *.egg-info .pytest_cache .ruff_cache .mypy_cache htmlcov/ .coverage .coverage.*
2525

26+
docker-build:
27+
docker build -t rabbitllm .
28+
29+
docker-run:
30+
docker run --gpus all --rm -it rabbitllm python scripts/inference_example.py --help
31+
2632
bash:
2733
docker run --gpus all --rm -it -v $(PWD):/app -w /app python:3.12 bash

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ pip install rabbitllm[flash]
4444
If the prebuilt wheel is unavailable for your setup, install from
4545
[flashattn.dev](https://flashattn.dev). Without it, SDPA is used automatically.
4646

47+
### Docker
48+
49+
Build and run with GPU support (requires [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install.html) on the host):
50+
51+
```bash
52+
docker build -t rabbitllm .
53+
docker run --gpus all -it rabbitllm python scripts/inference_example.py --model Qwen/Qwen2.5-0.5B-Instruct --max-new-tokens 20
54+
```
55+
56+
Optional env vars: `HF_TOKEN` for gated models, `HF_HOME` for model cache directory. Example:
57+
58+
```bash
59+
docker run --gpus all -e HF_TOKEN=hf_... -it rabbitllm python scripts/inference_example.py --model Qwen/Qwen2.5-7B-Instruct
60+
```
61+
4762
## Quickstart
4863

4964
```python
@@ -172,9 +187,17 @@ For 50k+ token contexts, pass `kv_cache_dir` to offload KV cache to SSD:
172187
model = AutoModel.from_pretrained("Qwen/Qwen2.5-72B-Instruct", kv_cache_dir="./kv_cache")
173188
```
174189

175-
### Benchmarking improvements
190+
### Benchmark
191+
192+
Scripts to measure throughput and compare configurations:
176193

177-
To measure GDS and DiskKVCache improvements:
194+
| Script | What it measures |
195+
|--------|------------------|
196+
| `scripts/benchmark_improvements.py` | GDS (GPU Direct Storage) and long-context DiskKVCache improvements |
197+
| `scripts/benchmark_cpu_vs_cuda.py` | CPU vs CUDA inference with layer-streaming (same model and prompt) |
198+
| `scripts/check_attention_and_benchmark.py --benchmark` | Throughput comparison: auto vs SDPA vs eager attention |
199+
200+
**GDS and DiskKVCache:**
178201

179202
```bash
180203
# Local: make install pulls in kvikio (--extra gds)
@@ -187,6 +210,21 @@ pip install -e ".[gds]"
187210
python scripts/benchmark_improvements.py --mode gds
188211
```
189212

213+
**Quick CPU vs CUDA comparison:**
214+
215+
```bash
216+
uv run python scripts/benchmark_cpu_vs_cuda.py
217+
uv run python scripts/benchmark_cpu_vs_cuda.py --model Qwen/Qwen2.5-1.5B-Instruct --runs 3
218+
```
219+
220+
**Attention implementation (auto vs SDPA vs eager):**
221+
222+
```bash
223+
uv run python scripts/check_attention_and_benchmark.py --benchmark
224+
```
225+
226+
Detailed results and per-step breakdown for Qwen2.5-72B (e.g. pin_memory, async, 4-bit) are in [docs/BENCHMARK_HISTORY.md](docs/BENCHMARK_HISTORY.md).
227+
190228
### Gated models
191229

192230
Pass a HuggingFace token for repos that require access approval:

0 commit comments

Comments
 (0)