Refactor FP8 dequantization and detection using registry pattern #1348
+140
−16
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.
Refactor FP8 dequantization and detection using registry pattern
Summary
Refactors FP8 dequantization and detection logic to use a registry pattern, making FP8 support more explicit, maintainable, and extensible. Pure refactoring - no behavior changes, fully backward compatible.
What Changed
FP8_DEQUANT_REGISTRYwith@register_fp8_layer()decoratorCompressedLinearandFP8Linearhandlersis_fp8_linear()to use registry-first detectionconvert_fp8_layer_to_linear()to use registry dispatchconvert_fp8_model_to_16b_model()to support all registered typesBenefits
Files Changed
auto_round/utils/model.py(only file modified)Type: Refactoring | Breaking: No | Migration: No