You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-11Lines changed: 60 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,43 @@
2
2
3
3
Fujitsu One Compression (OneComp) is a Python package for LLM compression.
4
4
5
+
<palign="center">
6
+
<imgsrc="docs/assets/onecomp.gif"alt="OneComp" />
7
+
</p>
8
+
9
+
## ⚡ Just one line.
10
+
11
+
```bash
12
+
onecomp <generative AI>
13
+
```
14
+
15
+
**That's all you need.** OneComp detects your GPU VRAM, picks the best bit-width per layer, quantizes with error propagation, evaluates, and saves — fully automatic.
Full documentation is available at **[https://FujitsuResearch.github.io/OneCompression/](https://FujitsuResearch.github.io/OneCompression/)**.
8
33
9
34
## 📦 Features
10
35
11
36
-**Quantization Error Propagation (QEP)**: A post-training quantization method that corrects quantization errors by propagating them to subsequent layers, improving the accuracy of quantized LLMs. See [Arai & Ichikawa, NeurIPS 2025](https://openreview.net/forum?id=a3l3K9khbL) for details. The original reference implementation is available at [FujitsuResearch/qep](https://github.com/FujitsuResearch/qep).
12
-
-**vLLM Plugin Integration**: Serve OneComp-quantized models with [vLLM](https://docs.vllm.ai/) via built-in plugins for DBF and Mixed-GPTQ quantization methods.
37
+
-**Layer-Projected Coordinate Descent (LPCD)**: A unified Post Training Quantization (PTQ) framework that extends layer-wise quantization to arbitrary submodules by optimising relaxed objectives and projecting the solutions with layer-wise quantizers. See [Ichikawa et al., 2025](https://arxiv.org/abs/2512.01546) for details.
38
+
-**vLLM Plugin Integration**: Serve OneComp-quantized models with [vLLM](https://docs.vllm.ai/) via built-in plugins for DBF and Mixed-GPTQ quantization methods. Pair with [Open WebUI](https://github.com/open-webui/open-webui) for a ChatGPT-like chat experience on your local machine.
13
39
-**AutoBit**: Mixed-precision quantization with ILP-based bitwidth assignment. Automatically estimates the target bitwidth from available VRAM and assigns per-layer bitwidths to minimize quantization error under the memory budget.
14
40
-**JointQ**: Joint quantization method that optimizes weight assignments and scale parameters simultaneously for improved quantization accuracy. Supports group-wise quantization (e.g., 4-bit, groupsize=128).
41
+
-**Block-wise PTQ**: Post-quantization block-wise distillation that minimises intermediate-representation MSE against an FP16 teacher model at Transformer-block granularity. Includes Phase 1 (greedy per-block optimisation) and Phase 2 CBQ (cross-block sliding-window optimisation). Supports GPTQ, DBF, and OneBit quantizers.
15
42
-**LoRA SFT Post-Process**: Fine-tune quantized models with LoRA adapters for accuracy recovery or domain-specific knowledge injection. Supports SFT loss, teacher distillation, and intermediate block alignment.
16
43
-**Rotation Preprocessing**: SpinQuant/OstQuant-based rotation preprocessing that reduces quantization error by learning optimal rotation matrices before quantization. Rotation/scaling matrices are absorbed into model weights, with online Hadamard hooks automatically registered at load time. Supports Llama and Qwen3 architectures.
17
44
- (TBD)
@@ -25,6 +52,8 @@ Other Hugging Face-compatible models may work but are currently untested.
The `uv sync` command creates a Python virtual environment and installs all dependent libraries.
98
128
99
129
The `--extra cu128` option installs the CUDA-enabled version of PyTorch (along with `torchvision` from the same CUDA index).
100
-
Replace `cu128` with the appropriate variant for your environment: `cpu`, `cu118`, `cu121`, `cu124`, `cu126`, or `cu128`.
130
+
Replace `cu128` with the appropriate variant for your environment: `cpu`, `cu118`, `cu121`, `cu124`, `cu126`, `cu128`, or `cu130`.
101
131
PyTorch will be automatically downloaded by `uv`, so you do not need to install it beforehand.
102
132
103
133
Adding `--extra dev` installs development tools (black, pytest, pylint).
104
134
Adding `--extra visualize` installs matplotlib for visualization features.
135
+
Adding `--extra hydra` installs `hydra-core` for the example scripts and `model_validation/` runners that use Hydra-based configuration.
105
136
106
-
To use vLLM for serving quantized models, add `--extra vllm`:
137
+
To use vLLM for serving quantized models, add `--extra vllm` together with `--extra cu130`:
107
138
108
139
```bash
109
-
uv sync --extra cu128 --extra dev --extra visualize --extra vllm
140
+
uv sync --extra cu130 --extra dev --extra visualize --extra vllm
110
141
```
111
142
143
+
> **Note:**`--extra vllm` is only compatible with `--extra cu130`. Recent vLLM releases require `torch>=2.10`, whose wheels are only published for the `cu130` index. Combining `--extra vllm` with `cpu` / `cu118` / `cu121` / `cu124` / `cu126` / `cu128` is rejected by `uv` at lock time.
144
+
112
145
> **Note:**`--extra vllm` may take a long time on the first run if a pre-built `xformers` wheel is not available for your Python/CUDA combination (e.g. Python 3.13). Using Python 3.12 typically avoids this.
113
146
114
147
#### Running commands (uv environment)
@@ -119,7 +152,7 @@ In the environment created by `uv sync`, you can run commands in two ways:
||[example_autobit_vllm_inference.py](./example/vllm_inference/example_autobit_vllm_inference.py)| AutoBit quantization and vLLM inference |
175
211
176
212
## 🔌 vLLM Inference
177
213
178
214
OneComp-quantized models can be served with [vLLM](https://docs.vllm.ai/) via built-in plugins (DBF, Mixed-GPTQ).
215
+
Combined with [Open WebUI](https://github.com/open-webui/open-webui), you can chat with your quantized model through a ChatGPT-like browser interface — entirely on your local machine.
179
216
180
217
```bash
181
-
# uv users
182
-
uv sync --extra cu128 --extra vllm
218
+
# uv users (vLLM requires cu130; see Installation for details)
219
+
uv sync --extra cu130 --extra vllm
183
220
184
221
# pip users
185
222
pip install vllm
186
223
```
187
224
188
-
See the [vLLM Inference guide](https://FujitsuResearch.github.io/OneCompression/user-guide/vllm-inference/) for details.
225
+
See the [vLLM Inference guide](https://FujitsuResearch.github.io/OneCompression/user-guide/vllm-inference/) for details, including Open WebUI setup instructions.
189
226
190
227
191
228
## 📄 License
@@ -220,3 +257,15 @@ year={2025},
220
257
url={https://openreview.net/forum?id=a3l3K9khbL}
221
258
}
222
259
```
260
+
261
+
LPCD (Layer-Projected Coordinate Descent):
262
+
263
+
```
264
+
@article{ichikawa2025lpcd,
265
+
title={LPCD: Unified Framework from Layer-Wise to Submodule Quantization},
266
+
author={Yuma Ichikawa and Yudai Fujimoto and Akira Sakai},
0 commit comments