Skip to content

Commit

Permalink
WA for other backends
Browse files Browse the repository at this point in the history
  • Loading branch information
KodiaqQ committed Dec 12, 2024
1 parent 3a9a355 commit c0420c8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nncf/quantization/algorithms/fast_bias_correction/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,15 @@ def apply(

output_fp = self._get_fp_outputs(statistic_points, out_node_name)

extracted_model = self._backend_entity.build_submodel(model, node, input_port_id, 0)
if hasattr(self._backend_entity, "build_submodel"):
extracted_model = self._backend_entity.build_submodel(model, node, input_port_id, 0)
else:
# In case of the matrix multiplication layers, this is crucial to know the correct input port.
input_id = (in_node_name, input_port_id)
# Outputs of the subgraphs for the FastBiasCorrection are the same across the backends.
output_id = (out_node_name, 0)

extracted_model = self._extract_submodel(model_transformer, input_id, output_id)
if extracted_model is None:
nncf_logger.debug(f"Skipping node {node_name} because cant extract submodel")
continue
Expand Down

0 comments on commit c0420c8

Please sign in to comment.