Fix grid search stopping condition in local controller
@@ -608,22 +608,26 @@ class _WandbController:
self._start_if_not_started()
return self._stopping()
- def schedule(self, run: sweeps.SweepRun) -> None:
+ def schedule(self, run: Optional[sweeps.SweepRun]) -> None:
self._start_if_not_started()
# only schedule one run at a time (for now)
if self._controller and self._controller.get("schedule"):
return
+ schedule_id = _id_generator()
+
+ if run is None:
+ schedule_list = [{"id": schedule_id, "data": {"args": None}}]
+ else:
param_list = [
"%s=%s" % (k, v.get("value")) for k, v in sorted(run.config.items())
]
self._log_actions.append(("schedule", ",".join(param_list)))
# schedule one run
- schedule_list = []
- schedule_id = _id_generator()
- schedule_list.append({"id": schedule_id, "data": {"args": run.config}})
+ schedule_list = [{"id": schedule_id, "data": {"args": run.config}}]
+
self._controller["schedule"] = schedule_list
self._sweep_object_sync_to_backend()
