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.08k stars 148 forks source link

Fix Consecutive Recipe Application Test #2255

Closed Satrat closed 7 months ago

Satrat commented 7 months ago

The update to pydantic V2 deleted a feature of recipe export that would resolve clashing stage names. This caused tests/sparseml/transformers/obcq/test_repeats.py:test_consecutive_runs() to fail because we apply two recipes with stages labeled test_stage, and the stage name keys must be unique for serialization.

Fixed by adding the old indexing code back in to the refactored export code and the unit test now passes