-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathdevice_order.py
69 lines (55 loc) · 1.23 KB
/
device_order.py
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
#!/usr/bin/env python3
import matplotlib
import matplotlib.pyplot as plt
plt.style.use("bmh")
plt.rcParams["axes.facecolor"] = "white"
device_color_palette = [
"#378ABD",
"#FFB33A",
"#7EC75B",
"#DA5252",
"#793B67",
"#10CFCC",
"#FFE100",
"#09047f",
"#296F20",
]
order = [
"a40",
"l40",
"v100",
"a100",
"gh200",
"mi100",
"mi210",
"mi300x",
"rx6900xt",
"mi300a",
"a100_40",
"h100_pcie",
]
long_order = [
"NVIDIA A40",
"NVIDIA L40",
"Tesla V100",
"NVIDIA A100-SXM4-80GB",
"NVIDIA GH200 480GB",
"AMD Instinct MI100",
"AMD Instinct MI210",
"AMD Instinct MI300X",
"AMD Radeon RX 6900 XT",
"NVIDIA A100-SXM4-40G",
]
def getOrderNumber(f, use_order=order):
for o in range(len(use_order)):
if f.startswith(use_order[o]):
return o
return len(use_order) + 1
def getDeviceColor(f):
n = getOrderNumber(f)
if n >= len(device_color_palette):
n = getOrderNumber(f, use_order=long_order)
if n >= len(device_color_palette):
return "C" + str(n - len(device_color_palette))
return device_color_palette[n]
lineStyle = {"linewidth": 2.0, "alpha": 1, "markersize": 3, "marker": ""}