Skip to content

Commit 5ba42ad

Browse files
Merge branch 'main' into awq-smooth-layer-quantization
2 parents a1c5b96 + 464d000 commit 5ba42ad

File tree

119 files changed

+6260
-2328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+6260
-2328
lines changed

.github/mergify.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ pull_request_rules:
4747
- files~=^[^/]+\.md$
4848
- files~=^docs/
4949
- files~=^examples/
50+
- -files~=^src/
51+
- -files~=^tests/
52+
- -files~=^\.github/
53+
- -files~=^Makefile$
54+
- -files~=^pyproject\.toml$
5055
actions:
5156
label:
5257
add:

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ venv.bak/
128128
/site
129129
docs/.cache/*
130130

131+
# zensical docs build (generated by pre-build scripts)
132+
docs/api/llmcompressor/
133+
docs/examples/
134+
docs/experimental/
135+
docs/developer/code-of-conduct.md
136+
docs/developer/contributing.md
137+
131138
# mypy
132139
.mypy_cache/
133140
### Example user template template

.readthedocs.yaml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
# Read the Docs configuration file
2-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3-
4-
# Required
51
version: 2
62

7-
# Set the OS, Python version, and other tools you might need
83
build:
94
os: ubuntu-24.04
105
tools:
116
python: "3.12"
12-
13-
# Build documentation with Mkdocs
14-
mkdocs:
15-
configuration: mkdocs.yml
16-
17-
python:
18-
install:
19-
- method: pip
20-
path: .
21-
extra_requirements:
22-
- dev
7+
jobs:
8+
install:
9+
- pip install -e ".[dev]"
10+
build:
11+
html:
12+
- python docs/scripts/zensical_gen_files.py
13+
- zensical build
14+
post_build:
15+
- mkdir -p $READTHEDOCS_OUTPUT/html/
16+
- cp --recursive site/* $READTHEDOCS_OUTPUT/html/

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ Big updates have landed in LLM Compressor! To get a more in-depth look, check ou
3737

3838
Some of the exciting new features include:
3939

40+
* **Qwen3.5 Support**: Qwen 3.5 can now be quantized using LLM Compressor. You will need to update your local transformers version using `uv pip install --upgrade transformers` and install LLM Compressor from source if using `<0.11`. Once updated, you should be able to run examples for the [MoE](examples/quantization_w4a4_fp4/qwen3_5_example.py) and [non-MoE](examples/quantization_w4a4_fp4/qwen3_5_example.py) variants of Qwen 3.5 end-to-end. For models quantized and published by the RedHat team, consider using the [NVFP4](https://huggingface.co/RedHatAI/Qwen3.5-122B-A10B-NVFP4) and FP8 checkpoints for [Qwen3.5-122B](https://huggingface.co/RedHatAI/Qwen3.5-122B-A10B-FP8-dynamic) and [Qwen3.5-397B](https://huggingface.co/RedHatAI/Qwen3.5-397B-A17B-FP8-dynamic).
4041
* **Updated offloading and model loading support**: Loading transformers models that are offloaded to disk and/or offloaded across distributed process ranks is now supported. Disk offloading allows users to load and compress very large models which normally would not fit in CPU memory. Offloading functionality is no longer supported through accelerate but through model loading utilities added to compressed-tensors. For a full summary of updated loading and offloading functionality, for both single-process and distributed flows, see the [Big Models and Distributed Support guide](docs/guides/big_models_and_distributed/model_loading.md).
4142
* **Distributed GPTQ Support**: GPTQ now supports Distributed Data Parallel (DDP) functionality to significantly improve calibration runtime. An example using DDP with GPTQ can be found [here](examples/quantization_w4a16/llama3_ddp_example.py).
4243
* **Updated FP4 Microscale Support**: GPTQ now supports FP4 quantization schemes, including both [MXFP4](examples/quantization_w4a16_fp4/mxfp4/llama3_example.py) and [NVFP4](examples/quantization_w4a4_fp4/llama3_gptq_example.py). MXFP4 support has also been improved with updated weight scale generation. Models with weight-only quantization in the MXFP4 format can now run in vLLM as of vLLM v0.14.0. MXFP4 models with activation quantization are not yet supported in vLLM for compressed-tensors models
4344
* **New Model-Free PTQ Pathway**: A new model-free PTQ pathway has been added to LLM Compressor, called [`model_free_ptq`](src/llmcompressor/entrypoints/model_free/__init__.py#L36). This pathway allows you to quantize your model without the requirement of Hugging Face model definition and is especially useful in cases where `oneshot` may fail. This pathway is currently supported for data-free pathways only i.e FP8 quantization and was leveraged to quantize the [Mistral Large 3 model](https://huggingface.co/mistralai/Mistral-Large-3-675B-Instruct-2512). Additional [examples](examples/model_free_ptq) have been added illustrating how LLM Compressor can be used for Kimi K2
45+
* **MXFP8 Microscale Support (Experimental)**: LLM Compressor now supports MXFP8 quantization via PTQ. Both W8A8 ([MXFP8](experimental/mxfp8/qwen3_example_w8a8_mxfp8.py)) and W8A16 weight-only ([MXFP8A16](experimental/mxfp8/qwen3_example_w8a16_mxfp8.py)) modes are available.
4446
* **Extended KV Cache and Attention Quantization Support**: LLM Compressor now supports attention quantization. KV Cache quantization, which previously only supported per-tensor scales, has been extended to support any quantization scheme including a new `per-head` quantization scheme. Support for these checkpoints is on-going in vLLM and scripts to get started have been added to the [experimental folder](experimental/attention)
4547

4648

4749
### Supported Formats
48-
* Activation Quantization: W8A8 (int8 and fp8)
49-
* Mixed Precision: W4A16, W8A16, NVFP4 (W4A4 and W4A16 support)
50-
* 2:4 Semi-structured and Unstructured Sparsity
50+
* Activation Quantization: W8A8 (int8 and fp8), MXFP8 (experimental)
51+
* Mixed Precision: W4A16, W8A16, MXFP8A16 (experimental), NVFP4 (W4A4 and W4A16 support)
5152

5253
### Supported Algorithms
5354
* Simple PTQ
5455
* GPTQ
5556
* AWQ
5657
* SmoothQuant
57-
* SparseGPT
5858
* AutoRound
5959

6060
### When to Use Which Optimization
@@ -75,6 +75,8 @@ pip install llmcompressor
7575
Applying quantization with `llmcompressor`:
7676
* [Activation quantization to `int8`](examples/quantization_w8a8_int8/README.md)
7777
* [Activation quantization to `fp8`](examples/quantization_w8a8_fp8/README.md)
78+
* [Activation quantization to MXFP8 (experimental)](experimental/mxfp8/qwen3_example_w8a8_mxfp8.py)
79+
* [Weight-only quantization to MXFP8A16 (experimental)](experimental/mxfp8/qwen3_example_w8a16_mxfp8.py)
7880
* [Activation quantization to `fp4`](examples/quantization_w4a4_fp4/llama3_example.py)
7981
* [Activation quantization to `fp4` using AutoRound](examples/autoround/quantization_w4a4_fp4/README.md)
8082
* [Activation quantization to `fp8` and weight quantization to `int4`](examples/quantization_w4a8_fp8/)
@@ -183,3 +185,7 @@ If you find LLM Compressor useful in your research or projects, please consider
183185
url={https://github.com/vllm-project/llm-compressor},
184186
}
185187
```
188+
189+
190+
!!! warning
191+
Sparse compression (24 sparsity) is no longer supported by LLM Compressor due lack of hardware support and usage

docs/.nav.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
nav:
22
- Home: index.md
33
- Why use LLM Compressor?: steps/why-llmcompressor.md
4-
- Compresssing your model, step-by-step:
4+
- Compressing your model, step-by-step:
55
- Choosing your model: steps/choosing-model.md
66
- Choosing the right compression scheme: steps/choosing-scheme.md
77
- Choosing the right compression algorithm: steps/choosing-algo.md
@@ -19,19 +19,23 @@ nav:
1919
- Qwen3:
2020
- key-models/qwen3/index.md
2121
- FP8 Example: key-models/qwen3/fp8-example.md
22+
- Qwen3.5:
23+
- key-models/qwen3.5/index.md
24+
- NVFP4A16 VL Example: key-models/qwen3.5/nvfp4-vl-example.md
25+
- NVFP4 MoE Example: key-models/qwen3.5/nvfp4-moe-example.md
2226
- Kimi-K2:
2327
- key-models/kimi-k2/index.md
2428
- FP8 Example: key-models/kimi-k2/fp8-example.md
2529
- Mistral Large 3:
2630
- key-models/mistral-large-3/index.md
2731
- FP8 Example: key-models/mistral-large-3/fp8-example.md
28-
- Guides:
32+
- User Guides:
2933
- Big Models and Distributed Support:
3034
- Model Loading: guides/big_models_and_distributed/model_loading.md
3135
- Sequential Onloading: guides/big_models_and_distributed/sequential_onloading.md
3236
- Distributed Oneshot: guides/big_models_and_distributed/distributed_oneshot.md
3337
- Compression Schemes: guides/compression_schemes.md
34-
- Saving a Model: guides/saving_a_model.md
38+
- Saving a Compressed Model: guides/saving_a_model.md
3539
- Observers: guides/observers.md
3640
- Memory Requirements: guides/memory.md
3741
- Runtime Performance: guides/runtime.md

docs/DEVELOPMENT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Getting started with LLM Compressor docs
2+
3+
```bash
4+
cd docs
5+
```
6+
7+
- Install the dependencies:
8+
9+
```bash
10+
make install
11+
```
12+
13+
- Clean the previous build (optional but recommended):
14+
15+
```bash
16+
make clean
17+
```
18+
19+
- Generate docs content (files, API references, and navigation):
20+
21+
```bash
22+
make gen
23+
```
24+
25+
- Serve the docs locally (runs `gen` automatically):
26+
27+
```bash
28+
make serve
29+
```
30+
31+
This will start a local server. You can now open your browser and view the documentation.
32+
33+
- Build the static site (runs `gen` automatically):
34+
35+
```bash
36+
make build
37+
```
38+
39+
- List all available targets:
40+
41+
```bash
42+
make help
43+
```

docs/Makefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
# Minimal mkdocs makefile
1+
# Minimal zensical makefile
22

3-
PYTHON := python3
4-
MKDOCS_CMD := mkdocs
5-
MKDOCS_CONF := ../mkdocs.yml
3+
ZENSICAL_CMD := zensical
4+
ZENSICAL_CONF := ../zensical.toml
65

7-
.PHONY: help install serve build clean
6+
.PHONY: help install gen serve build clean
87

98
help:
109
@echo "Available targets:"
1110
@echo " install Install dependencies globally"
11+
@echo " gen Generate docs content (files + API + nav)"
1212
@echo " serve Serve docs locally"
1313
@echo " build Build static site"
1414
@echo " clean Remove build artifacts"
1515

1616
install:
1717
pip install -e "../[dev]"
1818

19-
serve:
20-
$(MKDOCS_CMD) serve --livereload -f $(MKDOCS_CONF)
19+
gen:
20+
cd .. && python docs/scripts/zensical_gen_files.py
2121

22-
build:
23-
$(MKDOCS_CMD) build -f $(MKDOCS_CONF)
22+
serve: gen
23+
cd .. && $(ZENSICAL_CMD) serve
24+
25+
build: gen
26+
cd .. && $(ZENSICAL_CMD) build
2427

2528
clean:
26-
rm -rf site/ .cache/
29+
rm -rf site/ .cache/ api/llmcompressor/
30+
rm -rf examples/ experimental/
31+
rm -f developer/code-of-conduct.md developer/contributing.md
32+
cd .. && python3 docs/scripts/zensical_gen_files.py --clean

docs/README.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/guides/compression_schemes.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ A full list of supported schemes can be found [here](https://github.com/vllm-pro
88
- [W8A8-INT8](#int8_w8a8)
99
- [W4A16 and W8A16](#w4a16-and-w8a16)
1010
- [NVFP4](#nvfp4)
11-
- [2:4 Semi-structured Sparsity](#semi-structured)
12-
- [Unstructured Sparsity](#unstructured)
1311

1412
## PTQ Compression Schemes
1513

@@ -63,27 +61,5 @@ A full list of supported schemes can be found [here](https://github.com/vllm-pro
6361
| Calibration | Requires a calibration dataset to calibrate activation global scales |
6462
| Use case | Supported on all NVIDIA Blackwell GPUs or later
6563

66-
## Sparsification Compression Schemes
67-
68-
Sparsification reduces model complexity by pruning selected weight values to zero while retaining essential weights in a subset of parameters. Supported formats include:
69-
70-
71-
### Semi-Structured
72-
| Feature | Description |
73-
|---------------|----------------------------------------------------------------------------------------------|
74-
| 2:4 Semi-structured Sparsity | Uses semi-structured sparsity (SparseGPT), where 2 of every 4 contiguous weights are set to zero. |
75-
| Weights | 2:4 sparsity |
76-
| Activations | N/A |
77-
| Calibration | Requires a calibration dataset |
78-
| Use case | Fine-grained sparsity for compression and speedups |
79-
80-
81-
82-
### Unstructured
83-
| Feature | Description |
84-
|---------------|----------------------------------------------------------------------------------------------|
85-
| Unstructured Sparsity | Zeros out individual weights without a regular pattern, removing weights wherever they contribute least. Produces a fine-grained sparse matrix. |
86-
| Weights | Sparsified individually (no structure) |
87-
| Activations | N/A |
88-
| Calibration | Does not require a calibration dataset |
89-
| Use case | Fine-grained sparsity for compression and speedups |
64+
!!! warning
65+
Sparse compression (including 2of4 sparsity) is no longer supported by LLM Compressor due lack of hardware support and user interest. Please see https://github.com/vllm-project/vllm/pull/36799 for more information.

0 commit comments

Comments
 (0)