Downloads ยท 30 days
19
1% of all-time downloads
AhtnaGlen/phi-4-mini-instruct-int4-sym-npu-ov
phi-4-mini-instruct-int4-sym-npu-ov is a text generation model from AhtnaGlen. Use it when you need the model to write or continue text. The card lists the license as mit.
๐ First NPU-optimized Phi-4-mini model with correct quantization for Intel NPU!
Downloads ยท 30 days
19
1% of all-time downloads
All-time downloads
3.6K
Public
Repo size
2.3 GB
Likes
0
Public
Click a slice to open those files.
.bin2.2 GB ยท 99%
From the Hugging Face model README
๐ First NPU-optimized Phi-4-mini model with correct quantization for Intel NPU!
This is microsoft/Phi-4-mini-instruct (2.6B parameters) converted to OpenVINO IR format with NPU-specific INT4 symmetric quantization.
Critical Discovery: Intel NPU requires INT4_SYM (symmetric, channel-wise) quantization, not the INT4_ASYM (asymmetric, grouped) used by standard OpenVINO pre-converted models.
| Quantization Type | NPU Compatibility |
|---|---|
| INT4_ASYM (group_size=64) | โ FAILS (MatMul errors) |
| INT4_SYM (channel-wise) | โ WORKS (this model) |
Tested on Intel Core Ultra 7 155H (NPU driver v32.0.100.4297):
Comparison to other models on same hardware (Intel Core Ultra 7 155H):
pip install openvino-genai huggingface-hub
from openvino_genai import LLMPipeline
# Load and run on Intel NPU
pipe = LLMPipeline("AhtnaGlen/phi-4-mini-instruct-int4-sym-npu-ov", device="NPU")
# Generate text
response = pipe.generate("Explain quantum computing:", max_new_tokens=100)
print(response)
for token in pipe.generate("Write a story:", max_new_tokens=200, stream=True):
print(token, end='', flush=True)
Standard OpenVINO Phi-4 models (e.g., OpenVINO/Phi-4-mini-instruct-int4-ov) use INT4_ASYM quantization which fails NPU compilation with errors like:
[ERROR] Channels count of input tensor shape and filter shape must be the same: 0 != 48
This model uses the correct NPU-optimized quantization as specified in Intel's NPU documentation:
optimum-cli export openvino -m microsoft/Phi-4-mini-instruct \
--weight-format int4 \
--sym \ # Symmetric (key for NPU!)
--group-size -1 \ # Channel-wise (not grouped!)
--awq --scale-estimation \
--dataset wikitext2
If you use this model, please cite:
@misc{phi4-mini-npu-optimized,
title={Phi-4-mini-instruct INT4_SYM for Intel NPU},
author={OpenVINO Community},
year={2025},
howpublished={\url{https://huggingface.co/AhtnaGlen/phi-4-mini-instruct-int4-sym-npu-ov}},
}
MIT (following base model license)
For issues or questions about NPU compatibility, please open an issue on the model repository.
Note: This model demonstrates the importance of quantization method selection for hardware-specific optimization. Always verify quantization parameters match target hardware requirements!