Skip to content

Commit fd30e3a

Browse files
jerryzh168facebook-github-bot
authored andcommitted
Enable quantization for mobilebert (#477)
Summary: Pull Request resolved: #477 Quantized: https://www.internalfb.com/intern/everpaste/?handle=GDQbkxamK5wUoYUDALGrDOPik_tUbsIXAAAB didn't check against fx since the model is not symbolically traceable Reviewed By: cccclai Differential Revision: D49379415 fbshipit-source-id: 57c6361120d1bea6c58f3dad806eb57f3fef3b29
1 parent 5b32d8a commit fd30e3a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

examples/quantization/example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@
4343
def verify_xnnpack_quantizer_matching_fx_quant_model(model_name, model, example_inputs):
4444
"""This is a verification against fx graph mode quantization flow as a sanity check"""
4545

46-
if model_name == "edsr":
46+
if model_name in ["edsr", "mobilebert"]:
4747
# EDSR has control flows that are not traceable in symbolic_trace
48+
# mobilebert is not symbolically traceable with torch.fx.symbolic_trace
4849
return
4950
if model_name == "ic3":
5051
# we don't want to compare results of inception_v3 with fx, since mul op with Scalar

examples/recipes/xnnpack_optimization/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ class OptimizationOptions(object):
2727
"vit": OptimizationOptions(False, True),
2828
"w2l": OptimizationOptions(False, True),
2929
"edsr": OptimizationOptions(True, False),
30+
"mobilebert": OptimizationOptions(True, False),
3031
}

0 commit comments

Comments
 (0)