Skip to content

Commit

Permalink
Fix merge bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
liord committed Mar 19, 2024
1 parent baa0788 commit 4c77907
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def set_bit_widths(mixed_precision_enable: bool,

def _get_node_qc_by_bit_widths(node: BaseNode,
bit_width_cfg: List[int],
node_index_in_graph: int) -> Any:
node_index_in_graph: int,
fw_info) -> Any:
"""
Get the node's quantization configuration that
matches to the bit width index as in the MP configuration bit_width_cfg.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ def get_trainable_quantizer_quantization_candidates(n: BaseNode, attr: str = Non
"""

if attr is not None:
# all candidates must have the same weights quantization method
weights_quantization_methods = set([cfg.weights_quantization_cfg.weights_quantization_method for cfg in n.candidates_quantization_cfg])
if len(weights_quantization_methods) > 1:
Logger.critical(f"Invalid 'candidates_quantization_cfg': Inconsistent weights "
f"quantization methods detected: {weights_quantization_methods}. "
f"Trainable quantizer requires all candidates to have the same weights "
f"quantization method.") # pragma: no cover
# all candidates must have the same weights quantization method
weights_quantization_methods = set([cfg.weights_quantization_cfg.get_attr_config(attr).weights_quantization_method
for cfg in n.candidates_quantization_cfg])
if len(weights_quantization_methods) > 1:
Logger.critical(f"Invalid 'candidates_quantization_cfg': Inconsistent weights "
f"quantization methods detected: {weights_quantization_methods}. "
f"Trainable quantizer requires all candidates to have the same weights "
f"quantization method.") # pragma: no cover

# all candidates must have the same activation quantization method
activation_quantization_methods = set([cfg.activation_quantization_cfg.activation_quantization_method
Expand Down

0 comments on commit 4c77907

Please sign in to comment.