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

W4A4 precision #24

Open
leiwen83 opened this issue Oct 27, 2021 · 3 comments
Open

W4A4 precision #24

leiwen83 opened this issue Oct 27, 2021 · 3 comments

Comments

@leiwen83
Copy link

Hi,

I tried quant resnet50 in w8a8 mode, and it achieve good result to 77%, but when I switch to test W4A4, using below command, its accary drop to :
Acc@1 34.898 Acc@5 56.298

python quant_train.py -a resnet50 --epochs 1 --lr 0.0001 --batch-size 128 --data /mnt/imagenet/imagenet/ --pretrained --save-path out/ --act-range-momentum=0.99 --wd 1e-4 --data-percentage 0.0001 --fix-BN --checkpoint-iter -1 --quant-scheme uniform4

So whether I need to change number to like learning rate to get higher rate that being reported?

@ccw-li
Copy link

ccw-li commented Nov 11, 2021

I have a similar problem.

When I try to quantize RESNET18 in W4A4 mode, the accuracy is very low: Acc@1 8.634 Acc@5 19.218

Am I running the quantization command correctly?

Thanks in advance.

My command:
export CUDA_VISIBLE_DEVICES=0
python quant_train.py -a resnet18 --epochs 1 --lr 0.0001 --batch-size 128 --data ~/datasets/imagenet/jpegs --pretrained --save-path ./checkpoints/ --act-range-momentum=0.99 --wd 1e-4 --data-percentage 0.0001 --fix-BN --checkpoint-iter -1 --quant-scheme uniform4
My environment:
centos7 + RTX8000 GPU

@jiangaojie
Copy link

I meet the same problem! Can you solve this problem? Thanks

@ngrxmu
Copy link

ngrxmu commented May 23, 2022

Try to replace some parameters in the command as follows:
--epochs 90
--data-percentage 1
This is the complete training.

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

4 participants