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

Get much higher accuracy than those in your paper. #1

Open
clevercool opened this issue Apr 26, 2021 · 2 comments
Open

Get much higher accuracy than those in your paper. #1

clevercool opened this issue Apr 26, 2021 · 2 comments

Comments

@clevercool
Copy link

Hi,

Thanks for your open-source of the AdaptivFloat. It is an impressive paper.

I implemented your code in Resnet-50 model with imageNet dataset.(https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py)
I quantized 54 layers (including downsample layers) only on weight:
enabling quant: conv1
enabling quant: layer1.0.conv1
enabling quant: layer1.0.conv2
enabling quant: layer1.0.conv3
enabling quant: layer1.0.downsample.0
enabling quant: layer1.1.conv1
enabling quant: layer1.1.conv2
enabling quant: layer1.1.conv3
enabling quant: layer1.2.conv1
enabling quant: layer1.2.conv2
enabling quant: layer1.2.conv3
enabling quant: layer2.0.conv1
enabling quant: layer2.0.conv2
enabling quant: layer2.0.conv3
enabling quant: layer2.0.downsample.0
enabling quant: layer2.1.conv1
enabling quant: layer2.1.conv2
enabling quant: layer2.1.conv3
enabling quant: layer2.2.conv1
enabling quant: layer2.2.conv2
enabling quant: layer2.2.conv3
enabling quant: layer2.3.conv1
enabling quant: layer2.3.conv2
enabling quant: layer2.3.conv3
enabling quant: layer3.0.conv1
enabling quant: layer3.0.conv2
enabling quant: layer3.0.conv3
enabling quant: layer3.0.downsample.0
enabling quant: layer3.1.conv1
enabling quant: layer3.1.conv2
enabling quant: layer3.1.conv3
enabling quant: layer3.2.conv1
enabling quant: layer3.2.conv2
enabling quant: layer3.2.conv3
enabling quant: layer3.3.conv1
enabling quant: layer3.3.conv2
enabling quant: layer3.3.conv3
enabling quant: layer3.4.conv1
enabling quant: layer3.4.conv2
enabling quant: layer3.4.conv3
enabling quant: layer3.5.conv1
enabling quant: layer3.5.conv2
enabling quant: layer3.5.conv3
enabling quant: layer4.0.conv1
enabling quant: layer4.0.conv2
enabling quant: layer4.0.conv3
enabling quant: layer4.0.downsample.0
enabling quant: layer4.1.conv1
enabling quant: layer4.1.conv2
enabling quant: layer4.1.conv3
enabling quant: layer4.2.conv1
enabling quant: layer4.2.conv2
enabling quant: layer4.2.conv3
enabling quant: fc

I only replace the weight tensors using the NumPy function in this repository.
However, the post-training results are much higher than those in your paper.
For example, the 4-bit and 5-bit results of mine are 49.25% and 69.56% (The source accuracy is 76.13% in PyTorch), the paper reported 29.0% and 67.2%.

Is there something about calibration I missed?
Could you provide more details about the implementation?

Thanks!

@ttambe
Copy link
Owner

ttambe commented Apr 26, 2021

Hi, what do you have in the n_exp argument for the 4-bit and 5-bit results?

@clevercool
Copy link
Author

Hi, what do you have in the n_exp argument for the 4-bit and 5-bit results?

3 bits for all.

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

2 participants