Skip to content

Commit fa0d297

Browse files
committed
update DEPLOYMENTS table
1 parent 7dbbad8 commit fa0d297

File tree

2 files changed

+91
-44
lines changed

2 files changed

+91
-44
lines changed

DEPLOYMENTS.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
# Deployments Table
22

3-
Generated by make-deployments-table.py on 2024-02-05 15:42:27.
3+
Generated by make-deployments-table.py on 2025-04-22 17:58:21.
44

5-
| Model ID | GCP | Azure | Node Selector (GCP) | Node Selector (Azure) |
6-
| --- | --- | --- | --- | --- |
7-
| common-diffusion-new ||| | agentpool=a100 |
8-
| common-diffusion-on-demand ||| | agentpool=a100 |
9-
| common-diffusion-inpaint ||| | agentpool=a100 |
10-
| deforum-sd-1 ||| | agentpool=a100 |
11-
| deforum-sd-epicdream ||| | agentpool=a100 |
12-
| common-whisper-en-short ||| | agentpool=a100 |
13-
| common-whisper-te-short ||| | agentpool=a100 |
14-
| retro-nemo-asr ||| | agentpool=a100 |
15-
| common-audio-ldm-bark ||| | agentpool=a100 |
16-
| common-seamless ||| | agentpool=a100 |
17-
| common-diffusion-instruct-pix2pix ||| | agentpool=a100 |
18-
| common-diffusion-upscale ||| | agentpool=a100 |
19-
| common-whisper-en-te-long ||| | agentpool=a100 |
20-
| common-whisper-hi-bho-long ||| | agentpool=a100 |
21-
| common-whisper-hi-bho-short ||| | agentpool=a100 |
22-
| common-embeddings-1 ||| | agentpool=a100 |
23-
| retro-wav2lip-gan ||| | agentpool=a100 |
24-
| retro-u2net-dis ||| | agentpool=a100 |
5+
| Name | % of A100 | Replicas | Model IDs |
6+
| --- | --- | --- | --- |
7+
| common-diffusion-dreamshaper | 15.91% | 1 | Lykon/DreamShaper |
8+
| common-diffusion-stable-diffusion-2-1 | 15.91% | 1 | stabilityai/stable-diffusion-2-1 |
9+
| common-diffusion-dreamlike-photoreal-2 | 15.91% | 1 | dreamlike-art/dreamlike-photoreal-2.0 |
10+
| common-diffusion-stable-diffusion-v1-5 | 15.91% | 1 | runwayml/stable-diffusion-v1-5 |
11+
| deforum-sd-1 | 9.09% | 2 | Protogen_V2.2.ckpt |
12+
| deforum-sd-epicdream | 9.09% | 1 | epicdream.safetensors |
13+
| common-whisper-en-short | 9.09% | 1 | openai/whisper-large-v2 |
14+
| common-whisper-en-long | 18.18% | 1 | openai/whisper-large-v2 |
15+
| common-audio-ldm-bark | 9.09% | 1 | cvssp/audioldm |
16+
| | | | bark |
17+
| common-seamless | 12.73% | 1 | facebook/seamless-m4t-v2-large |
18+
| common-diffusion-instruct-pix2pix | 5.45% | 1 | timbrooks/instruct-pix2pix |
19+
| common-diffusion-upscale | 23.64% | 1 | stabilityai/stable-diffusion-x4-upscaler |
20+
| common-mms | 11.36% | 1 | facebook/mms-1b-all |
21+
| common-embeddings-1 | 8.18% | 1 | intfloat/e5-large-v2 |
22+
| | | | intfloat/e5-base-v2 |
23+
| | | | intfloat/multilingual-e5-base |
24+
| | | | intfloat/multilingual-e5-large |
25+
| | | | thenlper/gte-large |
26+
| | | | thenlper/gte-base |
27+
| retro-sadtalker | 11.36% | 3 | SadTalker_V0.0.2_512.safetensors |
28+
| retro-wav2lip-gan | 13.64% | 2 | wav2lip_gan.pth |
29+
| retro-u2net-dis | 4.09% | 1 | u2net |
30+
| | | | isnet-general-use.pth |
31+
| retro-gfpgan-esrgan | 10.91% | 1 | GFPGANv1.4 |
32+
| | | | RealESRGAN_x2plus |
33+
| common-llms-sealion-v2-1 | 36.36% | 1 | aisingapore/llama3-8b-cpt-sea-lionv2.1-instruct |

make-deployments-table.py

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,94 @@
11
#!/usr/bin/env python3
2+
3+
import json
24
from datetime import datetime
35
from textwrap import dedent
6+
from typing import Iterable
47

58
import yaml
69

710

811
MD_FILENAME = "DEPLOYMENTS.md"
12+
A100_TOTAL_MEM = 220 # Gi
13+
14+
15+
def flatten(l: Iterable) -> list:
16+
ret = []
17+
for el in l:
18+
if isinstance(el, list):
19+
ret.extend(flatten(el))
20+
else:
21+
ret.append(el)
22+
return ret
23+
924

10-
def stringify_nodeselector(selector: dict[str, str]):
11-
# separate with markdown linebreak
12-
return " * ".join([f"{k}={v}" for k, v in selector.items()])
25+
def get_model_usage(filename):
26+
with open(filename) as f:
27+
values = json.load(f)
28+
return {row["model"]: row["Count"] for row in values}
1329

1430

1531
def get_deployments(filename):
1632
# filename: yaml filename
1733
with open(filename) as f:
1834
values = yaml.safe_load(f)
1935
deployments = values["deployments"]
20-
return {depl["name"]: stringify_nodeselector(depl["nodeSelector"]) for depl in deployments}
36+
queue_name_vars = values["autoscaling"]["queueNameVars"]
37+
return [
38+
{
39+
"name": depl["name"],
40+
"memoryLimit": depl.get("limits", {}).get("memory", None),
41+
"replicas": depl.get("autoscaling", {}).get("minReplicaCount", 1),
42+
"models": list(
43+
filter(
44+
bool,
45+
flatten(
46+
[
47+
depl.get("env", {}).get(qnv, "").split("\n")
48+
for qnv in queue_name_vars
49+
]
50+
),
51+
)
52+
),
53+
}
54+
for depl in deployments
55+
]
2156

2257

2358
def main():
24-
gcp_deployments = get_deployments(filename="chart/values.yaml")
25-
az_deployments = get_deployments(filename="chart/values-azure.yaml")
59+
deployments = get_deployments(filename="chart/model-values.yaml")
2660

2761
md_table = [
28-
["Model ID", "GCP", "Azure", "Node Selector (GCP)", "Node Selector (Azure)"],
62+
["Name", "% of A100", "Replicas", "Model IDs"],
2963
]
3064

31-
deployment_info = {}
32-
for model_id in gcp_deployments | az_deployments:
33-
deployment_info.setdefault(
34-
model_id,
35-
{"GCP": "❌", "Azure": "❌", "Node Selector (GCP)": "", "Node Selector (Azure)": ""},
65+
for info in deployments:
66+
if memoryLimit := info["memoryLimit"]:
67+
a100_fraction = int(memoryLimit.removesuffix("Gi")) / A100_TOTAL_MEM
68+
else:
69+
a100_fraction = None
70+
md_table.append(
71+
[
72+
info["name"],
73+
f"{a100_fraction:.2%}" if a100_fraction else "N/A",
74+
str(info["replicas"]),
75+
(info["models"] or ["N/A"])[0],
76+
]
3677
)
37-
if info := az_deployments.get(model_id):
38-
deployment_info[model_id]["Azure"] = "✅"
39-
deployment_info[model_id]["Node Selector (Azure)"] = info
40-
if info := gcp_deployments.get(model_id):
41-
deployment_info[model_id]["GCP"] = "✅"
42-
deployment_info[model_id]["Node Selector (GCP)"] = info
43-
44-
for model_id, info in deployment_info.items():
45-
md_table.append([model_id, info["GCP"], info["Azure"], info["Node Selector (GCP)"], info["Node Selector (Azure)"]])
78+
for model in info["models"][1:]:
79+
md_table.append(["", "", "", model])
4680

4781
with open(MD_FILENAME, "w") as f:
48-
f.write(dedent(f"""\
82+
f.write(
83+
dedent(
84+
f"""\
4985
# Deployments Table
5086
5187
Generated by {__file__.rsplit("/", maxsplit=1)[-1]} on {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}.
5288
53-
"""))
89+
"""
90+
)
91+
)
5492

5593
header = "| " + " | ".join(md_table[0]) + " |\n"
5694
f.write(header)

0 commit comments

Comments
 (0)