-
Notifications
You must be signed in to change notification settings - Fork 162
Use model compression pathways #1419
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
Conversation
Signed-off-by: Kyle Sayers <[email protected]>
👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review. Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed. |
Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
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.
exciting!
…1449) ## Purpose ## * Prerequisite for #1419 * This PR disables getting the offloaded state dict unless necessary (sparsity statistics). However, the utility function `cpu_offload` only works if the offloaded state dict is retrieved. Let's replace this with `dispatch_model`, which is the actual function used by `PretrainedModel`, not `cpu_offload` ## Changes ## * Rename `device_map` to `device` * Use `dispatch_model` rather than `cpu_offload` * Use `align_module_device` and `update_offload_parameter` utilities * This change is necessary because, after these changes, some of these test models no longer have offloaded state dicts (which is the way it should always have been) Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
Nightly is passing |
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.
good stuff!
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Purpose
save_pretrained
manuallyFixes
Prerequisites
test_compress_tensor_utils
#1449Changes
save_pretrained_wrapper
to usecompress_model(model)
rather thancompress(state_dict)
save_pretrained_wrapper
so that the state dict is only retrieved if not skipping compression statssave_pretrained_wrapper
to save dictionary and python files, even if there is no explicit compressorsave_checkpoint
(used by training) to decompress after the checkpoint is savedExample/Testing Changes
Below lists all of the instances where a model undergoes saving (no immediately followed by script
test_oneshot_and_finetune.py
tests/llmcompressor/transformers/obcq/test_obcq_completion.py
test_oneshot_and_finetune_with_tokenizer.py
dispatch_model
(which is actually used by transformers) rather thancpu_offload
Testing
oneshot_save.py
Testing