Skip to content
المشاريع

onnx/neural-compressor

عرض على GitHub

حول

Model compression for ONNX

الذكاء الاصطناعي وتعلّم الآلة

كيف تُقاس هذه الأرقام

ما يمكنك فعله

  • Post-training static and dynamic quantization
  • INT4/INT8 weight-only quantization with RTN, AWQ, and GPTQ
  • Layer-wise quantization for reducing peak memory use
  • Accuracy-aware tuning and examples for popular ONNX models

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
٠
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Neural Compressor

Python 3.11 through 3.14 Release License

Neural Compressor is an open-source Python library for compressing ONNX models. It provides post-training static and dynamic quantization, weight-only quantization, and SmoothQuant workflows that produce models for ONNX Runtime.

Features

  • Post-training static and dynamic quantization
  • INT4/INT8 weight-only quantization with RTN, AWQ, and GPTQ
  • Layer-wise quantization for reducing peak memory use
  • Accuracy-aware tuning and examples for popular ONNX models

Requirements

  • Python 3.11 through 3.14
  • An ONNX model and ONNX Runtime execution provider suitable for your model

See the compatibility policy for tested platforms and minimum/current dependency combinations, and the release notes for changes planned for the next release. These requirements describe the current source tree; the published v1.0 package predates these changes.

Installation

Install the stable package from PyPI:

python -m pip install onnx-neural-compressor

To install from source with the test dependencies:

git clone https://github.com/onnx/neural-compressor.git
cd neural-compressor
python -m pip install -e ".[test]"

Run the test suite with:

python -m pytest -q test

See the installation guide for supported environments and hardware.

Quick start

Dynamic quantization takes an existing ONNX model and writes a quantized model:

from onnx_neural_compressor.quantization import config, quantize

quantize(
    model_input="model.onnx",
    model_output="model_int8.onnx",
    quant_config=config.DynamicQuantConfig(),
)

For static quantization, provide a calibration data reader whose batches match the model's inputs. See the quantization guide for the reader interface and configuration options.

Documentation and examples

Guide Description
Quantization Static and dynamic post-training quantization
Weight-only quantization INT4/INT8 RTN, AWQ, and GPTQ
Layer-wise quantization Quantize models layer by layer
SmoothQuant SmoothQuant workflow
Autotuning Search quantization configurations
Examples End-to-end model examples
Design Architecture and workflow

Contributing and support

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…