From a1b9c41ffdeeeb41dcaa45bc7e6f6089d4acb3a0 Mon Sep 17 00:00:00 2001 From: Zaccharie Ramzi Date: Fri, 7 Jan 2022 16:14:21 +0100 Subject: [PATCH] copy pasted launcher from my sub scripts --- .../bin/hydra-submitit-launch | 14 ++++++++++++++ .../hydra/launcher/4gpus_dev.yaml | 5 +++++ .../hydra/launcher/4gpus_t3.yaml | 5 +++++ .../hydra/launcher/4gpus_t4.yaml | 5 +++++ .../hydra/launcher/base.yaml | 17 +++++++++++++++++ .../hydra/launcher/dev.yaml | 5 +++++ .../hydra/launcher/t3.yaml | 6 ++++++ .../hydra/launcher/t4.yaml | 6 ++++++ jz_hydra_submitit_launcher/searchpath_config.py | 16 ++++++++++++++++ 9 files changed, 79 insertions(+) create mode 100644 jz_hydra_submitit_launcher/bin/hydra-submitit-launch create mode 100644 jz_hydra_submitit_launcher/hydra/launcher/4gpus_dev.yaml create mode 100644 jz_hydra_submitit_launcher/hydra/launcher/4gpus_t3.yaml create mode 100644 jz_hydra_submitit_launcher/hydra/launcher/4gpus_t4.yaml create mode 100644 jz_hydra_submitit_launcher/hydra/launcher/base.yaml create mode 100644 jz_hydra_submitit_launcher/hydra/launcher/dev.yaml create mode 100644 jz_hydra_submitit_launcher/hydra/launcher/t3.yaml create mode 100644 jz_hydra_submitit_launcher/hydra/launcher/t4.yaml create mode 100644 jz_hydra_submitit_launcher/searchpath_config.py diff --git a/jz_hydra_submitit_launcher/bin/hydra-submitit-launch b/jz_hydra_submitit_launcher/bin/hydra-submitit-launch new file mode 100644 index 0000000..50fcb6b --- /dev/null +++ b/jz_hydra_submitit_launcher/bin/hydra-submitit-launch @@ -0,0 +1,14 @@ +#!/bin/bash +usage="$(basename "$0") [--help] python_script launch_config @hydra_args +where: + --help show this help text + python_script: the hydra python script to run + launch_config: the SLURM config to use for this run + hydra_args: arguments to pass to the hydra python script, where you can specify sweeps, but also override some launch configs" + +if [ "$1" == "--help" ]; then + echo $usage + exit 0 +fi + +python $1 -m hydra/launcher=$2 'hydra.searchpath=[pkg://jz_hydra_submitit_launcher]' ${@:3} \ No newline at end of file diff --git a/jz_hydra_submitit_launcher/hydra/launcher/4gpus_dev.yaml b/jz_hydra_submitit_launcher/hydra/launcher/4gpus_dev.yaml new file mode 100644 index 0000000..2b2fbf0 --- /dev/null +++ b/jz_hydra_submitit_launcher/hydra/launcher/4gpus_dev.yaml @@ -0,0 +1,5 @@ +defaults: + - dev + +cpus_per_task: 40 +gpus_per_node: 4 \ No newline at end of file diff --git a/jz_hydra_submitit_launcher/hydra/launcher/4gpus_t3.yaml b/jz_hydra_submitit_launcher/hydra/launcher/4gpus_t3.yaml new file mode 100644 index 0000000..752f671 --- /dev/null +++ b/jz_hydra_submitit_launcher/hydra/launcher/4gpus_t3.yaml @@ -0,0 +1,5 @@ +defaults: + - t3 + +cpus_per_task: 40 +gpus_per_node: 4 \ No newline at end of file diff --git a/jz_hydra_submitit_launcher/hydra/launcher/4gpus_t4.yaml b/jz_hydra_submitit_launcher/hydra/launcher/4gpus_t4.yaml new file mode 100644 index 0000000..3e7c471 --- /dev/null +++ b/jz_hydra_submitit_launcher/hydra/launcher/4gpus_t4.yaml @@ -0,0 +1,5 @@ +defaults: + - t4 + +cpus_per_task: 40 +gpus_per_node: 4 \ No newline at end of file diff --git a/jz_hydra_submitit_launcher/hydra/launcher/base.yaml b/jz_hydra_submitit_launcher/hydra/launcher/base.yaml new file mode 100644 index 0000000..eccf71f --- /dev/null +++ b/jz_hydra_submitit_launcher/hydra/launcher/base.yaml @@ -0,0 +1,17 @@ +defaults: + - submitit_slurm + +timeout_min: 60 +gpus_per_node: 1 +tasks_per_node: 1 +gres: "gpu:${hydra.launcher.gpus_per_node}" +qos: qos_gpu-dev +cpus_per_gpu: 10 +gpus_per_task: ${hydra.launcher.gpus_per_node} +additional_parameters: + account: ${project_id}@gpu + distribution: "block:block" + hint: nomultithread + time: "${hours}:00:00" +setup: + - "#SBATCH -C v100-32g" \ No newline at end of file diff --git a/jz_hydra_submitit_launcher/hydra/launcher/dev.yaml b/jz_hydra_submitit_launcher/hydra/launcher/dev.yaml new file mode 100644 index 0000000..fe97084 --- /dev/null +++ b/jz_hydra_submitit_launcher/hydra/launcher/dev.yaml @@ -0,0 +1,5 @@ +defaults: + - base + +additional_parameters: + time: "2:00:00" diff --git a/jz_hydra_submitit_launcher/hydra/launcher/t3.yaml b/jz_hydra_submitit_launcher/hydra/launcher/t3.yaml new file mode 100644 index 0000000..3515050 --- /dev/null +++ b/jz_hydra_submitit_launcher/hydra/launcher/t3.yaml @@ -0,0 +1,6 @@ +defaults: + - base + +qos: qos_gpu-t3 +additional_parameters: + time: "20:00:00" diff --git a/jz_hydra_submitit_launcher/hydra/launcher/t4.yaml b/jz_hydra_submitit_launcher/hydra/launcher/t4.yaml new file mode 100644 index 0000000..d315ae8 --- /dev/null +++ b/jz_hydra_submitit_launcher/hydra/launcher/t4.yaml @@ -0,0 +1,6 @@ +defaults: + - base + +qos: qos_gpu-t4 +additional_parameters: + time: "100:00:00" diff --git a/jz_hydra_submitit_launcher/searchpath_config.py b/jz_hydra_submitit_launcher/searchpath_config.py new file mode 100644 index 0000000..740568e --- /dev/null +++ b/jz_hydra_submitit_launcher/searchpath_config.py @@ -0,0 +1,16 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +from hydra.core.config_search_path import ConfigSearchPath +from hydra.plugins.search_path_plugin import SearchPathPlugin + + +class JeanZaySearchPathPlugin(SearchPathPlugin): + def manipulate_search_path(self, search_path: ConfigSearchPath) -> None: + # Appends the search path for this plugin to the end of the search path + # Note that foobar/conf is outside of the example plugin module. + # There is no requirement for it to be packaged with the plugin, it just needs + # be available in a package. + # Remember to verify the config is packaged properly (build sdist and look inside, + # and verify MANIFEST.in is correct). + search_path.append( + provider="jz-hydra-submitit-launcher", path="pkg://jz_hydra_submitit_launcher" + ) \ No newline at end of file