From b811e5403dfdc71f914ac0284874b5ebfed7ee53 Mon Sep 17 00:00:00 2001 From: elad-c Date: Tue, 21 Jan 2025 14:21:49 +0200 Subject: [PATCH] MaxCut initial commit --- .../core/common/graph/memory_graph/max_cut_astar.py | 3 ++- .../common/mixed_precision/solution_refinement_procedure.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/model_compression_toolkit/core/common/graph/memory_graph/max_cut_astar.py b/model_compression_toolkit/core/common/graph/memory_graph/max_cut_astar.py index fc9e05d08..2c121fd4c 100644 --- a/model_compression_toolkit/core/common/graph/memory_graph/max_cut_astar.py +++ b/model_compression_toolkit/core/common/graph/memory_graph/max_cut_astar.py @@ -151,7 +151,8 @@ def solve(self, estimate: float, iter_limit: int = 500, time_limit: int = None) t1 = time() while expansion_count < iter_limit and len(open_list) > 0: if time_limit is not None and time() - t1 > time_limit: - raise TimeoutError + # TODO: add test for this. + raise TimeoutError # pragma: no cover # Choose next node to expand next_cut = self._get_cut_to_expand(open_list, costs, routes, estimate) diff --git a/model_compression_toolkit/core/common/mixed_precision/solution_refinement_procedure.py b/model_compression_toolkit/core/common/mixed_precision/solution_refinement_procedure.py index 8b3c35597..76a090d6e 100644 --- a/model_compression_toolkit/core/common/mixed_precision/solution_refinement_procedure.py +++ b/model_compression_toolkit/core/common/mixed_precision/solution_refinement_procedure.py @@ -68,7 +68,7 @@ def greedy_solution_refinement_procedure(mp_solution: List[int], node_candidates = current_node.candidates_quantization_cfg # only weights kernel attribute is quantized with weights mixed precision - kernel_attr = search_manager.fw_info.get_kernel_op_attributes(current_node) + kernel_attr = search_manager.fw_info.get_kernel_op_attributes(current_node.type) kernel_attr = None if kernel_attr is None else kernel_attr[0] valid_candidates = _get_valid_candidates_indices(node_candidates, new_solution[node_idx], kernel_attr)