[WIP] [Transform] Compress, decompress #333
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
idea: submodule structure handles most serialization for us
let's not couple apply_transform_config with apply_quantization_config, otherwise we'd have potential conflicts with the QuantizationMixin
somehow, we need to allow the model_compressor to know the q_config and t_config. In the case of q_config, it's actually built on the fly. That kinda works for q_config, since all the schemes are present (although you lose config_group names). That wouldn't directly work for t_config, since the schemes are still transparent.
A simple solution would be to move towards a pattern where q_config (and as a subfield, t_config) are attached as an attribute to the mode directly, then grabbed by model_compressor. This seems to make sense, I don't see many downsides
Need to decide if we want to keep the weight submodules in the compressed state. The issue is that, without saving them, then there's no way to go from compressed to decompressed. However, saving them requires extra storage and vllm has to ignore those weights
Let's not keep weight transforms, except when trainable. During decompression, let's add activation hooks (these will need to be added by quantization anyways)