-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathconsts.py
More file actions
71 lines (52 loc) · 1.5 KB
/
consts.py
File metadata and controls
71 lines (52 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from enum import Enum
from typing import Type
class GPUType(Enum):
NVIDIA = "nvidia_workflow.yml"
AMD = "amd_workflow.yml"
class SchedulerType(Enum):
GITHUB = "github"
MODAL = "modal"
SLURM = "slurm"
class GitHubGPU(Enum):
NVIDIA = "nvidia"
AMD = "amd"
class ModalGPU(Enum):
T4 = "T4"
L4 = "L4"
A100 = "A100"
H100 = "H100"
def combine_enums(enums: list[Type[Enum]], combined_name: str) -> Enum:
combined_members = {}
for enum in enums:
for name, member in enum.__members__.items():
if name in combined_members:
raise ValueError(f"Duplicate member name '{name}' found across Enums.")
combined_members[name] = member.value
return Enum(combined_name, combined_members)
AllGPU = combine_enums([ModalGPU, GitHubGPU], "AllGPU")
GPU_TO_SM = {
"T4": 75,
"L4": 80,
"A100": 80,
"H100": 90,
}
# Modal-specific constants
MODAL_PATH = "/tmp/dcs/"
MODAL_EVAL_CODE_PATH = "/tmp/dcs/eval.py"
MODAL_REFERENCE_CODE_PATH = "/tmp/dcs/reference.py"
MODAL_SUBMISSION_CODE_PATH = "/tmp/dcs/train.py"
# Compilation flags for Modal
CUDA_FLAGS = [
"--std=c++20",
"-DNDEBUG",
"-Xcompiler=-Wno-psabi",
"-Xcompiler=-fno-strict-aliasing",
"--expt-extended-lambda",
"--expt-relaxed-constexpr",
"-forward-unknown-to-host-compiler",
"-O3",
"-Xnvlink=--verbose",
"-Xptxas=--verbose",
"-Xptxas=--warn-on-spills",
]
MODAL_CUDA_INCLUDE_DIRS = ["-I/ThunderKittens/include", "-I/cutlass/include"]