compression_target
compression_target
¶
Compression target defining preparation and pruning for a policy submodule.
CompressionTarget
¶
Stores preparation and pruning components for one PyTorch submodule.
Initialize compression components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
module_path
|
str
|
Dotted path to the target submodule, or empty string for the full policy. |
required |
preparation
|
PreparationConfig | None
|
BN replacement and fusion settings. |
None
|
pruning
|
list[BasePruner] | None
|
Pruning strategies to apply sequentially. |
None
|
Source code in src/versatil/post_training_compression/compression_target.py
overlaps
¶
Return whether two targets can select the same submodule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
CompressionTarget
|
Target to compare against this target. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether either target is root, both targets are the same path, or |
bool
|
one target is nested under the other. |