-
Notifications
You must be signed in to change notification settings - Fork 47
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
align torch and keras gptq tutorials #1123
base: main
Are you sure you want to change the base?
Conversation
"This is achieved through an optimization process applied post-quantization, specifically adjusting the rounding of quantized weights.\n", | ||
"GPTQ is especially effective after mixed precision quantization. \n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be more accurate: GPTQ is especially effective in case of low bit width quantization and mixed precision quantization.
"collapsed": false | ||
}, | ||
"id": "2c13aff20d208c51" | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unify the sequence of code sections into single section..
" os.makedirs(target_dir / lbl)\n", | ||
" \n", | ||
" for img_file, lbl in zip(sorted(os.listdir(imgs_dir)), labels):\n", | ||
" shutil.move(imgs_dir / img_file, target_dir / lbl)\n" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've already added such imagenet extractor to: tutorials/notebooks/imx500_notebooks/keras/example_keras_mobilenetv2_for_imx500.ipynb
we need to align.
"\n", | ||
"Please ensure that the dataset path has been set correctly." | ||
"In this tutorial we use the same representative dataset for both statistics collection and GPTQ. A complete pass through the representative dataset generator constitutes an epoch (batch_size x n_iter samples). In this example we use the same dataloader iterator for all epochs, i.e. different images are used in different epochs." | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good explanation, but I'd consider to make it shorter or divide it to bullets:
subtitle: representative dataset
Create a generator for the representative dataset ....
A word on GPTQ representative dataset:
- GPTQ is a gradient-base...
- In this tutorial we use the same representative dataset..
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"from model_compression_toolkit.gptq.common.gptq_constants import REG_DEFAULT\n", | ||
"# Create a GPTQ quantization configuration and set the number of training iterations. \n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be good to move "import model_compression_toolkit" to this section, to emphasize that we start using the MCT here.
" !wget https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar\n", | ||
" !mv ILSVRC2012_img_val.tar imagenet/" | ||
" !wget -P imagenet https://image-net.org/data/ILSVRC/2012/ILSVRC2012_devkit_t12.tar.gz\n", | ||
" !wget -P imagenet https://image-net.org/data/ILSVRC/2012/ILSVRC2012_img_val.tar" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice! same textual comments for the pythorch..
@irenaby |
Pull Request Description:
Checklist before requesting a review: