mirror of https://github.com/open-mmlab/mim.git
parent
bef7595ee5
commit
40151776de
|
@ -346,6 +346,11 @@ def gridsearch(
|
|||
] + common_args
|
||||
elif launcher == 'slurm':
|
||||
parsed_srun_args = srun_args.split() if srun_args else []
|
||||
has_job_name = any([('--job-name' in x) or ('-J' in x)
|
||||
for x in parsed_srun_args])
|
||||
if not has_job_name:
|
||||
job_name = osp.splitext(osp.basename(config_path))[0]
|
||||
parsed_srun_args.append(f'--job-name={job_name}_train')
|
||||
cmd = [
|
||||
'srun', '-p', f'{partition}', f'--gres=gpu:{gpus_per_node}',
|
||||
f'--ntasks={gpus}', f'--ntasks-per-node={gpus_per_node}',
|
||||
|
|
|
@ -248,6 +248,11 @@ def test(
|
|||
cmd += common_args
|
||||
elif launcher == 'slurm':
|
||||
parsed_srun_args = srun_args.split() if srun_args else []
|
||||
has_job_name = any([('--job-name' in x) or ('-J' in x)
|
||||
for x in parsed_srun_args])
|
||||
if not has_job_name:
|
||||
job_name = osp.splitext(osp.basename(config))[0]
|
||||
parsed_srun_args.append(f'--job-name={job_name}_test')
|
||||
cmd = [
|
||||
'srun', '-p', f'{partition}', f'--gres=gpu:{gpus_per_node}',
|
||||
f'--ntasks={gpus}', f'--ntasks-per-node={gpus_per_node}',
|
||||
|
|
|
@ -224,6 +224,11 @@ def train(
|
|||
] + common_args
|
||||
elif launcher == 'slurm':
|
||||
parsed_srun_args = srun_args.split() if srun_args else []
|
||||
has_job_name = any([('--job-name' in x) or ('-J' in x)
|
||||
for x in parsed_srun_args])
|
||||
if not has_job_name:
|
||||
job_name = osp.splitext(osp.basename(config))[0]
|
||||
parsed_srun_args.append(f'--job-name={job_name}_train')
|
||||
cmd = [
|
||||
'srun', '-p', f'{partition}', f'--gres=gpu:{gpus_per_node}',
|
||||
f'--ntasks={gpus}', f'--ntasks-per-node={gpus_per_node}',
|
||||
|
|
Loading…
Reference in New Issue