"use strict";(self.webpackChunkrspress_doc_template=self.webpackChunkrspress_doc_template||[]).push([["8555"],{54698:function(e,t,n){n.r(t);var r=n(85893),o=n(50065);function i(e){let t=Object.assign({h1:"h1",a:"a",p:"p",ul:"ul",li:"li",div:"div"},(0,o.ah)(),e.components);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.h1,{id:"prepare-the-floating-point-model",children:[(0,r.jsx)(t.a,{className:"header-anchor","aria-hidden":"true",href:"#prepare-the-floating-point-model",children:"#"}),"Prepare the Floating Point Model"]}),"\n",(0,r.jsx)(t.p,{children:"The S100 toolchain supports you to quantize your model by means of PTQ or QAT.\nThe two paths have different input requirements for floating-point model, as shown below:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["PTQ: It supports for common DL frameworks including Caffe, Pytorch, TensorFlow, PaddlePaddle, etc.,\nof which the Caffe framework is directly supported, and other frameworks need to be converted to ONNX model for support,\nand ONNX model need to satisfy the version requirements of opset10-19.\nA detailed introduction of PTQ links can be found in section ",(0,r.jsx)(t.a,{href:"/latest/en/guide/ptq/ptq_workflow.html",children:"Post-training Quantization(PTQ)"})," ."]}),"\n"]}),"\n",(0,r.jsxs)(t.div,{className:"rspress-directive warning",children:[(0,r.jsx)(t.div,{className:"rspress-directive-title",children:"Attention"}),(0,r.jsx)(t.div,{className:"rspress-directive-content",children:(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"For Caffe model, you will need to complete a evaluation of the model's floating-point accuracy to ensure that the model's weights and structure are correct."}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsx)(t.p,{children:"For ONNX model, you need to first perform inference using the HBRuntime to verify that the ONNX model and the original DL framework model inference results are consistent (i.e., verify model legitimacy)."}),"\n"]}),"\n"]})})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["QAT: We provide a plugin that can directly convert and compile the exported torch module from Pytorch.\nFor the exported torch module, you can first complete the evaluation of the model's floating-point accuracy to make sure that the model's weights and structure are correct.\nFor a detailed description of the QAT path, please refer to section ",(0,r.jsx)(t.a,{href:"/latest/en/guide/plugin/introduce.html",children:"Quantized Awareness Training(QAT)"}),"."]}),"\n"]})]})}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:t}=Object.assign({},(0,o.ah)(),e.components);return t?(0,r.jsx)(t,Object.assign({},e,{children:(0,r.jsx)(i,e)})):i(e)}t.default=s,s.__RSPRESS_PAGE_META={},s.__RSPRESS_PAGE_META["latest%2Fen%2Fguide%2Fmodel_deployment_guidance%2Fmodel_deployment_principle_process%2Fmodel_prepare.mdx"]={toc:[],title:"Prepare the Floating Point Model",frontmatter:{}}}}]);