Skip to content

Commit

Permalink
Merge branch 'main' into refactor_clust_tsp
Browse files Browse the repository at this point in the history
  • Loading branch information
srrisbud authored Oct 31, 2023
2 parents 04b454e + a03b700 commit b4e670e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/lava/lib/optimization/solvers/generic/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -173,6 +176,7 @@ class SolverConfig:
probe_time: bool = False
probe_energy: bool = False
log_level: int = 40
folded_compilation: bool = False


@dataclass(frozen=True)
Expand Down Expand Up @@ -272,7 +276,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()
Expand Down

0 comments on commit b4e670e

Please sign in to comment.