# Buggy code
def launch(self, job_overrides):
    setup_globals()
    configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose)
    sweep_dir = self.config.hydra.sweep.dir
    Path(str(sweep_dir)).mkdir(parents=True, exist_ok=True)
    log.info("Launching {} jobs locally".format(len(job_overrides)))
    log.info("Sweep output dir : {}".format(sweep_dir))
    runs = []

    for idx, overrides in enumerate(job_overrides):
        log.info("\t#{} : {}".format(idx, " ".join(filter_overrides(overrides))))
        sweep_config = self.config_loader.load_sweep_config(
            self.config, list(overrides)
        )
        with open_dict(sweep_config):
            sweep_config.hydra.job.id = idx
            sweep_config.hydra.job.num = idx
            sweep_config.hydra.job.override_dirname = get_overrides_dirname(
                sweep_config.hydra.overrides.task
            )
        HydraConfig().set_config(sweep_config)

        runs.append(
            run_job(
                config=sweep_config,
                task_function=self.task_function,
                job_dir_key="hydra.sweep.dir",
                job_subdir_key="hydra.sweep.subdir",
            )
        )
        configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose)
    return runs


# Traceback (KeyError)
(tutorial_env) dasneha@devfair0254:~/tutorials/hydra$ python my_app.py -m exp=1,2
Traceback (most recent call last):
File "my_app.py", line 7, in <module>
my_app()
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/main.py", line 25, in decorated_main
strict,
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/utils.py", line 52, in run_hydra
hydra.multirun(overrides=args.overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 113, in multirun
cfg = self._load_config(overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 259, in _load_config
cfg = self.config_loader.load_configuration(overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 66, in load_configuration
cfg.merge_with_dotlist(remaining_overrides)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/config.py", line 240, in merge_with_dotlist
self.update(key, value)
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/config.py", line 260, in update
root[last] = value
File "/private/home/dasneha/.conda/envs/tutorial_env/lib/python3.7/site-packages/omegaconf/dictconfig.py", line 28, in __setitem__
raise KeyError("Accessing unknown key in a struct : {}".format(self.get_full_key(key)))
KeyError: 'Accessing unknown key in a struct : exp'

# Fixed code
def launch(self, job_overrides):
    setup_globals()
    configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose)
    sweep_dir = self.config.hydra.sweep.dir
    Path(str(sweep_dir)).mkdir(parents=True, exist_ok=True)
    log.info("Launching {} jobs locally".format(len(job_overrides)))
    log.info("Sweep output dir : {}".format(sweep_dir))
    runs = []

    for idx, overrides in enumerate(job_overrides):
        log.info("\t#{} : {}".format(idx, " ".join(filter_overrides(overrides))))
        sweep_config = self.config_loader.load_sweep_config(
            self.config, list(overrides)
        )
        with open_dict(sweep_config):
            sweep_config.hydra.job.id = idx
            sweep_config.hydra.job.num = idx
            sweep_config.hydra.job.override_dirname = get_overrides_dirname(
                sweep_config.hydra.overrides.task
            )
        HydraConfig().set_config(sweep_config)
        ret = run_job(
            config=sweep_config,
            task_function=self.task_function,
            job_dir_key="hydra.sweep.dir",
            job_subdir_key="hydra.sweep.subdir",
        )
        runs.append(ret)
        configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose)
    return runs