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 bug in sq torch backend #1342

Merged
merged 1 commit into from
Oct 24, 2023
Merged

fix bug in sq torch backend #1342

merged 1 commit into from
Oct 24, 2023

Conversation

xin3he
Copy link
Contributor

@xin3he xin3he commented Oct 23, 2023

Type of Change

bug fix, related to latest torch modification.

Description

NLPTOOLKIU-861
Fake quantized model for smoothquant on torch backend cannot be reload correctly.

(Pdb) m = torch.nn.quantized.Quantize(1, 0, dtype=torch.uint8)    
(Pdb) m.scale.dtype                                                    
torch.int64  # cannot load float scale
# change it as below
(Pdb) m = torch.nn.quantized.Quantize(1.0, 0, dtype=torch.uint8)       
(Pdb) m.scale.dtype                 
torch.float32

Expected Behavior & Potential Risk

reload model accuracy recover

How has this PR been tested?

local tested

@chensuyue chensuyue merged commit b065cfc into master Oct 24, 2023
44 of 46 checks passed
@chensuyue chensuyue deleted the xinhe/sq branch October 24, 2023 09:30
bmyrcha pushed a commit that referenced this pull request Oct 24, 2023
Signed-off-by: He, Xin3 <[email protected]>
Signed-off-by: bmyrcha <[email protected]>
chensuyue pushed a commit to chensuyue/lpot that referenced this pull request Feb 21, 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.

4 participants