From 12b30c14e50ae705ff7930a19b660f18fed6723f Mon Sep 17 00:00:00 2001 From: "Meng, Yan" Date: Wed, 18 Oct 2023 11:29:45 -0700 Subject: [PATCH 1/2] added folded_compilation option in SolverConfig --- src/lava/lib/optimization/solvers/generic/solver.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lava/lib/optimization/solvers/generic/solver.py b/src/lava/lib/optimization/solvers/generic/solver.py index 79b55998..6cc157c8 100644 --- a/src/lava/lib/optimization/solvers/generic/solver.py +++ b/src/lava/lib/optimization/solvers/generic/solver.py @@ -173,6 +173,7 @@ class SolverConfig: probe_time: bool = False probe_energy: bool = False log_level: int = 40 + folded_compilation: bool = False @dataclass(frozen=True) @@ -272,7 +273,11 @@ def solve(self, config: SolverConfig = SolverConfig()) -> SolverReport: An object containing all the data generated by the execution. """ run_condition, run_cfg = self._prepare_solver(config) - self.solver_process.run(condition=run_condition, run_cfg=run_cfg) + folded_compile_config = None + if config.folded_compilation: + folded_compile_config = {'folded_view' : ['SolutionFinder']} + self.solver_process.run(condition=run_condition, run_cfg=run_cfg, + compile_config=folded_compile_config) best_state, best_cost, best_timestep = self._get_results(config) cost_timeseries, state_timeseries = self._get_probing(config) self.solver_process.stop() From 5037132e581c901fae491cb0dfba03c5391ae69a Mon Sep 17 00:00:00 2001 From: "Meng, Yan" Date: Thu, 19 Oct 2023 08:44:52 -0700 Subject: [PATCH 2/2] added docstring for folded_compilation option in SolverConfig --- src/lava/lib/optimization/solvers/generic/solver.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lava/lib/optimization/solvers/generic/solver.py b/src/lava/lib/optimization/solvers/generic/solver.py index 6cc157c8..8e235583 100644 --- a/src/lava/lib/optimization/solvers/generic/solver.py +++ b/src/lava/lib/optimization/solvers/generic/solver.py @@ -162,6 +162,9 @@ class SolverConfig: backend. log_level: int Select log verbosity (40: default, 20: verbose). + folded_compilation: bool + A boolean flag to enable folded compilation, available only on + "Loihi2" backend. Default value is False. """ timeout: int = 1e3