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

未关闭
#2,488 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
文档
描述清晰度
需要澄清
活跃度
停滞
技术栈
python, pytorch

调研方向

从链接的 quantize_with_inc.ipynb 示例开始,检查它如何保存量化后的 PyTorch 模型。验证是否支持所请求的 ONNX 输入/输出路径,以及是否应在此示例中加入导出示例。当有一个涵盖直接 ONNX 量化和替代导出路径的清晰、可复现的答案或示例时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

question

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!

主要语言
C++
星标
1.2k
派生
745
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

oneapi-src/oneAPI-samples 的其他 Issue

查看 oneapi-src/oneAPI-samples 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。