Skip to content
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

Fix (llm): add checks for group dimensions #751

Closed
wants to merge 1 commit into from

Conversation

Giuseppe5
Copy link
Collaborator

No description provided.

@@ -32,22 +32,22 @@ class WeightSymmetricGroupQuantMixin(ExtendedInjector):
@value
def expanded_scaling_shape(module, block_size):
if isinstance(module, nn.Conv2d):
return module.weight.size(0), module.weight.size(1) // block_size, block_size, module.weight.size(2), module.weight.size(3)
return module.weight.size(0), (module.weight.size(1) + block_size - 1) // block_size, block_size, module.weight.size(2), module.weight.size(3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just put an assert to check that the block size divides size(1) of the weights.

@Giuseppe5 Giuseppe5 closed this Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants