neuralmagic / sparseml

Libraries for applying sparsification recipes to neural networks with a few lines of code, enabling faster and smaller models
Apache License 2.0
2.07k stars 148 forks source link

[Quantization] Add alias mapping for target types (fixes SiLU name change issue) #2214

Closed bfineran closed 7 months ago

bfineran commented 7 months ago

transformers recently updated usage of SiLU to the SiLUActivation class. When upgrading transformers this will cause backwards compatibility issues with existing recipes.

This PR proposes a fix by adding class alias support in quantization modifier name matching. Any reference to SiLU in a recipe will now also check for SiLUActivation

test_plan: @dbogunowicz to revert test patches in https://github.com/neuralmagic/sparseml/pull/2204 to test this PR

bfineran commented 7 months ago

@dbogunowicz to revert test patches in #2204 to test this PR