Fix ignore_layers not working for FP8 models#1286
Conversation
Co-authored-by: yiliu30 <106061964+yiliu30@users.noreply.github.com>
Co-authored-by: yiliu30 <106061964+yiliu30@users.noreply.github.com>
Co-authored-by: yiliu30 <106061964+yiliu30@users.noreply.github.com>
…rint Co-authored-by: yiliu30 <106061964+yiliu30@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the --ignore_layers argument fails to exclude layers from quantization in FP8 models. The root cause was that get_fp_layer_names() only checked SUPPORTED_LAYER_TYPES but FP8 models contain FP8Linear layers which exist only in INNER_SUPPORTED_LAYER_TYPES.
Changes:
- Updated
get_fp_layer_names()to check bothSUPPORTED_LAYER_TYPESandINNER_SUPPORTED_LAYER_TYPES - Added comprehensive unit tests for layer name matching with regular Linear and FP8Linear layers
- Added integration test validating end-to-end behavior with FP8 models
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| auto_round/compressors/utils.py | Modified get_fp_layer_names() to check both layer type lists, enabling FP8Linear layer detection |
| test/test_cpu/utils/test_compressor_utils.py | Added unit tests covering regular Linear layers, FP8Linear layers, pattern matching, and edge cases |
| test/test_cuda/advanced/test_fp8_input.py | Added integration test validating ignore_layers functionality with FP8 models |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Please fix the pre-commit issue |
Co-authored-by: yiliu30 <106061964+yiliu30@users.noreply.github.com>
Signed-off-by: yiliu30 <yi4.liu@intel.com>
|
LGTM |
|
This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you! |
ignore_layersargument not working for FP8 modelsget_fp_layer_namesonly checksSUPPORTED_LAYER_TYPESwhich doesn't includeFP8Linearget_fp_layer_namesto also checkINNER_SUPPORTED_LAYER_TYPES(FP8Linear)Changes in this commit:
INNER_SUPPORTED_LAYER_TYPESfrom test filetest_none_ignore_layersto test None input handlingOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.