#asahi-gpu · 2021-04-17 04:53
bloomdunno where the 128 execution units comes from#asahi-gpu · 2021-04-17 04:53
dougallyeah, i'm quite confused... "128 execution units", so 16 per core? when a simd-group is 32? is that like AMDs thing where you just put each half through the pipeline over two cycles?#asahi-gpu · 2021-04-17 04:52
bloomnot sure where the 3x is.#asahi-gpu · 2021-04-17 04:51
bloomBut the 24k is from apple's marketing#asahi-gpu · 2021-04-17 04:51
bloomdougall: Can't tell.#asahi-gpu · 2021-04-17 04:50
dougallyeah... that number is right, but i'm a bit confused where the 24x comes from? like is the register file per-core? (i assume so, and that'd an 8x, but then where's the 3x?)#asahi-gpu · 2021-04-17 04:49
bloomStraight from the horse's mouth https://www.apple.com/mac/m1/#asahi-gpu · 2021-04-17 04:44
bloomwhich means scaling our estimated size up by 24x to 212992 * 24 = 5111808 = 4.9 MB of register file on the M1 GPU!#asahi-gpu · 2021-04-17 04:43
bloomI assume "nearly 25,000" is marketing speak for 1024 * 24 = 24576 threads#asahi-gpu · 2021-04-17 04:43
bloom"total, the M1 GPU contains up to 128 EUs and 1024 ALUs,[12] which by Apple's claim can execute nearly 25,000 threads simultaneously"#asahi-gpu · 2021-04-17 04:43
bloomOh, lastly - https://en.wikipedia.org/wiki/Apple_M1#Architecture#asahi-gpu · 2021-04-17 04:27
bloom(where align_up(x, y) = ceil(x / y) * y)#asahi-gpu · 2021-04-17 04:27
bloomTherefore, we may dispatch `min(1024, align_down(M / align_up(R, 4), 64))` threads.#asahi-gpu · 2021-04-17 04:26
bloomPossible addendum: But threads can only require multiples of 4 word-sized registers.#asahi-gpu · 2021-04-17 04:24
bloom(where align_down(x, y) = floor(x / y) * y)#asahi-gpu · 2021-04-17 04:24
bloomTherefore, we may dispatch `min(1024, align_down(M / R, 64))` threads.#asahi-gpu · 2021-04-17 04:23
bloomNo more than 1024 threads may be dispatched.#asahi-gpu · 2021-04-17 04:23
bloomThreads may only be dispatched in groups of 64.#asahi-gpu · 2021-04-17 04:23
bloomEvery thread requires R words from the register file.#asahi-gpu · 2021-04-17 04:22
bloomThe register file is M = 53248 words.#asahi-gpu · 2021-04-17 04:22
bloomHere's a better formula#asahi-gpu · 2021-04-17 04:17
dougallnice!#asahi-gpu · 2021-04-17 04:15
bloommin(1024, math.floor((SZ_ / (math.ceil(reg_count / 4)*4*4)) / 64) * 64)#asahi-gpu · 2021-04-17 04:15
bloomExpanding out:#asahi-gpu · 2021-04-17 04:14
bloom{13: 1024, 14: 896, 15: 832, 16: 832, 17: 768, 18: 704, 19: 640, 20: 640, 21: 576, 22: 576, 23: 576, 24: 512, 25: 512, 26: 512, 27: 448, 28: 448, 29: 448, 30: 384, 31: 384}#asahi-gpu · 2021-04-17 04:14
bloom>>> { x: math.floor((SZ_ / (x*4*4)) / 64) * 64 for x in range(13, 32) }#asahi-gpu · 2021-04-17 04:14
bloomand indeed:#asahi-gpu · 2021-04-17 04:14
bloom^ smack int he middle#asahi-gpu · 2021-04-17 04:14
bloom212992 = ((384 + 448)/2) * 32 * 4 * 4#asahi-gpu · 2021-04-17 04:13
bloombut if you take SZ to be somewhere in betwee, everything rounds right#asahi-gpu · 2021-04-17 04:13
bloombut if you doubled that, you would expect the last thread count to double#asahi-gpu · 2021-04-17 04:13
bloomIf you take SZ = 384 * (32 * 4 * 4), everything is too small except the biggest#asahi-gpu · 2021-04-17 04:12
bloomAhhh!#asahi-gpu · 2021-04-17 04:11
bloomah!#asahi-gpu · 2021-04-17 04:08
bloomuh no#asahi-gpu · 2021-04-17 04:08
bloomI guess this is all of-by-one#asahi-gpu · 2021-04-17 04:07
bloomwhich is less than the 448 actually issues#asahi-gpu · 2021-04-17 04:07
bloom423.7241379310345#asahi-gpu · 2021-04-17 04:07
bloom>>> SZ / (29*16)#asahi-gpu · 2021-04-17 04:07
bloomSZ = (128*4)*384#asahi-gpu · 2021-04-17 04:06
bloomWhat am I missing#asahi-gpu · 2021-04-17 04:06
bloomnumbers still feel suspect.#asahi-gpu · 2021-04-17 04:05
dougallyeah, i think that all makes sense#asahi-gpu · 2021-04-17 04:05
bloomit's past midnight i cant units#asahi-gpu · 2021-04-17 04:05
dougallhaha#asahi-gpu · 2021-04-17 04:04
bloomuh yes#asahi-gpu · 2021-04-17 04:04
bloomuh no#asahi-gpu · 2021-04-17 04:03
bloomSo.. a 192kb register file#asahi-gpu · 2021-04-17 04:02
bloomI guess that's a linear allocation, just a lot of rounding needed