#asahi-gpu · 2021-04-20 23:24
bloomBlending seems to be 100% in software (in the fragment shader).#asahi-gpu · 2021-04-20 04:10
bloomDepth/stencil state done.#asahi-gpu · 2021-04-20 02:09
bloomI suppose I should poke cmdstream#asahi-gpu · 2021-04-19 18:05
bloomyeah, dougall pointed out similar issues.. working theory is that it's dual-issue ALU, with memory loads as messagepassing (quick)#asahi-gpu · 2021-04-19 12:22
bloomAlso, the linked LLVM presentation from Apple has a brief discussion on their scheduling.#asahi-gpu · 2021-04-19 12:21
bloomand we know it's not the first two.. and we know AGX perf is unparalleled..#asahi-gpu · 2021-04-19 12:21
bloomradex: Heuristic argument.. we know GPUs need some form of perthread SIMD or VLIW or multi-issue or straight up superscalar for high perf#asahi-gpu · 2021-04-19 00:18
bloomJTL: ^ there you go :p#asahi-gpu · 2021-04-19 00:17
bloombut the code has a bunch of hacks in it .. again, all cleaned up in time#asahi-gpu · 2021-04-19 00:17
bloomThe frontend is a fork of the usual demo app https://github.com/AsahiLinux/gpu/tree/wip#asahi-gpu · 2021-04-19 00:16
bloomhttps://gist.github.com/alyssarosenzweig/4dc380184a4959fe609bfa26bf96dd6c are the shaders, from which you'll learn, knowing how to write a shader compiler does *not* mean you know how to write shaders that don't suck :p#asahi-gpu · 2021-04-19 00:16
bloom(Disclaimer: all the code for that is published but it's split across 3 repos and it'd probably be hard to reproduce as-is. This will be rectified over time..)#asahi-gpu · 2021-04-19 00:15
bloomHave a field day y'all :)#asahi-gpu · 2021-04-19 00:15
bloomhttps://rosenzweig.io/blog/asahi-gpu-part-3.html#asahi-gpu · 2021-04-18 22:43
bloomHoping to get it out tonight... the work is done, but administrivia is hard.#asahi-gpu · 2021-04-18 22:43
bloomDraft is written, editing now.#asahi-gpu · 2021-04-18 22:43
bloomYep#asahi-gpu · 2021-04-18 22:32
bloomBlog post incoming :)#asahi-gpu · 2021-04-17 15:46
bloomhandles the core floating point stuff#asahi-gpu · 2021-04-17 15:46
bloomspun up an optimizer for agx#asahi-gpu · 2021-04-17 15:34
bloomLikewise using mov_imm as a 32-bit thing#asahi-gpu · 2021-04-17 15:33
bloomI bet so.#asahi-gpu · 2021-04-17 15:32
bloomIf two 16-bit values are in a packed register (r0l/r0h say) can we use bitop_mov on the 32-bit register (r0) for vectorization?#asahi-gpu · 2021-04-17 15:31
bloomOh, theres's a cute optimization I need to check the legitimacy of#asahi-gpu · 2021-04-17 04:57
blooma lot of this stuff is irrelevant/invisible to software#asahi-gpu · 2021-04-17 04:57
bloomor not#asahi-gpu · 2021-04-17 04:54
bloomOh, I see.#asahi-gpu · 2021-04-17 04:53
bloomsome of that is speculation from anandtech#asahi-gpu · 2021-04-17 04:53
bloomdunno where the 128 execution units comes from#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: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:15
bloommin(1024, math.floor((SZ_ / (math.ceil(reg_count / 4)*4*4)) / 64) * 64)#asahi-gpu · 2021-04-17 04:15
bloomExpanding out: