Repository of Intel® Neural Compressor
Project description
Intel® Neural Compressor
An open-source Python library supporting popular model compression techniques on all mainstream deep learning frameworks (TensorFlow, PyTorch, ONNX Runtime, and MXNet)
Architecture | Workflow | Results | Examples | Documentations
Intel® Neural Compressor aims to provide popular model compression techniques such as quantization, pruning (sparsity), distillation, and neural architecture search on mainstream frameworks such as TensorFlow, PyTorch, ONNX Runtime, and MXNet, as well as Intel extensions such as Intel Extension for TensorFlow and Intel Extension for PyTorch. In particular, the tool provides the key features, typical examples, and open collaborations as below:
-
Support a wide range of Intel hardware such as Intel Xeon Scalable processor, Intel Xeon CPU Max Series, Intel Data Center GPU Flex Series, and Intel Data Center GPU Max Series with extensive testing; support AMD CPU, ARM CPU, and NVidia GPU through ONNX Runtime with limited testing
-
Validate popular LLMs such as LLama2, LLama, MPT, Falcon, GPT-J, Bloom, OPT, and more than 10,000 broad models such as Stable Diffusion, BERT-Large, and ResNet50 from popular model hubs such as Hugging Face, Torch Vision, and ONNX Model Zoo, by leveraging zero-code optimization solution Neural Coder and automatic accuracy-driven quantization strategies
-
Collaborate with cloud marketplace such as Google Cloud Platform, Amazon Web Services, and Azure, software platforms such as Alibaba Cloud, Tencent TACO and Microsoft Olive, and open AI ecosystem such as Hugging Face, PyTorch, ONNX, ONNX Runtime, and Lightning AI
Installation
Install from pypi
pip install neural-compressor
More installation methods can be found at Installation Guide. Please check out our FAQ for more details.
Getting Started
Quantization with Python API
# Install Intel Neural Compressor and TensorFlow
pip install neural-compressor
pip install tensorflow
# Prepare fp32 model
wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v1_6/mobilenet_v1_1.0_224_frozen.pb
from neural_compressor.data import DataLoader, Datasets
from neural_compressor.config import PostTrainingQuantConfig
dataset = Datasets("tensorflow")["dummy"](shape=(1, 224, 224, 3))
dataloader = DataLoader(framework="tensorflow", dataset=dataset)
from neural_compressor.quantization import fit
q_model = fit(
model="./mobilenet_v1_1.0_224_frozen.pb",
conf=PostTrainingQuantConfig(),
calib_dataloader=dataloader,
)
Documentation
Overview | |||||||
---|---|---|---|---|---|---|---|
Architecture | Workflow | Examples | APIs | ||||
Python-based APIs | |||||||
Quantization | Advanced Mixed Precision | Pruning (Sparsity) | Distillation | ||||
Orchestration | Benchmarking | Distributed Compression | Model Export | ||||
Neural Coder (Zero-code Optimization) | |||||||
Launcher | JupyterLab Extension | Visual Studio Code Extension | Supported Matrix | ||||
Advanced Topics | |||||||
Adaptor | Strategy | Distillation for Quantization | SmoothQuant | ||||
Weight-Only Quantization (INT8/INT4/FP4/NF4) | |||||||
Innovations for Productivity | |||||||
Neural Insights | Neural Solution |
More documentations can be found at User Guide.
Selected Publications/Events
- arXiv: Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs (Sep 2023)
- Post on Social Media: ONNXCommunityMeetup2023: INT8 Quantization for Large Language Models with Intel Neural Compressor (July 2023)
- Blog by Intel: Accelerate Llama 2 with Intel AI Hardware and Software Optimizations (July 2023)
- NeurIPS'2022: Fast Distilbert on CPUs (Oct 2022)
- NeurIPS'2022: QuaLA-MiniLM: a Quantized Length Adaptive MiniLM (Oct 2022)
View Full Publication List.
Additional Content
Communication
- GitHub Issues: mainly for bugs report, new feature request, question asking, etc.
- Email: welcome to raise any interesting research ideas on model compression techniques by email for collaborations.
- WeChat group: scan the QA code to join the technical discussion.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file neural_insights-2.3.tar.gz
.
File metadata
- Download URL: neural_insights-2.3.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f642c2589cd379fbf34a4ebaab2bf3d29c83c87b0f2471a58f186bed92d914cf |
|
MD5 | ce40a1ff6eb73a28bf67409a903d4312 |
|
BLAKE2b-256 | 427b485c47e486349526adadd3b8085d2970050337a7457af70775ee5f78f9b0 |
File details
Details for the file neural_insights-2.3-py3-none-any.whl
.
File metadata
- Download URL: neural_insights-2.3-py3-none-any.whl
- Upload date:
- Size: 6.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d80ccbe96a082c47187b77c851665119c7007d9a199a8c18e4e02944a8c4df1a |
|
MD5 | 99e84f2639f7edf6e4c52214c9a0df85 |
|
BLAKE2b-256 | 9d07eca2be4a003c7a851ebb658335426cae91154803ed3b5faac8b40054b669 |