Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/gpu/amd/gfx942/fp8gemv_b128.isa # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / gpu / amd / gfx942 / fp8gemv_b128.isa` 239 lines ยท 3926 bytes Raw Blame History 1 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 # Seeded Omega hsaco.om input. OCP E4M3, BF16 scale per 128x128 block. 3 # One wave per row, lane k and k+64, XOR block reduction, ascending block FMA. 4 K fp8gemv_b128 40 8 0 0 24 24 0 64 64 5 0xaf0082 0x84 8 5 A W 0 8 0 6 A x 8 8 0 7 A scale_inv 16 8 0 8 A y 24 8 0 9 A M 32 4 1 10 A K 36 4 1 11 F 1 2 12 B 1 0 26 6 0x30 13 D 1 0 0 0 6 14 D 1 1 0 6 7 15 D 1 2 0 16 1 16 D 1 3 0 17 1 17 D 1 4 0 18 8 18 D 1 5 1 0 21 19 F 2 1 20 B 2 0 30 2 2 21 D 2 0 0 0 8 22 D 2 1 0 8 8 23 D 2 2 0 16 7 24 D 2 3 0 23 7 25 F 3 1 26 B 3 0 23 9 0x17d 27 D 3 0 0 0 8 28 D 3 1 0 8 8 29 D 3 2 0 16 7 30 F 4 1 31 B 4 0 23 9 0x17f 32 D 4 0 0 0 16 33 D 4 1 0 16 7 34 F 5 1 35 B 5 0 31 1 0 36 D 5 0 0 0 9 37 D 5 1 0 9 8 38 D 5 2 0 17 8 39 D 5 3 0 25 6 40 F 6 1 41 B 6 0 25 7 0x3e 42 D 6 0 0 0 9 43 D 6 1 0 9 8 44 D 6 2 0 17 8 45 F 7 2 46 B 7 0 26 6 0x37 47 D 7 0 0 0 13 48 D 7 1 0 13 1 49 D 7 2 0 14 2 50 D 7 3 0 16 1 51 D 7 4 0 17 1 52 D 7 5 0 18 7 53 D 7 6 0 25 1 54 D 7 7 1 0 8 55 D 7 8 1 8 8 56 D 7 9 1 16 7 57 D 7 10 1 23 1 58 D 7 11 1 24 8 59 F 8 1 60 B 8 0 25 7 0x3f 61 D 8 0 0 0 9 62 D 8 1 0 9 8 63 D 8 2 0 17 8 64 F 9 2 65 B 9 0 26 6 0x34 66 D 9 0 0 0 8 67 D 9 1 0 16 10 68 D 9 2 1 0 9 69 D 9 3 1 9 9 70 F 10 2 71 B 10 0 25 7 0x3f 72 B 10 0 0 9 249 73 B 10 0 9 8 84 74 B 10 1 8 3 6 75 D 10 0 0 17 8 76 D 10 1 1 0 8 77 F 11 2 78 B 11 0 26 6 0x36 79 B 11 0 17 8 63 80 D 11 0 0 0 16 81 D 11 1 1 0 8 82 D 11 2 1 8 8 83 D 11 3 1 24 8 84 # Load kernarg and refuse overdispatch rows. 85 I 1 0 4 0 1 2 0 86 I 1 0 8 0 1 2 16 87 I 1 0 12 0 1 1 32 88 I 4 0xc07f 12 89 I 2 2 12 17 1 90 I 4 @9 4 91 I 5 255 0 0 19 92 L 1023 93 I 8 2 1 1 94 # W + row*K + lane, with full 64-bit products/carries. 95 I 9 6 645 257 13 96 I 9 7 646 257 13 97 I 8 5 1 5 98 I 5 4 6 6 25 99 I 5 261 7 7 28 100 I 5 256 6 6 25 101 I 5 128 7 7 28 102 # x + lane*4. 103 I 5 130 0 8 18 104 I 8 128 1 9 105 I 8 7 1 5 106 I 5 6 8 8 25 107 I 5 261 9 9 28 108 # y + row*4. 109 I 5 130 1 10 18 110 I 5 158 1 11 16 111 I 8 11 1 5 112 I 5 10 10 10 25 113 I 5 261 11 11 28 114 # ceil(K/128); K=0 exits before any scale load. 115 I 2 13 129 4 1 116 I 2 4 135 4 30 117 I 2 4 129 4 0 118 # Scale row = row/128; linear scale index = scale_row*ceil(K/128). 119 I 5 135 1 1 16 120 I 9 12 645 257 4 121 I 9 13 646 257 4 122 I 5 159 12 5 16 123 I 5 129 12 12 18 124 I 5 129 13 13 18 125 I 5 261 13 13 52 126 I 8 9 1 5 127 I 5 8 12 12 25 128 I 5 261 13 13 28 129 I 8 128 1 16 130 I 3 13 0 16 131 I 2 16 129 17 1 132 I 4 @8 5 133 T 1 134 I 8 128 1 4 135 # First half of block, predicated individually for K tails. 136 I 6 16 0 204 137 I 3 106 32 14 138 I 7 0 0 2 0 0 16 0 6 0 127 0 3 139 I 7 0 0 2 0 0 20 0 8 0 127 0 5 140 I 4 0x0f70 12 141 # OCP magnitude -> native FNUZ -> times two; apply original sign, including -0. 142 I 5 255 3 17 19 143 L 128 144 I 5 152 17 17 18 145 I 5 255 3 18 19 146 L 127 147 I 8 274 1 3 148 I 10 3 3 149 I 5 244 3 3 5 150 I 5 273 3 3 21 151 # OCP +/-0x7f are NaN, unlike FNUZ; mask only those lanes. 152 # Compare magnitude > 126 using a temporary vector constant. 153 I 8 255 1 19 154 L 126 155 I 6 274 19 204 156 I 3 106 32 4 157 I 8 255 1 3 158 L `2143289344` 159 I 3 4 1 126 160 I 5 259 5 4 59 161 I 3 14 1 126 162 # Second half of block. 163 I 5 192 0 15 52 164 I 6 16 15 204 165 I 3 106 32 14 166 I 7 64 0 2 0 0 16 0 6 0 127 0 3 167 I 7 256 0 2 0 0 20 0 8 0 127 0 5 168 I 4 0x0f70 12 169 I 5 255 3 17 19 170 L 128 171 I 5 152 17 17 18 172 I 5 255 3 18 19 173 L 127 174 I 8 274 1 3 175 I 10 3 3 176 I 5 244 3 3 5 177 I 5 273 3 3 21 178 I 8 255 1 19 179 L 126 180 I 6 274 19 204 181 I 3 106 32 4 182 I 8 255 1 3 183 L `2143289344` 184 I 3 4 1 126 185 I 5 259 5 4 59 186 I 3 14 1 126 187 # Wave reduction within the block. 188 I 5 130 0 2 18 189 I 5 255 2 15 21 190 L 128 191 I 11 0 15 4 5 192 I 4 0xc07f 12 193 I 5 260 5 4 1 194 I 5 192 2 15 21 195 I 11 0 15 4 5 196 I 4 0xc07f 12 197 I 5 260 5 4 1 198 I 5 160 2 15 21 199 I 11 0 15 4 5 200 I 4 0xc07f 12 201 I 5 260 5 4 1 202 I 5 144 2 15 21 203 I 11 0 15 4 5 204 I 4 0xc07f 12 205 I 5 260 5 4 1 206 I 5 136 2 15 21 207 I 11 0 15 4 5 208 I 4 0xc07f 12 209 I 5 260 5 4 1 210 I 5 132 2 15 21 211 I 11 0 15 4 5 212 I 4 0xc07f 12 213 I 5 260 5 4 1 214 # BF16 direct into upper half, explicit zero lower half. 215 I 8 128 1 17 216 I 7 0 0 2 0 0 37 0 12 0 127 0 17 217 I 4 0x0f70 12 218 I 5 273 4 16 59 219 # Stop after the last (possibly partial) block, otherwise advance all pointers. 220 I 2 16 255 17 1 221 L 129 222 I 4 @8 5 223 I 2 16 255 16 1 224 L 128 225 I 5 255 6 6 25 226 L 128 227 I 5 128 7 7 28 228 I 5 255 8 8 25 229 L 512 230 I 5 128 9 9 28 231 I 5 130 12 12 25 232 I 5 128 13 13 28 233 I 4 @1 4 234 T 8 235 I 6 129 0 204 236 I 3 106 32 14 237 I 7 0 0 2 0 0 28 0 10 16 127 0 0 238 T 9 239 I 4 0 1