Skip to content
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tools/llm_weight_compression/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# LLM Weight Compression Tool

## Install

```bash
python3.10 -m venv env
. env/bin/activate
pip install --upgrade pip

pip install openvino==2025.0.0
pip install nncf==2.15.0
pip install "git+https://github.com/huggingface/[email protected]"
pip install "git+https://github.com/huggingface/[email protected]"
pip install "git+https://github.com/EleutherAI/[email protected]"

# #whowhatbench
git clone --depth 1 --branch 2025.0.0.0 https://github.com/openvinotoolkit/openvino.genai.git

cd openvino.genai/tools/who_what_benchmark
pip install .
```

```bash
# For test
python run.py \
--model-id facebook/opt-125m \
--config config_optimum_cli.json \
--root-dir experiment_dir \
--dump-packages
```
23 changes: 23 additions & 0 deletions tools/llm_weight_compression/config_optimum_lm_eval.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about splitting compression and evaluation configs into separate files?

"compression": {
"backend": "optimum_cli",
"params": [
{
"task": ["text-generation"],
"weight_format": ["int4"],
"ratio": [0.2, 0.4],
"group_size": [64, 128],
"awq": [false, true],
"dataset": ["auto"]
}
]
},
"evaluation": {
"backend": "lm_eval",
"params": {
"tasks": ["wikitext"],
"device": "cpu",
"limit": 3
}
}
}
23 changes: 23 additions & 0 deletions tools/llm_weight_compression/config_optimum_wwb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compression": {
"backend": "optimum_cli",
"params": [
{
"task": ["text-generation"],
"weight_format": ["int4"],
"ratio": [0.2],
"group_size": [64],
"awq": [false],
"dataset": ["auto"]
}
]
},
"evaluation": {
"backend": "who_what_benchmark",
"params": {
"model_type": "text",
"device": "CPU",
"language": "en"
}
}
}
1 change: 1 addition & 0 deletions tools/llm_weight_compression/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
Loading
Loading