coreai_opt.pruning.ModuleMagnitudePrunerConfig¶
- class coreai_opt.pruning.ModuleMagnitudePrunerConfig[source]¶
Bases:
WeightOnlyModuleValidationMixin,ModuleCompressionConfig[OpMagnitudePrunerConfig, PruningSpec]Module-level pruning configuration.
Manages pruning settings for an entire module, following the same hierarchical precedence as other compression configs:
op_name_config(most specific)op_type_configop_state_spec(least specific)
- op_state_spec¶
Default pruning specs for state tensors in this module.
- Type:
dict[str, PruningSpec | None] | None
- op_type_config¶
Per-op-type overrides.
- Type:
dict[str, OpMagnitudePrunerConfig]
- op_name_config¶
Per-op-name overrides.
- Type:
dict[str, OpMagnitudePrunerConfig]
- module_state_spec¶
Specs applied across all ops in the module.
- Type:
dict[str, PruningSpec | None] | None
- sparsity_schedule¶
Optional sparsity schedule. When set, the
pruner.step()API drives sparsity over training steps; whenNone(default), the spec’starget_sparsityis applied immediately and statically.- Type:
SparsityScheduleBase | None