-
Notifications
You must be signed in to change notification settings - Fork 75
Fix ignore_layers not working for FP8 models #1286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: yiliu30 <[email protected]>
Co-authored-by: yiliu30 <[email protected]>
Co-authored-by: yiliu30 <[email protected]>
…rint Co-authored-by: yiliu30 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: yiliu30 <[email protected]>
|
LGTM |
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.