Coder Social home page Coder Social logo

Comments (4)

ZhangZhiPku avatar ZhangZhiPku commented on August 29, 2024

哦豁,你需要注意到不同的后端要求的量化模型格式也不一样,你现在导出的这种带json的格式应该是open ppl需要的,这种格式所有量化参数都保存在json文件中,ppl可以直接执行。

请知悉:
如果你选择tensorRT作为导出平台,则我们将直接导出量化后的engine文件,tensorRT可以直接运行;
如果你选择snpe作为导出平台,量化参数将被写入caffe proto文件,snpe好像...可以直接运行;
如果你选择nxp作为导出格式,量化参数将被写入onnx,nxp可以直接运行;
如果你选择onnxruntime作为导出格式,我们将在网络中插入quant以及dequant节点,onnxruntime可以直接运行。
如果你选择onnxruntime OOS作为导出格式,我们将在网络中插入quant以及dequant节点,并且置换原有计算节点,onnxruntime可以直接运行。
如果你选择onnx作为导出格式,我们将导出一个ppq原生的格式,这个格式只是用来debug的。

如果你想最快速的看到结果,选择onnxruntime作为导出格式即可,你就可以在导出的onnx中看到量化结果。

所有导出平台被列举在ppq.api.文件中:
EXPORTERS = {
TargetPlatform.PPL_DSP_INT8: PPLDSPCaffeExporter,
TargetPlatform.PPL_DSP_TI_IN8: PPLDSPTICaffeExporter,
TargetPlatform.PPL_CUDA_INT8: PPLBackendExporter,
TargetPlatform.SNPE_INT8: SNPECaffeExporter,
TargetPlatform.NXP_INT8: NxpExporter,
TargetPlatform.ONNX: OnnxExporter,
TargetPlatform.ONNXRUNTIME: ONNXRUNTIMExporter,
TargetPlatform.CAFFE: CaffeExporter,
TargetPlatform.NATIVE: NativeExporter,
TargetPlatform.EXTENSION: ExtensionExporter,
# TargetPlatform.ORT_OOS_INT8: ONNXRUNTIMExporter,
TargetPlatform.ORT_OOS_INT8: ORTOOSExporter,
TargetPlatform.METAX_INT8_C: ONNXRUNTIMExporter,
TargetPlatform.METAX_INT8_T: ONNXRUNTIMExporter,
}

from ppq.

fengyuentau avatar fengyuentau commented on August 29, 2024

谢谢!请问导出平台是指TargetPlatform吗?提及的情况大概是这几行?
https://github.com/openppl-public/ppq/blob/35fb7f78b24946f6224793719603db75305e5d55/ppq/parser/__init__.py#L23-L35

from ppq.

ZhangZhiPku avatar ZhangZhiPku commented on August 29, 2024

啊对,这里面除了ONNX, NATIVE, EXTENSION都是后端实际需要的格式。

选择NATIVE会导出ppq的二进制原生格式;
选择EXTENSION没什么用,那个只是告诉你你可以重写EXTENSION类来实现自己的导出逻辑。

from ppq.

fengyuentau avatar fengyuentau commented on August 29, 2024

好的,非常感谢!

from ppq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.