From 5fe3ecad5de1b0c8633cdb198a0dfee4c947ee63 Mon Sep 17 00:00:00 2001 From: Gregor von Laszewski Date: Wed, 4 Oct 2023 21:54:38 -0400 Subject: [PATCH] add GPU --- .../cloudmask/target/greene_v0.5/config-simple-rivanna.yaml | 2 +- benchmarks/cloudmask/target/greene_v0.5/experiment.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/benchmarks/cloudmask/target/greene_v0.5/config-simple-rivanna.yaml b/benchmarks/cloudmask/target/greene_v0.5/config-simple-rivanna.yaml index 0d45df35..3468e059 100644 --- a/benchmarks/cloudmask/target/greene_v0.5/config-simple-rivanna.yaml +++ b/benchmarks/cloudmask/target/greene_v0.5/config-simple-rivanna.yaml @@ -40,7 +40,7 @@ submission: experiment: # card_name: v100 - card_name: v100 + card_name: a100 gpu_count: 1 cpu_num: 1 mem: "64GB" diff --git a/benchmarks/cloudmask/target/greene_v0.5/experiment.py b/benchmarks/cloudmask/target/greene_v0.5/experiment.py index 3a49f1d6..85d38374 100755 --- a/benchmarks/cloudmask/target/greene_v0.5/experiment.py +++ b/benchmarks/cloudmask/target/greene_v0.5/experiment.py @@ -11,6 +11,7 @@ --config= Specify the path to the config file [default: config-simple.yaml]. --clean Clean up generated files. --out= Specify the output filename. If not provided, output will be written to stdout. + --gpu= the gpu """ import os @@ -26,6 +27,8 @@ CONFIG = arguments['--config'] or "config-simple.yaml" CLEAN = arguments['--clean'] OUTPUT = arguments['--out'] +GPU = arguments['--gpu'] or "a100" + pprint(arguments) @@ -134,6 +137,7 @@ def _print(content): replace_in_yaml(CONFIG_YAML, 'experiemnet.gpu_count', 1) # Modify the slurm script + replace_sbatch_in_slurm(SLURM_SCRIPT, 'gres', f"gpu:{GPU}:1") replace_sbatch_in_slurm(SLURM_SCRIPT, 'job-name', f"cloudmask-gpu-greene-epoch-{EXPERIMENT_ID}") replace_sbatch_in_slurm(SLURM_SCRIPT, 'time', timesArray[j])