Skip to content

Latest commit

 

History

History
39 lines (33 loc) · 2.15 KB

Quantization.md

File metadata and controls

39 lines (33 loc) · 2.15 KB

Neural Coder for Quantization

This feature helps automatically enable quantization on Deep Learning models and automatically evaluates for the best performance on the model. It is a code-free solution that can help users enable quantization algorithms on a model with no manual coding needed. Supported features include Post-Training Static Quantization, Post-Training Dynamic Quantization, and Mixed Precision.

Features Supported

Models Supported

Usage

Example

PyPI distribution:

HuggingFace Transformers models: text-classification/run_glue.py

from neural_coder import auto_quant
auto_quant(
    code="https://github.com/huggingface/transformers/blob/v4.21-release/examples/pytorch/text-classification/run_glue.py",
    args="--model_name_or_path albert-base-v2 --task_name sst2 --do_eval --output_dir result",
)

torchvision models: imagenet/main.py

from neural_coder import auto_quant
auto_quant(
    code="https://github.com/pytorch/examples/blob/main/imagenet/main.py",
    args="-a alexnet --pretrained -e /path/to/imagenet/",
)