Allow access to run_id from config

This commit is contained in:
Dominik Moritz Roth 2023-07-31 15:38:46 +02:00
parent 6f9fbe6b28
commit ee83a3be52

View File

@ -46,6 +46,7 @@ class Slate():
self._version = False
self.job_id = os.environ.get('SLURM_JOB_ID', False)
self.task_id = None
self.run_id = -1
self._tmp_path = os.path.expandvars('$TMP')
self.sweep_id = None
@ -109,7 +110,7 @@ class Slate():
rand = int(random.random()*99999999)
if string == '{rand}':
return rand
return string.format(delta_desc=delta_desc, **kwargs, rand=rand, tmp=self._tmp_path, job_id=(self.job_id or 'LOCAL'), task_id=(self.task_id or 0))
return string.format(delta_desc=delta_desc, **kwargs, rand=rand, tmp=self._tmp_path, job_id=(self.job_id or 'LOCAL'), task_id=(self.task_id or 0), run_id=self.run_id)
return string
def apply_nested(self, d, f):
@ -294,6 +295,7 @@ class Slate():
Runner = self.runners[runnerName]
for r in rep_ids:
self.run_id = r
config = copy.deepcopy(orig_config)
runnerConf = self._make_config_for_run(config, r)
wandbC = self.consume(runnerConf, 'wandb', {}, expand=True, delta_desc=runnerConf.pop('delta_desc', 'BASE'))