Skip to content

Commit 842aead

Browse files
committed
Add RoBERTa support to DQ smoothquant function
Signed-off-by: Andrea Fasoli <[email protected]>
1 parent f5f49d6 commit 842aead

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fms_mo/utils/dq_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,15 @@ def config_quantize_smooth_layers(qcfg: dict):
115115
qcfg["smoothq_act_scale_path"] = "./act_scales/graniteCodeHF_34b_base12.pt"
116116
if "granite-34b-code-instruct" in qcfg["model"]:
117117
qcfg["smoothq_act_scale_path"] = "./act_scales/graniteCodeHF_34b_base12.pt"
118+
elif "roberta" in qcfg["model"]:
119+
qcfg["act_scale_path"] = "./act_scales"
120+
qcfg["scale_layers"] = [
121+
"attention.self.query",
122+
"attention.self.key",
123+
"attention.self.value",
124+
"intermediate.dense",
125+
]
126+
qcfg["qskip_layer_name"] = []
127+
qcfg["qlayer_name_pattern"] = ["roberta.encoder"]
118128
else:
119129
raise ValueError("The model architecture is not supported for DQ.")

0 commit comments

Comments
 (0)