Skip to content

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

Signed-off-by: He, Xin3 <xin3.he@intel.com>
@chensuyue chensuyue merged commit b065cfc into master Oct 24, 2023
@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 <xin3.he@intel.com>
Signed-off-by: bmyrcha <bartosz.myrcha@intel.com>
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.

5 participants