{"notes":[{"id":"reparameterization/qarepvgg","category":"reparameterization","legacyPath":"reparameterization/2212-qarepvgg","legacySlug":"2212-qarepvgg","legacyPaths":[],"title":"QARepVGG","subtitle":"Making RepVGG Great Again","author":"Z. Yuan","paperDate":"2024","publishedOn":"2024-07-19","paperTitle":"Make RepVGG Greater Again: A Quantization-Aware Approach","paperUrl":"https://doi.org/10.1609/aaai.v38i10.29045","bibliography":{"title":"Make RepVGG Greater Again: A Quantization-Aware Approach","authors":["Xiangxiang Chu","Liang Li","Bo Zhang"],"url":"https://doi.org/10.1609/aaai.v38i10.29045","pdfUrl":null,"codeUrl":null,"preprint":null,"publication":{"venue":"AAAI","year":2024,"kind":"conference","url":"https://doi.org/10.1609/aaai.v38i10.29045"},"citation":"@inproceedings{reparameterizationqarepvgg2024,\n  title = {{Make RepVGG Greater Again: A Quantization-Aware Approach}},\n  author = {Xiangxiang Chu and Liang Li and Bo Zhang},\n  year = {2024},\n  booktitle = {AAAI},\n  url = {https://doi.org/10.1609/aaai.v38i10.29045},\n  doi = {10.1609/aaai.v38i10.29045}\n}\n","citationPath":"/content/papers/citations/reparameterization/qarepvgg.b3626a885ba4.bib"},"thumbnail":{"src":"/content/papers/assets/235704cf12582c9b34f98f1476c6e6a285d0e7a2fe831231471b254b85aebd5b.jpg","width":1016,"height":864},"locale":"en","path":"/content/papers/en/reparameterization/qarepvgg.cdf22962d69f.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"repvgg-cannot-be-quantized","text":"RepVGG cannot be quantized!","depth":3},{"id":"why","text":"Why?","depth":3},{"id":"regularization-amplifies-activation-variance","text":"Regularization Amplifies Activation Variance","depth":3},{"id":"uncontrollable-outlier-weights","text":"Uncontrollable Outlier Weights","depth":3},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"discussion","text":"Discussion","depth":2},{"id":"performance-on-imagenet","text":"Performance on ImageNet","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"reparameterization/repvgg","relation":"background","topic":"Quantizing reparameterized networks"}]},{"id":"reparameterization/repvgg","category":"reparameterization","legacyPath":"reparameterization/2101-repvgg","legacySlug":"2101-repvgg","legacyPaths":[],"title":"RepVGG","subtitle":"Making VGG Great Again","author":"Z. Yuan","paperDate":"2021-01-11","publishedOn":"2024-07-15","paperTitle":"RepVGG: Making VGG-style ConvNets Great Again","paperUrl":"https://arxiv.org/abs/2101.03697","bibliography":{"title":"RepVGG: Making VGG-style ConvNets Great Again","authors":["Xiaohan Ding","Xiangyu Zhang","Ningning Ma","Jungong Han","Guiguang Ding","Jian Sun"],"url":"https://arxiv.org/abs/2101.03697","pdfUrl":"https://arxiv.org/pdf/2101.03697","codeUrl":null,"preprint":{"id":"2101.03697","submittedOn":"2021-01-11","url":"https://arxiv.org/abs/2101.03697"},"publication":{"venue":"CVPR","year":2021,"kind":"conference","url":"https://arxiv.org/abs/2101.03697"},"citation":"@misc{reparameterizationrepvgg2021,\n  title = {{RepVGG: Making VGG-style ConvNets Great Again}},\n  author = {Xiaohan Ding and Xiangyu Zhang and Ningning Ma and Jungong Han and Guiguang Ding and Jian Sun},\n  year = {2021},\n  eprint = {2101.03697},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2101.03697}\n}\n","citationPath":"/content/papers/citations/reparameterization/repvgg.a8a729b9514b.bib"},"thumbnail":{"src":"/content/papers/assets/ed80741f073c5691ee7165b3b5d340699a61a3e3cd389dcffc84bea436b09836.jpg","width":1224,"height":968},"locale":"en","path":"/content/papers/en/reparameterization/repvgg.04b60bdf3b00.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"high-memory-usage","text":"High Memory Usage","depth":3},{"id":"slow-inference-speed","text":"Slow Inference Speed","depth":3},{"id":"however","text":"However...","depth":3},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"reparameterization","text":"Reparameterization","depth":3},{"id":"parameter-configuration","text":"Parameter Configuration","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"imagenet-performance","text":"ImageNet Performance","depth":3},{"id":"ablation-experiments","text":"Ablation Experiments","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"reparameterization/dbb","relation":"next","topic":"Merging training branches for inference"},{"id":"reparameterization/qarepvgg","relation":"next","topic":"Quantizing reparameterized networks"}]}],"text":"RepVGG leverages an over-parameterized network with multiple branches during the training phase, and merges these branches into a single one during inference, a process termed \"re-parameterization.\"\n\n- [**RepVGG: Making VGG Great Again**](/blog/papers/reparameterization/repvgg)\n\n## Defining the Problem\n\nThis \"re-parameterization\" design is widely used as a fundamental component in many scenarios, covering both low-level and high-level visual tasks.\n\nRecent popular object detection methods like YOLOv6 and YOLOv7 are built on such components.\n\n- [**[22.07] YOLOv7**](https://arxiv.org/abs/2207.02696)\n- [**[22.09] YOLOv6**](https://arxiv.org/abs/2209.02976)\n\nHowever...\n\n### RepVGG cannot be quantized!\n\nThe heading describes a severe accuracy collapse, not a mathematical impossibility of quantizing RepVGG. The results concern the tested INT8 setup, not every quantization method.\n\nQuantization is an effective model compression method that maps network weights and input data to lower precision (usually INT8) for faster computation, significantly enhancing computational efficiency.\n\n- Post-training quantization (PTQ) is the most common scheme, requiring only a few batches of images to calibrate quantization parameters without additional training.\n- Quantization-aware training (QAT) methods are also proposed to improve quantization accuracy. QAT usually involves intrusively modifying training code and requires additional costs, so it is typically used only when PTQ does not yield satisfactory results and when training code is available.\n\nThere is a trade-off: quantization typically results in some loss of accuracy, so it's used only if it can be applied without significantly impacting performance for deployment tasks.\n\n- **But RepVGG loses about 20 percentage points of accuracy after quantization!**\n\nThis makes it completely impractical!\n\n### Why?\n\n![test_1](/content/papers/assets/6c1e1116eaf3773d2cd5747c1367c34a156a265b65255b98e8c3fd0666397c0c.jpg)\n\n---\n\nThe authors first evaluate the performance of several RepVGG models using the official code. As shown in the table above, after standard PTQ (post-training quantization), RepVGG-A0's Top-1 accuracy on the ImageNet validation dataset drops significantly from 72.4% to 52.2%, a total decrease of 20.2 percentage points!\n\nQuantization of a tensor $X$ is typically represented as:\n\n$$\nQ(X) = Clip(Round(X/\\Delta x ))\n$$\n\nThis simplified expression omits the zero-point and illustrates symmetric quantization. $Round$ rounds to the nearest integer; it is not the ceiling function, and $Clip$ truncates values beyond the quantization range. $\\Delta x$ is a scaling factor that maps the tensor to a given range, defined as:\n\n$$\n\\Delta x = \\frac{(x_{max} - x_{min})}{2^{b}-1}\n$$\n\nwhere $x_{max}$ and $x_{min}$ are boundary values chosen to better represent the distribution of $X$. If there is no clipping error and rounding error is uniform over one quantization interval, its variance is approximately $\\sigma^2 = (\\Delta x)^2/12$. Narrowing the range reduces rounding error but can increase clipping error, so the two must be balanced.\n\nIn practice, these values are chosen in various ways. Sometimes the maximum and minimum values are used directly, such as for weight quantization; sometimes they are chosen by optimizing the quantization error's MSE or entropy, typically for activation quantization. The quality of the selection depends on many factors, such as the tensor's variance and the presence of outliers.\n\nFor neural networks, two main components need quantization and can lead to accuracy degradation: weights and activations. Activations also serve as inputs to the next layer, so errors accumulate layer by layer. Therefore, good quantization performance of a neural network primarily requires two basic conditions:\n\n- $C1$: The weight distribution is quantization-friendly and feasible in range.\n- $C2$: The activation distribution (i.e., the model's response to input features) is also quantization-friendly.\n\nEmpirically, we define quantization-friendly weight or activation distributions as those with small variance and few outliers. Violating either condition results in poor quantization performance.\n\nThe authors then show the weight distribution of the RepVGG-A0 model:\n\n![test_2](/content/papers/assets/2b4b48e8f1363aac9f451006ec7f621bd7b169a495821fa622a7364c52a4decc.jpg)\n\nThe figure above shows the weight distribution for each layer and the corresponding standard deviation.\n\nObservation reveals that these weights are concentrated around zero, with no significant outliers, satisfying condition $C1$.\n\nThis prompts the authors to further verify condition $C2$ by examining whether the activation values significantly worsen the quantization effect.\n\nUnfortunately, activation values depend on the input and are coupled with learned weights.\n\nThus, the authors do not make any assumptions about the distribution of weights or activations and analyze the biases of each branch.\n\n### Regularization Amplifies Activation Variance\n\nBefore further discussion, let's introduce the computation operations in a typical RepVGG block.\n\nHere, the same naming conventions as RepVGG are used for better understanding.\n\nSpecifically, $W^{(k)} \\in \\mathbb{R}^{C_2 \\times C_1 \\times k \\times k}$ denotes the kernel of the $k \\times k$ convolution, where $C_1$ and $C_2$ are the numbers of input and output channels, respectively. For RepVGG, $k \\in \\{1, 3\\}$. For the BN layer after the $k \\times k$ convolution, $\\mu^{(k)} \\in \\mathbb{R}^{C_2}$, $\\sigma^{(k)} \\in \\mathbb{R}^{C_2}$, $\\gamma^{(k)} \\in \\mathbb{R}^{C_2}$, and $\\beta^{(k)} \\in \\mathbb{R}^{C_2}$ represent the mean, standard deviation, scaling factor, and bias, respectively. For the BN in the Identity branch, $\\mu^{(0)}$, $\\sigma^{(0)}$, $\\gamma^{(0)}$, $\\beta^{(0)}$ are used.\n\nLet $M^{(1)} \\in \\mathbb{R}^{N \\times C_1 \\times H_1 \\times W_1}$ and $M^{(2)} \\in \\mathbb{R}^{N \\times C_2 \\times H_2 \\times W_2}$ represent the input and output, respectively, with $\\ast$ denoting convolution operation.\n\nLet $Y^{(0)}$, $Y^{(1)}$, and $Y^{(3)}$ be the outputs of the Identity, $1 \\times 1$, and $3 \\times 3$ branches, respectively.\n\nFor a block with an identity branch, restrict the analysis to stride 1 and $C_1 = C_2$, $H_1 = H_2$, and $W_1 = W_2$.\n\nHere $M^{(2)}$ is the branch sum before ReLU:\n\n$$\n\\begin{aligned}\nM^{(2)} &= BN(M^{(1)} \\ast W^{(3)}, \\mu^{(3)}, \\sigma^{(3)}, \\gamma^{(3)}, \\beta^{(3)}) \\\\\n&+ BN(M^{(1)} \\ast W^{(1)}, \\mu^{(1)}, \\sigma^{(1)}, \\gamma^{(1)}, \\beta^{(1)}) \\\\\n&+ BN(M^{(1)}, \\mu^{(0)}, \\sigma^{(0)}, \\gamma^{(0)}, \\beta^{(0)})\n\\end{aligned}\n$$\n\nNext, the BN operation of the $3 \\times 3$ branch can be written as:\n\n$$\nY^{(3)} = \\gamma^{(3)} \\odot \\frac{M^{(1)} \\ast W^{(3)} - \\mu^{(3)}}{\\sqrt{\\sigma^{(3)} \\odot \\sigma^{(3)} + \\epsilon}} + \\beta^{(3)}\n$$\n\nwhere $\\odot$ denotes element-wise multiplication, and $\\epsilon$ is a small value (default $10^{-5}$) to ensure numerical stability. This means BN changes the statistics (mean and variance) of its input.\n\nA shift does not change variance, but the mean can still affect clipping and quantization error under fixed-range or symmetric quantization. From a probabilistic perspective, given a random variable $X$ and scalar $\\lambda$, the variance of $\\lambda X$, $D(\\lambda X)$, equals $\\lambda^2 D(X)$.\n\nLet $X^{(3)} = M^{(1)} \\ast W^{(3)}$, then:\n\n$$\nD(Y^{(3)}) = \\frac{\\gamma^{(3)} \\odot \\gamma^{(3)}}{\\sigma^{(3)} \\odot \\sigma^{(3)} + \\epsilon} \\odot D(X^{(3)})\n$$\n\nHere, the value of $\\frac{\\gamma^{(3)} \\odot \\gamma^{(3)}}{\\sigma^{(3)} \\odot \\sigma^{(3)} + \\epsilon}$ controls the expansion or reduction of $X^{(3)}$'s variance, leading to either better or worse quantization performance.\n\nSimilar conclusions can be drawn for the $1 \\times 1$ and Identity branches.\n\nBased on the above analysis, the authors delve into the details of RepVGG:\n\nA crucial yet often overlooked component is a specially designed custom $L_2$ weight decay that enhances accuracy and facilitates quantization by regularizing the multi-branch weights, similar to regularizing their equivalent fused convolution kernels.\n\nThis may lead to quantization-friendly fused weights.\n\nThe official `get_custom_L2` code uses the following center-kernel term. The complete loss also includes ordinary $L_2$ on the outer ring of the 3×3 kernel:\n\n$$\nL_{2,\\text{center}} = \\sum_{o,i}\\frac{(t_{3,o}W^{(3)}_{o,i,1,1}+t_{1,o}W^{(1)}_{o,i,0,0})^2}{t_{3,o}^2+t_{1,o}^2},\\qquad t_{k,o}=\\frac{\\gamma^{(k)}_o}{\\sqrt{(\\sigma^{(k)}_o)^2+\\epsilon}}\n$$\n\nThe paper associates this normalization with enlarged activation variance. However, the official code detaches $t_3$ and $t_1$: this loss does not backpropagate through the denominator into the BN scale parameters. The proposed explanation is therefore not a direct gradient mechanism proved by this expression. The ablation does show that ordinary $L_2$ improves accuracy under the tested PTQ setup.\n\nTo address the issue of increased variance, a simple and straightforward approach is to remove the denominator from the above formula, resulting in:\n\n$$\nL_{2,\\text{center}}' = \\sum_{o,i}(t_{3,o}W^{(3)}_{o,i,1,1}+t_{1,o}W^{(1)}_{o,i,0,0})^2\n$$\n\nThe results are shown in the table below:\n\n![test_3](/content/papers/assets/660d9b8cd32e6e82185d2ea904af82820e0175d9283d23714234ae8e4310a2ec.jpg)\n\nRemoving the denominator term yields an FP32 accuracy of 71.5%, which is 0.7 percentage points below the reproduced 72.2% baseline.\n\nHowever, the quantization performance improves significantly to 61.2%. Still, this method requires inconvenient equivalent transformations.\n\nAnother promising approach is to directly apply ordinary $L_2$.\n\nThe results showed that, besides simplicity, ordinary $L_2$ achieved slightly better results than the preceding variant.\n\nThus, this method is chosen as the default implementation (M1).\n\n### Uncontrollable Outlier Weights\n\nOrdinary $L_2$ lowers FP32 accuracy by 0.5 percentage points but raises INT8 accuracy by 11.3 points relative to the reproduced baseline. A substantial gap remains. With the special regularizer removed, the authors next inspect the weight distribution.\n\nFirst, we can derive the fused weights as:\n\n$$\n\\begin{aligned}\nW &= \\hat{W}^{(3)} + \\hat{W}^{(1)} + \\hat{W}^{(0)} \\\\\n&= \\frac{\\gamma^{(3)}}{\\sqrt{\\sigma^{2}_{(3)} + \\epsilon}} \\odot W^{(3)} \\\\\n&+ \\frac{\\gamma^{(1)}}{\\sqrt{\\sigma^{2}_{(1)} + \\epsilon}} \\odot Padding(W^{(1)}) \\\\\n&+ \\frac{\\gamma^{(0)}}{\\sqrt{\\sigma^{2}_{(0)} + \\epsilon}} \\odot Padding(W^{(0)})\n\\end{aligned}\n$$\n\nwhere $Padding()$ is used to match the shape of the $3 \\times 3$ convolution kernel.\n\nIn this architecture, $W^{(3)}$ and $W^{(1)}$ are trainable parameters, while $W^{(0)}$ is a fixed identity matrix that does not decay during training. The scalars $\\frac{\\gamma^{(3)}}{\\sqrt{\\sigma^{2}_{(3)} + \\epsilon}}$ and $\\frac{\\gamma^{(1)}}{\\sqrt{\\sigma^{2}_{(1)} + \\epsilon}}$ depend on the output of the convolutional layers in the $3 \\times 3$ and $1 \\times 1$ branches, respectively.\n\n**However, $\\frac{\\gamma^{(0)}}{\\sqrt{\\sigma^{2}_{(0)} + \\epsilon}}$ depends directly on the distribution of the preceding block’s post-ReLU output, and the Identity branch is special because the activations pass through the ReLU layer before entering the BatchNorm layer.**\n\nThis operation is very dangerous because if a channel is entirely inactive (i.e., contains only zeros), it generates a very small $\\sigma$ and a large scale factor $\\frac{1}{\\sqrt{\\sigma^{2}_{(0)} + \\epsilon}}$. This issue is common in networks widely using ReLU.\n\n**If this happens, the outlier scale factor can dominate the distribution of the fused convolution kernels, significantly affecting their quantization preference.**\n\nThis explains the poor quantization performance due to the violation of $C1$, leading to severe quantization errors.\n\n---\n\nThe authors further display the $\\frac{\\gamma}{\\sqrt{\\sigma^2 + \\epsilon}}$ of the three branches, as shown below.\n\nIn Layers 5 and 6, the maximum $\\frac{\\gamma}{\\sqrt{\\sigma^2 + \\epsilon}}$ from the Identity branch is 692.1107 and 1477.3732, respectively.\n\nThe authors repeated the experiment three times, and this phenomenon recurred.\n\n![test_4](/content/papers/assets/5dd7fefda8741dd784ac6775d5a8edc2ddd9488c61280b308edd9cfbf62976bf.jpg)\n\n\n> [!TIP]\n> \n> The maximum value appears randomly in different layers across different experiments, and simply skipping these layers cannot solve the quantization problem.\n> \n> According to the authors' analysis, the quantization error of RepVGG accumulates across all layers, so partial solutions cannot mitigate the breakdown, prompting the authors to design a quantization-friendly re-parameterization structure to address the issue.\n\n\n## Solving the Problem\n\n![arch](/content/papers/assets/235704cf12582c9b34f98f1476c6e6a285d0e7a2fe831231471b254b85aebd5b.jpg)\n\nBased on ordinary $L_2$ loss, the authors address the issues by altering the re-parameterization structure.\n\nThe final design removes BN from the Identity and $1 \\times 1$ branches and adds an extra BN after the sum of the three branches. The authors first remove only the Identity branch's BN (M2) to address the uncontrollable outlier weights and satisfy condition $C1$.\n\nThey call the combination of M1 and M2 S2; its results appear in the third row of the table below. Removing the $1 \\times 1$ BN and adding post-sum BN come later as M3 and M4.\n\n![test_5](/content/papers/assets/52a2bb41410b03f85c2b36306872218feea7f2ad0400fe238994d8b4817ff918.jpg)\n\nError analysis of weight quantization indicates that this design indeed meets condition $C1$. The FP32 accuracy of this model is relatively low at 70.7%, with an INT8 accuracy of 62.5%, still impractical.\n\nThis prompted the authors to verify if it violated condition $C2$. The authors observe enlarged variance after summing the branches. The variance also depends on covariance: $D(A+B)=D(A)+D(B)+2\\operatorname{Cov}(A,B)$.\n\nThis phenomenon frequently occurs in RepVGG's design. Since ReLU is the activation function in RepVGG, if most inputs are below zero (dead neurons), it's harmful. Conversely, if all inputs are above zero, it's also undesirable due to losing non-linearity. Empirically, many modern high-performance CNN models have zero mean before ReLU.\n\nAssuming this, we have:\n\n$$\nE(M^{(2)}) = E(Y^{(1)} + Y^{(3)} + Y^{(0)}) = 0\n$$\n\nIf the $3 \\times 3$ and $1 \\times 1$ branches have the same mean, we get:\n\n$$\n\\beta^{(3)} = \\beta^{(1)} = -\\frac{E(Y^{(0)})}{2}\n$$\n\nHere $E(Y^{(0)}) \\ge 0$ because S2 removes identity-branch BN and its input follows the preceding ReLU. The mean identity follows from $2\\beta+E(Y^{(0)})=0$. Variance enlargement additionally requires covariance analysis or empirical evidence:\n\n![test_6](/content/papers/assets/2876e559b6cc3dcb0147f7ccbc0d445675aa8909229e874ea082e430075d8a39.jpg)\n\nThe plotted distributions illustrate the issue in the tested model; it cannot be deduced from equal means alone.\n\n---\n\nTo better control variance, several simple methods have potential, as shown in the table below:\n\n![test_6](/content/papers/assets/e920b7567740ec94ca2ecedb47823116f6e7ed22ad665d60bd589b4d09c9bd1b.jpg)\n\nThe authors remove BN from the $1 \\times 1$ branch (M3) because it has the best INT8 accuracy among the variants in this comparison. They call the combination of M1, M2 and M3 S3. This design achieves 70.1% Top-1 FP32 accuracy and 69.5% INT8 accuracy on ImageNet, significantly improving quantization performance.\n\nHowever, its FP32 accuracy is still low.\n\nTo address the distribution changes after branch summation, the authors add an additional batch normalization (M4) after summing the three branches to stabilize training, naming the combination of M1 through M4 S4.\n\nThe post-BN does not affect the equivalent convolution kernel fusion during deployment. This further boosts the A0 model's Top-1 FP32 accuracy on ImageNet from 70.1% to 72.2%. Additionally, its INT8 accuracy increases to 70.4%.\n\nIn summary, combining the four modifications above (from M1 to M4) ultimately forms QARepVGG, maintaining RepVGG's excellent FP32 performance while significantly surpassing RepVGG in INT8 performance.\n\n## Discussion\n\n### Performance on ImageNet\n\n![test_7](/content/papers/assets/0067efa02d376a834e8b5488baae2929f6ac08234a55adc7e306d6952ec63703.jpg)\n\nThe research shows that RepVGG's INT8 accuracy is severely impacted, far below FP32.\n\nFor example, RepVGG-B0's Top-1 accuracy drops from 75.1% to 40.2%. In contrast, the FP32-to-INT8 accuracy gaps for the QARepVGG models in the table are all within 2 percentage points.\n\nNotably, RepVGG with grouped convolutions performs particularly poorly. After PTQ, RepVGG-B2g4's accuracy drops from 78.5% to 13.7%, a decrease of 64.8 percentage points. In contrast, QARepVGG-B2g4's accuracy drops by only 0.7 percentage points, showing more stable quantization in these tested model configurations.\n\nIn comparison with RepOpt-VGG, which uses gradient re-parameterization, its quantization accuracy is highly sensitive to scale search quality. With only partial pre-trained models released, the authors re-trained RepOpt-VGG-A0/B0 models.\n\nResults show that RepOpt-VGG-A0 achieves 70.3% FP32 accuracy on ImageNet, 2.1 percentage points below official RepVGG-A0. Although its quantization performance improves over original RepVGG, the table's PTQ accuracy remains below the corresponding QARepVGG models. The authors' method also avoids the additional 240 CIFAR-100 training epochs used for RepOpt-VGG's scale search.\n\nFinally, the authors compared the two architectures under QAT using the NVIDIA quantization toolkit. QARepVGG+QAT has 1.0 to 5.6 percentage points higher INT8 accuracy than RepVGG+QAT across the three models in the table. The QAT stage runs for 10 epochs, with the first three used for warm-up and an initial learning rate of 0.01.\n\n## Conclusion\n\nThrough theoretical and quantitative analysis, this study delves into the failure reasons for quantizing the famous re-parameterization-based structure RepVGG. The study finds that the original structure and training setup amplify quantization errors in the tested PTQ experiments and accumulate to produce poor results. To address this issue, the research team redesigned the structure, introducing QARepVGG. This improved design yields quantization-friendly weights and activation distributions.\n\nQARepVGG maintains the excellent FP32 performance of RepVGG while greatly simplifying the final deployment quantization process. This study emphasizes the importance of quantization awareness in architecture design to improve overall model performance. Through this design, QARepVGG demonstrates superior quantization performance, providing valuable insights for future model designs.\n\n\n> [!TIP]\n> \n> After patiently reading through this paper, one might feel a sense of greatness...\n> \n> Despite the numerous mathematical formulas, the paper is actually quite comprehensible.\n> \n> We recommend readers delve into the original paper for a deeper understanding of the design and performance of QARepVGG.\n","imageSizes":{"/content/papers/assets/6c1e1116eaf3773d2cd5747c1367c34a156a265b65255b98e8c3fd0666397c0c.jpg":{"width":1224,"height":460},"/content/papers/assets/2b4b48e8f1363aac9f451006ec7f621bd7b169a495821fa622a7364c52a4decc.jpg":{"width":1224,"height":904},"/content/papers/assets/660d9b8cd32e6e82185d2ea904af82820e0175d9283d23714234ae8e4310a2ec.jpg":{"width":1224,"height":424},"/content/papers/assets/5dd7fefda8741dd784ac6775d5a8edc2ddd9488c61280b308edd9cfbf62976bf.jpg":{"width":1224,"height":768},"/content/papers/assets/235704cf12582c9b34f98f1476c6e6a285d0e7a2fe831231471b254b85aebd5b.jpg":{"width":1016,"height":864},"/content/papers/assets/52a2bb41410b03f85c2b36306872218feea7f2ad0400fe238994d8b4817ff918.jpg":{"width":1224,"height":592},"/content/papers/assets/2876e559b6cc3dcb0147f7ccbc0d445675aa8909229e874ea082e430075d8a39.jpg":{"width":1224,"height":988},"/content/papers/assets/e920b7567740ec94ca2ecedb47823116f6e7ed22ad665d60bd589b4d09c9bd1b.jpg":{"width":1224,"height":444},"/content/papers/assets/0067efa02d376a834e8b5488baae2929f6ac08234a55adc7e306d6952ec63703.jpg":{"width":1164,"height":1080}}}
