minor fix

This commit is contained in:
Dominik Moritz Roth 2023-07-27 12:49:30 +02:00
parent 6753119c1d
commit b7634384f5

View File

@ -174,6 +174,7 @@ class Slate():
schedulerC = copy.deepcopy(config.get('scheduler', {})) schedulerC = copy.deepcopy(config.get('scheduler', {}))
rep_ids = self._reps_for_job(schedulerC, job_id) rep_ids = self._reps_for_job(schedulerC, job_id)
self.sweep_id = sweep_id self.sweep_id = sweep_id
self._init_sweep(config)
self._fork_processes(config, rep_ids) self._fork_processes(config, rep_ids)
def run_slurm(self, filename, name): def run_slurm(self, filename, name):
@ -184,13 +185,14 @@ class Slate():
s_name = self.consume(slurmC, 'name') s_name = self.consume(slurmC, 'name')
# Pre Validation # Pre Validation
runnerName, _ = self.consume(config, 'runner'), self.consume(config, 'wandb', {}, expand=True) runnerName, _ = self.consume(config, 'runner'), self.consume(copy.deepcopy(config), 'wandb', {}, expand=True)
if self.consume(slurmC, 'pre_validate', True): if self.consume(slurmC, 'pre_validate', True):
Runner = self.runners[runnerName] Runner = self.runners[runnerName]
runner = Runner(self, config) runner = Runner(self, config)
runner.setup() runner.setup()
self._init_sweep(config) self._init_sweep(config)
self.consume(config, 'wandb')
python_script = 'main.py' python_script = 'main.py'
sh_lines = ['#!/bin/bash'] sh_lines = ['#!/bin/bash']
@ -242,7 +244,7 @@ class Slate():
print(f'[i] All threads/processes have terminated') print(f'[i] All threads/processes have terminated')
def _init_sweep(self, config): def _init_sweep(self, config):
if self.consume(config, 'sweep.enable', False): if self.sweep_id == None and self.consume(config, 'sweep.enable', False):
sweepC = self.consume(config, 'sweep') sweepC = self.consume(config, 'sweep')
wandbC = copy.deepcopy(config['wandb']) wandbC = copy.deepcopy(config['wandb'])
project = self.consume(wandbC, 'project') project = self.consume(wandbC, 'project')