oneapi-src / oneapi-src/oneAPI-samples

How to Perform Static Quantization Directly on an ONNX Model Using Intel® Neural Compressor?

Ouverte
#2,488 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

question
Langage dominant
C++
Étoiles
1.2k
Forks
745
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hello,

I'm using Intel® Neural Compressor (INC) to perform static quantization on my custom PyTorch model. I followed this script which demonstrates how to apply static quantization using INC on a PyTorch model.

My goal is to obtain the final quantized model in ONNX format. However, after quantization, saving the q_model results in a .pt file (PyTorch format). I also found that exporting quantized PyTorch models to ONNX is problematic due to limited support and compatibility issues, especially with static quantization.

My Question:

Is there a way to perform static quantization directly on an ONNX model using Intel® Neural Compressor to produce a quantized ONNX model as the output?
Alternatively, is there a specific method to export the statically quantized PyTorch model to ONNX format while addressing the compatibility issues?
Any guidance or examples on how to achieve this would be greatly appreciated.

Thank you!

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par l’exemple lié quantize_with_inc.ipynb et examinez comment il enregistre le modèle PyTorch quantifié. Vérifiez si le chemin d’entrée/sortie ONNX demandé est pris en charge et si un exemple d’exportation doit être inclus dans cet exemple. La tâche est terminée lorsqu’une réponse ou un exemple clair et reproductible couvre la quantification ONNX directe et le chemin d’exportation alternatif.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, pytorch
Domaine
documentation, machine-learning
Type d'issue
Documentation
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
20/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.