-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add checkpoint to quantize #28612
Add checkpoint to quantize #28612
Conversation
Thanks for your contribution! |
def init_data(self): | ||
self.bs = 8 | ||
self.d_type = np.float32 | ||
self.shape_x = [12, 1, 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some time ago, baidu require test dimension to be over 100? Maybe self.shape_x = [12, 1, 10]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I changed.
self.enable_mkldnn = True | ||
|
||
def test_check_output(self): | ||
self.enable_mkldnn = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two self.enable_mkldnn = True
, the one in the init_data(self)
is enough
The test shows that if self.check_output_with_option(use_gpu, flatten=True, bfloat16=False)
then this test will do automatically float32? I thought settings should be done in init, before checking output. like self.enable_mkldnn_bfloat = True
, But both are fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree that just adding self.enable_mkldnn_bfloat = True
will be better solution.
LGTM |
PR types
Bug fixes
PR changes
OPs
Describe
This PR :
quantize op
where new attributebfloat16
was added.cpu_bfloat16_pass
which is related to the change inquantize op
.InferencePassTest
, which allowed applying cpu_bfloat16_pass to the graph