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

Serialize Config from Model #7

Merged
merged 14 commits into from
Apr 16, 2024
Merged

Serialize Config from Model #7

merged 14 commits into from
Apr 16, 2024

Conversation

Satrat
Copy link
Contributor

@Satrat Satrat commented Apr 12, 2024

  • add from_pretrained method to QuantizationConfig that creates a config from a model by iterating through the QuantizationSchemes. Simplifies ignore list as much as possible
  • added helper function for calculating global compression ratio of config
  • unit test serializing a full config

quant_scheme_to_layers = []
quantization_status = None
ignore = []
for name, submodule in iter_named_leaf_modules(model):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See TODO comment about allowing for exceptions in leaf nodes for observers. This will be relevant for non frozen quantized models

src/sparsetensors/quantization/utils/helpers.py Outdated Show resolved Hide resolved
Base automatically changed from apply-config to main April 15, 2024 15:13
@Satrat Satrat changed the title [DRAFT] WIP for serializing config Serialize Config from Model Apr 16, 2024
@Satrat Satrat marked this pull request as ready for review April 16, 2024 13:52
@bfineran bfineran merged commit edc35a1 into main Apr 16, 2024
2 checks passed
@bfineran bfineran deleted the serialize_config branch April 16, 2024 19:30
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

Successfully merging this pull request may close these issues.

2 participants