Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantization Aware Training #12055

Open
HanXuMartin opened this issue Dec 2, 2024 · 2 comments
Open

Quantization Aware Training #12055

HanXuMartin opened this issue Dec 2, 2024 · 2 comments
Assignees

Comments

@HanXuMartin
Copy link

Is there any instructions on how to do QAT in mmdetection ?

@Brendan-Richards
Copy link

Not an mmdet developer, but I've looked into this recently. As far as I can tell there's no support for QAT (or PTQ) in mmdetection. You can try using mmrazor, which is their model compression library, but it doesn't seem to be maintained and I was unable to get it to work with mmdetection for my use case.

I ultimately got QAT to work by using Nvidia's quantization library for pytorch and manually inserting quantization ops in my mmdet model definition. You could also consider using pytorch's quantization library.

Unfortunately I can't share any of my custom code as it's proprietary, but good luck to you.

@HanXuMartin
Copy link
Author

Not an mmdet developer, but I've looked into this recently. As far as I can tell there's no support for QAT (or PTQ) in mmdetection. You can try using mmrazor, which is their model compression library, but it doesn't seem to be maintained and I was unable to get it to work with mmdetection for my use case.

I ultimately got QAT to work by using Nvidia's quantization library for pytorch and manually inserting quantization ops in my mmdet model definition. You could also consider using pytorch's quantization library.

Unfortunately I can't share any of my custom code as it's proprietary, but good luck to you.

Thanks for your reply.
I also inserted QuantStub and DeQuantStub in to my model, well I don't know if they are effective. I also noticed that in the Pytorch documents, quant config is set before the training loop, which means I need to insert this part of code in the runner of mmengine, but I don't want to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants