vllm.models.kimi_k3.nvidia.specialized_decode.cutedsl.attn_res.kernel
¶
Seven-CTA cluster AttnRes: one cluster per token, 1024 hidden columns per CTA.
The delta is a tensor (read after the PDL wait) or slots Lamport mailbox slots
summed in slot order, rounded to BF16 and re-armed. The final boundary rounds the
mixture to BF16 before its RMSNorm. Prefix and saved blocks must be complete at launch.
Classes:
Functions:
-
arm_exchanges–Thread 0 arms barrier
rforcounts[r]FP32 pushes from each of 7 CTAs. -
block_ptr–&blocks[token, block, col]from the tensor's strides. -
rstd–Reciprocal RMS of a 7168-wide row from its sum of squares.
ClusterAttnRes
¶
Methods:
-
exchange–Cluster-sum
countper-thread partials into roundr's total row. -
post–Add the delta, update prefix (and its
auxcopy) and saved block, write -
pre–Inputs complete at launch, then the saved-block statistics exchange.
-
state–Carried from pre() to post(); the rest reloads so a GEMM can run between.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/attn_res/kernel.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
exchange(values, count, kpad, bufs, r, ids)
¶
Cluster-sum count per-thread partials into round r's total row.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/attn_res/kernel.py
post(state, bufs, delta, rows, output, eps, out_eps, ids, aux)
¶
Add the delta, update prefix (and its aux copy) and saved block, write
the normalized output.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/attn_res/kernel.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
pre(state, bufs, rows, eps, ids)
¶
Inputs complete at launch, then the saved-block statistics exchange.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/attn_res/kernel.py
state()
¶
Carried from pre() to post(); the rest reloads so a GEMM can run between.
arm_exchanges(bars, counts)
¶
Thread 0 arms barrier r for counts[r] FP32 pushes from each of 7 CTAs.
Source code in vllm/models/kimi_k3/nvidia/specialized_decode/cutedsl/attn_res/kernel.py
block_ptr(blocks, token, block, col)
¶
&blocks[token, block, col] from the tensor's strides.
rstd(sum_sq, eps)
¶
Reciprocal RMS of a 7168-wide row from its sum of squares.