diff --git a/examples/qualcomm/oss_scripts/llama/static_llm_quant_recipe.py b/examples/qualcomm/oss_scripts/llama/static_llm_quant_recipe.py index 4eecf308f88..ccfcb0c2c23 100644 --- a/examples/qualcomm/oss_scripts/llama/static_llm_quant_recipe.py +++ b/examples/qualcomm/oss_scripts/llama/static_llm_quant_recipe.py @@ -103,7 +103,7 @@ def __init__(self, verbose: bool = False): granularity=QuantGranularity.PER_CHANNEL, ) .add_regex( - {r"layers\..*\.attention\.wv.*"}, + {r"layers\..*\.attention\..*wv.*"}, QuantDtype.use_8a4w, False, act_observer=MinMaxObserver, @@ -150,7 +150,7 @@ def __init__(self, verbose: bool = False): .add_regex( { r"output\.conv", - r"layers\.[0-3]\.feed_forward\.w2_conv", + r"layers\.[0-3]\.feed_forward\..*w2_conv", }, QuantDtype.use_16a8w, False, @@ -189,7 +189,7 @@ def __init__(self, verbose: bool = False): .add_regex( { r"output\.conv", - r"layers\.2[1-7]\.feed_forward\.w2_conv", + r"layers\.2[1-7]\.feed_forward\..*w2_conv", }, QuantDtype.use_16a8w, False, @@ -249,7 +249,7 @@ def __init__(self, verbose: bool = False): ) .add_regex( { - r"layers\..*\.attention\.wv.*", + r"layers\..*\.attention\..*wv.*", r"output\.conv", }, QuantDtype.use_16a8w, @@ -287,7 +287,7 @@ def __init__(self, verbose: bool = False): ) .add_regex( { - r"layers\..*\.attention\.wv.*", + r"layers\..*\.attention\..*wv.*", }, QuantDtype.use_16a8w, False, @@ -324,7 +324,7 @@ def __init__(self, verbose: bool = False): ) .add_regex( { - r"layers\..*\.attention\.wv.*", + r"layers\..*\.attention\..*wv.*", }, QuantDtype.use_16a8w, False, @@ -396,7 +396,7 @@ def __init__(self, verbose: bool = False): ) .add_regex( { - r"layers\..*\.attention\.wv.*", + r"layers\..*\.attention\..*wv.*", }, QuantDtype.use_16a8w, False, @@ -433,9 +433,9 @@ def __init__(self, verbose: bool = False): ) .add_regex( { - r"layers\..*\.attention\.wv.*", - r"layers\..*\.feed_forward\.w3_conv", - r"layers\..*\.feed_forward\.w2_conv", + r"layers\..*\.attention\..*wv.*", + r"layers\..*\.feed_forward\..*w3_conv", + r"layers\..*\.feed_forward\..*w2_conv", r"output\.conv", }, QuantDtype.use_16a8w, @@ -494,7 +494,7 @@ def __init__(self, verbose: bool = False): extra_kwargs={"block_size": (1, 16, 1, 1)}, ) .add_regex( - {r"layers\..*\.attention\.wv.*"}, + {r"layers\..*\.attention\..*wv.*"}, QuantDtype.use_8a4w, False, act_observer=MinMaxObserver, @@ -596,7 +596,7 @@ def __init__(self, verbose: bool = False): ) .add_regex( { - r"layers\..*\.feed_forward\.w2_conv", + r"layers\..*\.feed_forward\..*w2_conv", }, QuantDtype.use_16a8w, False, @@ -693,9 +693,9 @@ def __init__(self, verbose: bool = False): ) .add_regex( { - r"layers\..*\.attention\.wq.*", - r"layers\..*\.attention\.wk.*", - r"layers\..*\.attention\.wv.*", + r"layers\..*\.attention\..*wq.*", + r"layers\..*\.attention\..*wk.*", + r"layers\..*\.attention\..*wv.*", }, QuantDtype.use_16a8w, False,