Skip to content

Commit

Permalink
lint (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
omry committed Feb 20, 2020
1 parent 45ba5e3 commit 5f8d689
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -38,7 +38,7 @@ def manipulate_search_path(self, search_path: ConfigSearchPath) -> None:


class JoblibLauncher(Launcher):
def __init__(self, joblib: Dict[str, Any] = {}) -> None:
def __init__(self, joblib: DictConfig) -> None:
"""Joblib Launcher
Launches parallel jobs using Joblib.Parallel. For details, refer to:
Expand Down Expand Up @@ -79,12 +79,13 @@ def launch(self, job_overrides: Sequence[Sequence[str]]) -> Sequence[JobReturn]:

# Joblib's backend is hard-coded to loky since the threading
# backend is incompatible with Hydra
joblib_keywords = OmegaConf.to_container(self.joblib, resolve=True)
joblib_keywords["backend"] = "loky"
joblib_cfg = OmegaConf.to_container(self.joblib, resolve=True)
assert isinstance(joblib_cfg, dict)
joblib_cfg["backend"] = "loky"

log.info(
"Joblib.Parallel({}) is launching {} jobs".format(
",".join([f"{k}={v}" for k, v in joblib_keywords.items()]),
",".join([f"{k}={v}" for k, v in joblib_cfg.items()]),
len(job_overrides),
)
)
Expand All @@ -94,7 +95,7 @@ def launch(self, job_overrides: Sequence[Sequence[str]]) -> Sequence[JobReturn]:

singleton_state = Singleton.get_state()

runs = Parallel(**joblib_keywords)(
runs = Parallel(**joblib_cfg)(
delayed(execute_job)(
idx,
overrides,
Expand Down

0 comments on commit 5f8d689

Please sign in to comment.