question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some questions about quantization

See original GitHub issue

您好,我在量化RepVGG到INT8时遇到一些问题: 完全按照您在README中提到的量化流程,先插入BN后QAT量化,掉点非常严重。以大模型(b3g4)为例,在ImageNet分类任务上量化后仅有20左右的accuracy。 但假如将https://github.com/DingXiaoH/RepVGG/blob/ce669bad170bf5d7c2a9eb060e90f39e7e109130/quantization/repvgg_quantized.py#L50代码修改为:` torch.quantization.fuse_modules(m, [‘conv’], inplace=True)` 可以直接运行QAT量化,则掉点只有2.7%,调参后掉点大约1.7%。(参数为epochs=20 batch_size:与训练时bs保持一致 lr=1e-3 weight_decay=55e-6) 但对于分类任务而言量化后掉点也有点多,不知道这样做是否正确?请问您有其他量化方法的见解吗?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

4reactions
Desmond-97commented, Apr 18, 2022

@twmht 我后来尝试直接用PTQ量化效果会好很多,TensorRT实现PTQ量化,用交叉熵做校准loss,RepVGG_A0模型在ImageNet分类任务上掉点仅0.16%。 我后来思考QAT量化掉点多的原因可能是:在QAT阶段用的模型是融合后的单分支推理模型,用这个模型进行QAT的finetune会使得模型退化,类似VGG的精度。但我并没有尝试用训练阶段模型进行QAT量化。

0reactions
Desmond-97commented, May 2, 2022

@hobbitlzy 没有用insert_bn。

Read more comments on GitHub >

github_iconTop Results From Across the Web

89 questions with answers in QUANTIZATION | Science topic
Review and cite QUANTIZATION protocol, troubleshooting and other methodology information | Contact experts in QUANTIZATION to get answers.
Read more >
[quant-ph/9712009] Questions on quantization - arXiv
Abstract: We pose 22 relatively general questions about quantization in the operator algebra setting. In the process we briefly survey some ...
Read more >
Quiz & Worksheet - Quantization - Study.com
These questions offer you the chance to test your understanding of the quantization of energy. Specifically, you'll be answering questions on key topics ......
Read more >
Questions on Quantization
Give some examples of quantized properties of everyday type things. What property of light is quantized? What is its smallest amount? What properties...
Read more >
College Physics : Energy Quantization - Varsity Tutors
College Physics : Energy Quantization. Study concepts, example questions & explanations for College Physics ... Energy Quantization : Example Question #1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found