From 5a2b8ccedbdf5393a02436f769eb1dbed8d84fa3 Mon Sep 17 00:00:00 2001 From: Mourad Gouicem Date: Tue, 14 Oct 2025 02:25:25 -0700 Subject: [PATCH] scripts: update converter with quantization mode --- scripts/verbose_converter/src/benchdnn_generator.py | 2 ++ scripts/verbose_converter/src/ir.py | 1 + scripts/verbose_converter/src/parse.py | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/verbose_converter/src/benchdnn_generator.py b/scripts/verbose_converter/src/benchdnn_generator.py index 39d84274c3..51e1384dae 100644 --- a/scripts/verbose_converter/src/benchdnn_generator.py +++ b/scripts/verbose_converter/src/benchdnn_generator.py @@ -195,6 +195,8 @@ class Converter(metaclass=ConverterMeta): # Set policy to "host_scalar" if is_host_scalar is True if param.is_host_scalar: policy = "host_scalar" + if param.quantization_mode == "dynamic_mx": + policy = "mx" result = f"{arg}:{policy}" if policy == "common" or policy == "host_scalar": result += f":{def_value}" diff --git a/scripts/verbose_converter/src/ir.py b/scripts/verbose_converter/src/ir.py index 0cdfc98ce3..5c62c7b965 100644 --- a/scripts/verbose_converter/src/ir.py +++ b/scripts/verbose_converter/src/ir.py @@ -307,6 +307,7 @@ class QuantizationParam(Mapping): mask: int = 0 groups: str = "" is_host_scalar: bool = False + quantization_mode: str = "" def __str__(self): if self.groups: diff --git a/scripts/verbose_converter/src/parse.py b/scripts/verbose_converter/src/parse.py index d1c336f66b..097c2b17e8 100644 --- a/scripts/verbose_converter/src/parse.py +++ b/scripts/verbose_converter/src/parse.py @@ -411,7 +411,7 @@ class ParserImpl: @staticmethod def parse_quantization_param(spec, read_value, param_type): # Old style: mask[:[value[*]|*]] - # New style: mask[:data_type[:groups]] + # New style: mask[:data_type[:host_scalar[:groups[:quantization_mode]]]] param = param_type() param.mask = spec.read_uint() if spec.read_literal(":"): @@ -429,6 +429,9 @@ class ParserImpl: param.is_host_scalar = True else: param.groups = groups_or_host_flag + if spec.read_literal(":"): + param.quantization_mode = spec.read_str() + return param # v2.7 and below