Repository: facebookincubator/submitit

Issue:
How to comment a slurm variable?
Hi All,

I observe the following error which is due to added: "#SBATCH --gpus-per-node=4" line in the generated slurm script.

Error : submitit.core.utils.FailedJobError: sbatch: error: Batch job submission failed: Invalid generic resource (gres) specification

Can developers/users of submitit guide me on where to comment/delete the above line in the slum script before it is submitted by the sbatch command? 

Thanks,
Amit Ruhela



Discussion:

Patch:
diff --git a/submitit/slurm/slurm.py b/submitit/slurm/slurm.py
index 4f28b4b..fffc497 100644
--- a/submitit/slurm/slurm.py
+++ b/submitit/slurm/slurm.py
@@ -390,7 +390,7 @@ def _make_sbatch_string(
     partition: tp.Optional[str] = None,
     time: int = 5,
     nodes: int = 1,
-    ntasks_per_node: int = 1,
+    ntasks_per_node: tp.Optional[int] = None,
     cpus_per_task: tp.Optional[int] = None,
     cpus_per_gpu: tp.Optional[int] = None,
     num_gpus: tp.Optional[int] = None,  # legacy


Test patch:
diff --git a/submitit/slurm/_sbatch_test_record.txt b/submitit/slurm/_sbatch_test_record.txt
index 5f07070..9d2bf58 100644
--- a/submitit/slurm/_sbatch_test_record.txt
+++ b/submitit/slurm/_sbatch_test_record.txt
@@ -6,7 +6,6 @@
 #SBATCH --exclusive
 #SBATCH --job-name=submitit
 #SBATCH --nodes=1
-#SBATCH --ntasks-per-node=1
 #SBATCH --open-mode=append
 #SBATCH --output=/tmp/%j_0_log.out
 #SBATCH --partition=learnfair