Skip to content

Commit

Permalink
Override when candidate is absent in op level supported kernel (#2622)
Browse files Browse the repository at this point in the history
* Override when candidate is absent in ops supported kernels

Signed-off-by: Chetan Gulecha <quic_cgulecha@quicinc.com>

* Removed redundant check while searching user dtype in supported kernels

Signed-off-by: Chetan Gulecha <quic_cgulecha@quicinc.com>

---------

Signed-off-by: Chetan Gulecha <quic_cgulecha@quicinc.com>
  • Loading branch information
quic-cgulecha authored Dec 27, 2023
1 parent df6d822 commit ab0ed37
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,9 @@ def _apply_overrides_for_op(self, op_config: OpType, quantizer_data):
# b. op has no params : no override.
# --------------------------------------------------------------------------------------------------- #

if not is_current_config_same_as_override_option(
QuantDtypeBwInfo(self._default_data_type, self._default_output_bw, self._default_data_type,
self._default_param_bw),
op_config[ConfigDictKeys.SUPPORTED_KERNELS]):
quant_dtype_bw_info = QuantDtypeBwInfo(self._default_data_type, self._default_output_bw, self._default_data_type,
self._default_param_bw)
if not current_config_in_supported_kernels(quant_dtype_bw_info, op_config[ConfigDictKeys.SUPPORTED_KERNELS]):
act_bw = op_config[ConfigDictKeys.SUPPORTED_KERNELS][DEFAULT_OVERRIDE_SUPPORTED_KERNEL_INDEX][
ConfigDictKeys.ACTIVATION][ConfigDictKeys.BITWIDTH]
act_dtype = op_config[ConfigDictKeys.SUPPORTED_KERNELS][DEFAULT_OVERRIDE_SUPPORTED_KERNEL_INDEX][
Expand Down Expand Up @@ -622,8 +621,8 @@ def current_config_in_supported_kernels(current_dtype_bw: QuantDtypeBwInfo, supp
if param_config[ConfigDictKeys.DTYPE] == current_dtype_bw.param_dtype and \
param_config[ConfigDictKeys.BITWIDTH] == current_dtype_bw.param_bw:
return True
return False
return True
else:
return True

return False

Expand Down

0 comments on commit ab0ed37

Please sign in to comment.