Skip to content

Commit bba3138

Browse files
julien-cpcuencaapolinario
authored
Hardware inventory (#661)
I hesitated putting this one in `@huggingface/tasks`, or creating a new `@huggingface/hardware`. What do you think? The idea is the community to be able to contribute to that list. ### What I picked for now ⤵️ Because I'm lazy – and because it's somewhat linked to #659 – i've added it to `tasks`. --------- Co-authored-by: Pedro Cuenca <[email protected]> Co-authored-by: apolinário <[email protected]>
1 parent 674f945 commit bba3138

File tree

2 files changed

+311
-0
lines changed

2 files changed

+311
-0
lines changed

packages/tasks/src/hardware.ts

Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
/**
2+
* Biden AI Executive Order
3+
* https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/
4+
*/
5+
export const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL = 10 ** 14;
6+
export const TFLOPS_THRESHOLD_WHITE_HOUSE_MODEL_TRAINING_TOTAL_BIOLOGY = 10 ** 11;
7+
export const TFLOPS_THRESHOLD_WHITE_HOUSE_CLUSTER = 10 ** 8;
8+
9+
/**
10+
* EU AI Act
11+
* https://ec.europa.eu/commission/presscorner/detail/en/qanda_21_1683
12+
*/
13+
export const TFLOPS_THRESHOLD_EU_AI_ACT_MODEL_TRAINING_TOTAL = 10 ** 13;
14+
15+
export interface HardwareSpec {
16+
/**
17+
* Approximate value, in FP16 whenever possible.
18+
* This is only approximate/theoretical and shouldn't be taken too seriously.
19+
* Currently the CPU values are from cpu-monkey.com
20+
* while the GPU values are from techpowerup.com
21+
*
22+
* Note to reviewers: I got fed up with data entry,
23+
* and HuggingChat running Llama3 with Web search was failing a bit,
24+
* so some of those values might be slightly inaccurate. Forgive me and please feel free to improve.
25+
*/
26+
tflops: number;
27+
/**
28+
* If an array is specified, options of memory size (can be VRAM, unified RAM)
29+
* e.g. an A100 exists in 40 or 80 GB.
30+
*/
31+
memory?: number[];
32+
}
33+
34+
export const DEFAULT_MEMORY_OPTIONS = [8, 16, 24, 32, 40, 48, 64, 80, 96, 128];
35+
36+
export const SKUS = {
37+
GPU: {
38+
NVIDIA: {
39+
H100: {
40+
tflops: 267.6,
41+
memory: [80],
42+
},
43+
L40: {
44+
tflops: 90.52,
45+
memory: [48],
46+
},
47+
"RTX 6000 Ada": {
48+
tflops: 91.1,
49+
memory: [48],
50+
},
51+
A100: {
52+
tflops: 77.97,
53+
memory: [80, 40],
54+
},
55+
A40: {
56+
tflops: 37.42,
57+
memory: [48],
58+
},
59+
A10: {
60+
tflops: 31.24,
61+
memory: [24],
62+
},
63+
T4: {
64+
tflops: 65.13,
65+
memory: [16],
66+
},
67+
"RTX 4090": {
68+
tflops: 82.58,
69+
memory: [24],
70+
},
71+
"RTX 4080 SUPER": {
72+
tflops: 52.2,
73+
memory: [16],
74+
},
75+
"RTX 4080": {
76+
tflops: 48.7,
77+
memory: [16],
78+
},
79+
"RTX 4070": {
80+
tflops: 29.15,
81+
memory: [12],
82+
},
83+
"RTX 4070 Ti": {
84+
tflops: 40.09,
85+
memory: [12],
86+
},
87+
"RTX 4070 Super": {
88+
tflops: 35.48,
89+
memory: [12],
90+
},
91+
"RTX 4070 Ti Super": {
92+
tflops: 44.1,
93+
memory: [16],
94+
},
95+
"RTX 3090": {
96+
tflops: 35.58,
97+
memory: [24],
98+
},
99+
"RTX 3090 Ti": {
100+
tflops: 40,
101+
memory: [24],
102+
},
103+
"RTX 3080 Ti": {
104+
tflops: 34.1,
105+
memory: [12],
106+
},
107+
"RTX 3080": {
108+
tflops: 30.6,
109+
memory: [12, 10],
110+
},
111+
},
112+
AMD: {
113+
MI300: {
114+
tflops: 383.0,
115+
memory: [192],
116+
},
117+
MI250: {
118+
tflops: 362.1,
119+
memory: [128],
120+
},
121+
MI210: {
122+
tflops: 181.0,
123+
memory: [64],
124+
},
125+
"RX 7900 XTX": {
126+
tflops: 122.8,
127+
memory: [24],
128+
},
129+
"RX 7900 XT": {
130+
tflops: 103.0,
131+
memory: [20],
132+
},
133+
"RX 7900 GRE": {
134+
tflops: 91.96,
135+
memory: [16],
136+
},
137+
"RX 7800 XT": {
138+
tflops: 74.65,
139+
memory: [16],
140+
},
141+
"RX 7700 XT": {
142+
tflops: 70.34,
143+
memory: [12],
144+
},
145+
"RX 7600 XT": {
146+
tflops: 45.14,
147+
memory: [16, 8],
148+
},
149+
},
150+
},
151+
CPU: {
152+
Intel: {
153+
"Xeon 4th Generation (Sapphire Rapids)": {
154+
tflops: 1.3,
155+
},
156+
"Xeon 3th Generation (Ice Lake)": {
157+
tflops: 0.8,
158+
},
159+
"Xeon 2th Generation (Cascade Lake)": {
160+
tflops: 0.55,
161+
},
162+
"Intel Core 13th Generation (i9)": {
163+
tflops: 0.85,
164+
},
165+
"Intel Core 13th Generation (i7)": {
166+
tflops: 0.82,
167+
},
168+
"Intel Core 13th Generation (i5)": {
169+
tflops: 0.68,
170+
},
171+
"Intel Core 13th Generation (i3)": {
172+
tflops: 0.57,
173+
},
174+
"Intel Core 12th Generation (i9)": {
175+
tflops: 0.79,
176+
},
177+
"Intel Core 12th Generation (i7)": {
178+
tflops: 0.77,
179+
},
180+
"Intel Core 12th Generation (i5)": {
181+
tflops: 0.65,
182+
},
183+
"Intel Core 12th Generation (i3)": {
184+
tflops: 0.53,
185+
},
186+
"Intel Core 11th Generation (i9)": {
187+
tflops: 0.7,
188+
},
189+
"Intel Core 11th Generation (i7)": {
190+
tflops: 0.6,
191+
},
192+
"Intel Core 11th Generation (i5)": {
193+
tflops: 0.5,
194+
},
195+
"Intel Core 11th Generation (i3)": {
196+
tflops: 0.35,
197+
},
198+
"Intel Core 10th Generation (i9)": {
199+
tflops: 0.46,
200+
},
201+
"Intel Core 10th Generation (i7)": {
202+
tflops: 0.46,
203+
},
204+
"Intel Core 10th Generation (i5)": {
205+
tflops: 0.46,
206+
},
207+
"Intel Core 10th Generation (i3)": {
208+
tflops: 0.44,
209+
},
210+
},
211+
AMD: {
212+
"EPYC 4th Generation (Genoa)": {
213+
tflops: 5,
214+
},
215+
"EPYC 3th Generation (Milan)": {
216+
tflops: 2.4,
217+
},
218+
"EPYC 2th Generation (Rome)": {
219+
tflops: 0.6,
220+
},
221+
"EPYC 1st Generation (Naples)": {
222+
tflops: 0.6,
223+
},
224+
"Ryzen Zen4 7000 (Ryzen 9)": {
225+
tflops: 0.56,
226+
},
227+
"Ryzen Zen4 7000 (Ryzen 7)": {
228+
tflops: 0.56,
229+
},
230+
"Ryzen Zen4 7000 (Ryzen 5)": {
231+
tflops: 0.56,
232+
},
233+
"Ryzen Zen3 5000 (Ryzen 9)": {
234+
tflops: 1.33,
235+
},
236+
"Ryzen Zen3 5000 (Ryzen 7)": {
237+
tflops: 1.33,
238+
},
239+
"Ryzen Zen3 5000 (Ryzen 5)": {
240+
tflops: 0.72,
241+
},
242+
"Ryzen Zen 2 3000 (Threadripper)": {
243+
tflops: 0.72,
244+
},
245+
"Ryzen Zen 2 3000 (Ryzen 9)": {
246+
tflops: 0.72,
247+
},
248+
"Ryzen Zen 2 3000 (Ryzen 7)": {
249+
tflops: 0.72,
250+
},
251+
"Ryzen Zen 2 3000 (Ryzen 5)": {
252+
tflops: 0.72,
253+
},
254+
"Ryzen Zen 2 3000 (Ryzen 3)": {
255+
tflops: 0.72,
256+
},
257+
},
258+
},
259+
"Apple Silicon": {
260+
"-": {
261+
"Apple M1": {
262+
tflops: 2.6,
263+
memory: [8, 16],
264+
},
265+
"Apple M1 Pro": {
266+
tflops: 5.2,
267+
memory: [16, 24, 32],
268+
},
269+
"Apple M1 Max": {
270+
tflops: 10.4,
271+
memory: [16, 24, 32, 64],
272+
},
273+
"Apple M1 Ultra": {
274+
tflops: 21,
275+
memory: [16, 24, 32, 64, 96, 128],
276+
},
277+
"Apple M2": {
278+
tflops: 3.6,
279+
memory: [8, 16, 24],
280+
},
281+
"Apple M2 Pro": {
282+
tflops: 13.6,
283+
memory: [16, 24, 32],
284+
},
285+
"Apple M2 Max": {
286+
tflops: 13.49,
287+
memory: [32, 64, 96],
288+
},
289+
"Apple M2 Ultra": {
290+
tflops: 27.2,
291+
memory: [64, 96, 128, 192],
292+
},
293+
"Apple M3": {
294+
tflops: 2.84,
295+
memory: [8, 16, 24],
296+
},
297+
"Apple M3 Pro": {
298+
tflops: 14,
299+
memory: [18, 36],
300+
},
301+
"Apple M3 Max": {
302+
tflops: 14.2,
303+
memory: [36, 48, 64, 96, 128],
304+
},
305+
},
306+
},
307+
} satisfies Record<string, Record<string, Record<string, HardwareSpec>>>;
308+
309+
export type SkuType = keyof typeof SKUS;

packages/tasks/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,7 @@ export { SPECIAL_TOKENS_ATTRIBUTES } from "./tokenizer-data";
4545
import * as snippets from "./snippets";
4646
export { snippets };
4747

48+
export { SKUS, DEFAULT_MEMORY_OPTIONS } from "./hardware";
49+
export type { HardwareSpec, SkuType } from "./hardware";
4850
export { LOCAL_APPS } from "./local-apps";
4951
export type { LocalApp, LocalAppKey } from "./local-apps";

0 commit comments

Comments
 (0)