Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
disable coverage check
Signed-off-by: yiliu30 <[email protected]>
  • Loading branch information
yiliu30 committed Jun 19, 2024
commit 256fc0ad367b864c76646ba06eb4302b7bfb6adb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_filter_fn(node_list, fn):
def is_target_node_in_candidate_list(match, original_graph, pattern_graph):
"""Filter the node with target operator in match and check if it is in `node_list`."""
target_node = None
for node in pattern_graph.nodes:
for node in pattern_graph.nodes: # pragma: no cover
if node.target == target_op:
target_node = node
break
Expand Down Expand Up @@ -162,7 +162,7 @@ def _parse_node_candidate_set_from_user_config(config, gm):
op_type_configs, op_name_configs = config._get_op_name_op_type_config()
op_type_filters = []
op_name_filters = []
for op_type_name, config in op_type_configs.items():
for op_type_name, config in op_type_configs.items(): # pragma: no cover
op_type = getattr(torch.nn, op_type_name)
if config.act_dtype == "fp16": # pragma: no cover
filter = xpq._get_module_type_filter(op_type)
Expand All @@ -173,7 +173,7 @@ def _parse_node_candidate_set_from_user_config(config, gm):
op_name_filters.append(filter)
node_set_from_user_config = set()
all_filters = op_type_filters + op_name_filters
for node in gm.graph.nodes:
for node in gm.graph.nodes: # pragma: no cover
if any([filter(node) for filter in all_filters]):
node_set_from_user_config.add(node)
return node_set_from_user_config
Expand Down
2 changes: 1 addition & 1 deletion neural_compressor/torch/algorithms/pt2e_quant/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create_quant_spec_from_config(dtype, sym, granularity, algo, is_dynamic=Fals

def _map_inc_config_to_torch_quant_config(inc_config, is_dynamic=False) -> QuantizationConfig:
NOT_QUANT_DTYPES = ["fp32", "fp16", "bf16"]
if inc_config.act_dtype in NOT_QUANT_DTYPES and inc_config.w_dtype in NOT_QUANT_DTYPES:
if inc_config.act_dtype in NOT_QUANT_DTYPES and inc_config.w_dtype in NOT_QUANT_DTYPES: # pragma: no cover
return None
default_quant_config = xiq.get_default_x86_inductor_quantization_config(is_dynamic=is_dynamic)
input_act_quant_spec = create_quant_spec_from_config(
Expand Down