-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59b7546
commit 7b1a296
Showing
13 changed files
with
148 additions
and
27 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,46 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import json | ||
import subprocess | ||
import argparse | ||
|
||
from submititnow.umiacs.handlers import profile_handlers | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("config", type=str) | ||
parser.add_argument("shell", nargs="+", default="zsh") | ||
args = parser.parse_args() | ||
|
||
|
||
def removeprefix(var: str, prefix: str): | ||
return var[len(prefix) :] if var.startswith(prefix) else var | ||
|
||
|
||
def load_config(config_filename: str): | ||
with open(config_filename) as f: | ||
config = json.load(f) | ||
if "profile" in config: | ||
profile = config.pop("profile") | ||
config = profile_handlers[profile](config) | ||
|
||
return { | ||
removeprefix(key, "slurm_").replace("_", "-"): value | ||
for key, value in config.items() | ||
} | ||
|
||
|
||
cmd_args = load_config(args.config) | ||
|
||
|
||
# Make Bash command | ||
cmd = "srun" | ||
for key, value in cmd_args.items(): | ||
cmd += f" --{key}={value}" | ||
cmd += " --job-name=llms" | ||
shell_cmd = " ".join(args.shell) | ||
cmd += f" --pty {shell_cmd}" | ||
|
||
print(cmd) | ||
|
||
subprocess.run(cmd, shell=True) |
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 was deleted.
Oops, something went wrong.
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,5 @@ | ||
{ | ||
"profile": "scavenger", | ||
"gres": "gpu:rtxa4000:1", | ||
"mem": "16G" | ||
} |
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,5 @@ | ||
{ | ||
"profile": "clip", | ||
"gres": "gpu:1", | ||
"mem": "4G" | ||
} |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
setuptools.setup( | ||
name="submititnow", | ||
version="0.9.3", | ||
version="0.9.4", | ||
author="Maharshi Gor", | ||
author_email="[email protected]", | ||
description="A package to make submitit easier to use", | ||
|
@@ -27,6 +27,7 @@ | |
"rich-cli>=1.8.0", | ||
"rich>=12.6.0", | ||
"tqdm>=4.0.0", | ||
"scandir>=1.10.0", | ||
], | ||
python_requires=">=3.8", | ||
) |
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
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
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