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 GPTQ/RTN 3.x example & fix asym quantize #1611

Merged
merged 18 commits into from
Feb 21, 2024
Merged

Conversation

Kaihui-intel
Copy link
Contributor

@Kaihui-intel Kaihui-intel commented Feb 18, 2024

Type of Change

bug fix

Description

asym quant:

    weight.div_(scale)
    weight.round_()
 +  weight.add_(zp)
    weight.clamp_(0, maxq)

equivalent to

q = torch.clamp(torch.round(weight / scale) + zp, 0, maxq)

Expected Behavior & Potential Risk

the expected behavior that triggered by this PR

How has this PR been tested?

how to reproduce the test (including hardware information)

Dependency Change?

any library dependency introduced or removed

@Kaihui-intel Kaihui-intel added INC3.X PyTorch Related to PyTorch F/W labels Feb 18, 2024
@Kaihui-intel Kaihui-intel changed the title Fix GPTQ/RTN 3.x example Fix GPTQ/RTN 3.x example & fix asym quantize Feb 20, 2024
@Kaihui-intel Kaihui-intel merged commit 813d930 into master Feb 21, 2024
22 checks passed
@Kaihui-intel Kaihui-intel deleted the kaihui/gptq_eg branch February 21, 2024 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INC3.X PyTorch Related to PyTorch F/W
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants