-
Notifications
You must be signed in to change notification settings - Fork 832
Metal backend: fix linear_filter in test_modules #17253
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17253
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 123 PendingAs of commit cf89a2b with merge base 20703d0 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
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 in the linear_filter function used for Metal backend int4 quantization. The old filter logic incorrectly validated that the weight dimension K must be divisible by the group_size (e.g., K % 32 == 0), but the Metal backend actually only requires K to be divisible by 8. This would have incorrectly prevented quantization of valid layers (e.g., layers with K=8 and group_size=32).
Changes:
- Fixed validation logic to check K % 8 instead of K % group_size
- Changed from silent filtering to explicit error handling with helpful error messages
- Added validation to reject group_size=0 early with a clear error message
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.