How to apply torch.quantization.quantize_dynamic for conv2d layer?
Open
Nobody has claimed this yet.
quantization
- Dominant language
- Python
- Stars
- 9.3k
- Forks
- 4.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 4
Description
I am working on quantizing resnet50 model. I tried to use the following command.
quantized_model = torch.quantization.quantize_dynamic(
resnet18, {torch.nn.Conv2d,torch.nn.Linear}, dtype=torch.qint8
)
But only the linear layer has quaantized but not the convolutional layer. Can anyone help me how to dynamically quantize the convolutional layer?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the torch.quantization.quantize_dynamic entry point and reproduce the command using resnet18, Conv2d, and Linear. Check the quantization documentation for supported module types and determine whether the tutorials should clarify the observed behavior; done means the supported behavior and expected result are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100