in submitit/slurm/slurm.py [0:0]
def _internal_update_parameters(self, **kwargs: Any) -> None:
"""Updates sbatch submission file parameters
Parameters
----------
See slurm documentation for most parameters.
Most useful parameters are: time, mem, gpus_per_node, cpus_per_task, partition
Below are the parameters that differ from slurm documentation:
signal_delay_s: int
delay between the kill signal and the actual kill of the slurm job.
setup: list
a list of command to run in sbatch befure running srun
array_parallelism: int
number of map tasks that will be executed in parallel
Raises
------
ValueError
In case an erroneous keyword argument is added, a list of all eligible parameters
is printed, with their default values
Note
----
Best practice (as far as Quip is concerned): cpus_per_task=2x (number of data workers + gpus_per_task)
You can use cpus_per_gpu=2 (requires using gpus_per_task and not gpus_per_node)
"""
defaults = _get_default_parameters()
in_valid_parameters = sorted(set(kwargs) - set(defaults))
if in_valid_parameters:
string = "\n - ".join(f"{x} (default: {repr(y)})" for x, y in sorted(defaults.items()))
raise ValueError(
f"Unavailable parameter(s): {in_valid_parameters}\nValid parameters are:\n - {string}"
)
# check that new parameters are correct
_make_sbatch_string(command="nothing to do", folder=self.folder, **kwargs)
super()._internal_update_parameters(**kwargs)