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

index unpack problem #101

Closed
laomao0 opened this issue Oct 31, 2024 · 2 comments
Closed

index unpack problem #101

laomao0 opened this issue Oct 31, 2024 · 2 comments

Comments

@laomao0
Copy link
Contributor

laomao0 commented Oct 31, 2024

Hi, there is a small issue in https://github.com/microsoft/VPTQ/blob/main/vptq/layers/vqlinear.py#L519 function,

Line531-539

            # print(f'self.indices shape: {self.indices.shape}')
            indices, res_indices = self.unpack_index_tensor(
                pack_tensor=self.indices,
                index_bits=index_bits,
                num_elements=self.in_features,
                res_bits=index_res_bits,
                num_res_elements=self.in_features,
                index_dtype=torch.uint16,
            )

should be

            # print(f'self.indices shape: {self.indices.shape}')
            indices, res_indices = self.unpack_index_tensor(
                pack_tensor=self.indices,
                index_bits=index_bits,
                num_elements=self.group_size, #here changed
                res_bits=index_res_bits,
                num_res_elements=self.group_size, #here changed
                index_dtype=torch.uint16,
            )

since once the weight is grouped, the packed size from inchannel need also be divided.

@YangWang92
Copy link
Contributor

cool, you can raise an issue as a contributor of the project~

@microsoft microsoft deleted a comment from laomao0 Oct 31, 2024
@YangWang92
Copy link
Contributor

fixed in #103

Thanks!

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

No branches or pull requests

2 participants