Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[microsoft/Phi-4-mini-instruct](https://huggingface.co/microsoft/Phi-4-mini-instruct) converted to OpenVINO with asymmetric INT4 weight compression, for inference with OpenVINO on CPU and Intel GPU.
|
| 2 |
+
|
| 3 |
+
Quick start with OpenVINO GenAI:
|
| 4 |
+
|
| 5 |
+
```
|
| 6 |
+
pip install huggingface-hub[cli]
|
| 7 |
+
pip install --pre -U openvino openvino-tokenizers openvino-genai --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
|
| 8 |
+
curl -O https://raw.githubusercontent.com/helena-intel/snippets/refs/heads/main/llm_chat/python/llm_chat_manual.py
|
| 9 |
+
huggingface-cli download helenai/Phi-4-mini-instruct-ov-asym --local-dir Phi-4-mini-instruct-ov-asym
|
| 10 |
+
python llm_chat_manual.py Phi-4-mini-instruct-ov-asym CPU
|
| 11 |
+
```
|
| 12 |
+
|
| 13 |
+
In the last line, change CPU to GPU to run on Intel GPU.
|
| 14 |
+
|
| 15 |
+
Model export command:
|
| 16 |
+
|
| 17 |
+
```
|
| 18 |
+
pip install optimum-intel[openvino]@git+https://github.com/huggingface/optimum-intel.git
|
| 19 |
+
pip install --pre -U openvino openvino-tokenizers --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
|
| 20 |
+
optimum-cli export openvino -m microsoft/Phi-4-mini-instruct --weight-format int4 phi-4-mini-instruct-ov-asym
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
Model export versions and parameters:
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
openvino_version : 2025.3.0-19419-3932807324e
|
| 27 |
+
nncf_version : 2.17.0
|
| 28 |
+
optimum_intel_version : 1.25.0.dev0+8f127ce
|
| 29 |
+
optimum_version : 1.26.1
|
| 30 |
+
pytorch_version : 2.6.0
|
| 31 |
+
transformers_version : 4.51.3
|
| 32 |
+
|
| 33 |
+
advanced_parameters : {'statistics_path': None, 'awq_params': {'subset_size': 32, 'percent_to_apply': 0.002, 'alpha_min': 0.0, 'alpha_max': 1.0, 'steps': 100, 'prefer_data_aware_scaling': True}, 'scale_estimation_params': {'subset_size': 64, 'initial_steps': 5, 'scale_steps': 5, 'weight_penalty': -1.0}, 'gptq_params': {'damp_percent': 0.1, 'block_size': 128, 'subset_size': 128}, 'lora_correction_params': {'adapter_rank': 8, 'num_iterations': 3, 'apply_regularization': True, 'subset_size': 128, 'use_int8_adapters': True}, 'lora_adapter_rank': 256, 'backend_params': {}}
|
| 34 |
+
all_layers : False
|
| 35 |
+
awq : True
|
| 36 |
+
backup_mode : int8_asym
|
| 37 |
+
compression_format : dequantize
|
| 38 |
+
gptq : False
|
| 39 |
+
group_size : 64
|
| 40 |
+
ignored_scope : []
|
| 41 |
+
lora_correction : False
|
| 42 |
+
mode : int4_asym
|
| 43 |
+
ratio : 1.0
|
| 44 |
+
scale_estimation : True
|
| 45 |
+
sensitivity_metric : max_activation_variance
|
| 46 |
+
```
|