forked from zaccharieramzi/jz-hydra-submitit-launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a new qos resolver (zaccharieramzi#2)
- Loading branch information
1 parent
bf9cc37
commit 6a253a7
Showing
9 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fake_param: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import hydra | ||
|
||
from omegaconf import OmegaConf | ||
|
||
|
||
@hydra.main(config_path='conf', config_name='config') | ||
def example_main(cfg): | ||
print(OmegaConf.to_container(cfg, resolve=True)) | ||
|
||
if __name__ == '__main__': | ||
example_main() |
3 changes: 1 addition & 2 deletions
3
hydra_plugins/jz_hydra_submitit_launcher/hydra/launcher/4gpus_dev.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
defaults: | ||
- dev | ||
|
||
cpus_per_task: 40 | ||
gpus_per_node: 4 | ||
gpus_per_node: 4 |
3 changes: 1 addition & 2 deletions
3
hydra_plugins/jz_hydra_submitit_launcher/hydra/launcher/4gpus_t3.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
defaults: | ||
- t3 | ||
|
||
cpus_per_task: 40 | ||
gpus_per_node: 4 | ||
gpus_per_node: 4 |
3 changes: 1 addition & 2 deletions
3
hydra_plugins/jz_hydra_submitit_launcher/hydra/launcher/4gpus_t4.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
defaults: | ||
- t4 | ||
|
||
cpus_per_task: 40 | ||
gpus_per_node: 4 | ||
gpus_per_node: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
hydra_plugins/jz_hydra_submitit_launcher/hydra/launcher/dev.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
defaults: | ||
- base | ||
|
||
qos: qos_gpu-dev | ||
additional_parameters: | ||
time: "2:00:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
from omegaconf import OmegaConf | ||
|
||
OmegaConf.register_new_resolver("multiply10", lambda x: x * 10) | ||
|
||
def time_to_qos(timeout_hour): | ||
timeout_hour = int(timeout_hour) | ||
if timeout_hour > 20: | ||
qos = 't4' | ||
elif timeout_hour > 2: | ||
qos = 't3' | ||
else: | ||
qos = 'dev' | ||
|
||
qos = f'qos_gpu-{qos}' | ||
return qos | ||
|
||
OmegaConf.register_new_resolver("qos_from_hours", time_to_qos, replace=True) | ||
OmegaConf.register_new_resolver("cpu_from_gpu", lambda x,y: x*y, replace=True) |