vllm.models.muse_spark.nvidia.specialized_decode.cutedsl.attention.attn2
¶
Muse Spark paged decode attention of the 8-token verify step, fused with the per-head output RMS norm (no weight) and the sigmoid gate, as one CuTe kernel.
head_dim 64, 8 query heads per KV head, BF16 or FP8 (E4M3) paged cache ([pages, HKV, P, 128], K in columns 0:64, V in 64:128), 8 query rows per request (the last 8 cache entries of the request), any context length L >= 8, optionally a sliding window. One launch covers the rank's KV heads (grid y); the heads are independent.
Two variants, picked on the host from the deployment's maximum length:
- One cluster (max_seq_len <= 2048, no window): a cluster of 16 CTAs of 4 warps owns 16 query-head rows of one request and one KV head. Warp w of CTA r attends pages 4 r + w + 64 i (the next page's registers load while one is attended) with an online softmax: mma.sync m16n8k16 BF16 -> FP32 for Q K^T and P V, the softmax weights rounded to BF16, V transposed in registers by movmatrix (head dims permuted: logical (j, 2 t + e) = 16 t + 2 j + e). The warps merge in shared memory, each CTA pushes its merged rows to the CTA that owns them over distributed shared memory (st.async, mbarrier transaction bytes), and the owner merges the 16 CTAs in rank order, rounds o / l to BF16 and applies the RMS norm and the gate.
- Split (longer contexts or a window): a request within 8 rounds of the cluster's warps (512 pages from row 0's first visible key) takes the path above in z slice 0, the other slices exit at once; a longer one spreads its pages over 4 num_splits clusters, each CTA streaming its pages through an 8-page cp.async ring, merges in the cluster over distributed shared memory and across clusters through a global workspace in cluster order (an arrival counter per row: the last arriver merges, then resets the counter to zero). The launch shape depends on the deployment only, so a captured graph serves every step. With window W, row t sees keys [L - 8 + t - W + 1, L - 8 + t].
FP8 pages (a compile-time variant, kv_format) load half the bytes and
widen to BF16 in registers (exact), so the mma path is the BF16 one; the
per-tensor k_scale folds into the softmax scale and v_scale into 1 / l. The
query stays BF16 (the stock TRT-LLM decode quantizes it to FP8).
Every FP32 operation is explicit PTX in the fast-math forms (subnormals flushed, ex2.approx, rcp.approx, rsqrt.approx) in a fixed order, so the result depends neither on the launch's timing nor on the device. Not bitwise to the stock decode + rmsnorm_sigmoid_gate pair: the softmax weights are rounded to BF16 before P V and the partials merge in FP32.
Functions:
-
attn2–`out [8 R, 512 kv_heads] = sigmoid(gate) * rmsnorm(attention(q,
-
compile_attn2–cute.compile one variant of the kernel for
kv_headsKV heads, -
counters_bytes–The workspace's uint32 counters, one per row, 16-byte padded.
-
page_bytes–Bytes of one KV head's 16-slot sub-page (K | V slots).
-
page_words–Registers a lane holds of one page as loaded (
_load_page). -
prepare–Compile the variant a deployment's layer launches (build time).
-
score_scales–(log2 score scale, v_scale) the kernel takes (FP32 as it reads them):
-
split_forms–(merge form, rolled short-path loop) of the split kernel.
-
split_kernel–Whether a deployment of
max_seq_lenlaunches the split kernel. -
window_pages–The most pages from row 0's first visible key to a request's last
-
workspace_bytes–Workspace bytes of a split launch over
rows(request, KV head,
_Attn2Kernel
¶
Grid (16 * 4 R, kv_heads, num_splits), cluster (16, 1, 1), 128 threads: cluster b * 4 + rg of KV head blockIdx.y computes rows 16 rg + [0, 16) of request b's 64 (token = row // 8, head = row % 8). The variant, PDL, the KV heads, the z slices, the window and the cache dtype are compile-time; shapes, strides, addresses and the scales are read at the call.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 | |
_attend_group(group, npages, page0, qf_frag, g, t, lim0, lim1, low0, low1, sl2, m0, m1, l0, l1, o, s, windowed, fmt)
¶
_attend_page for up to GROUP_PAGES pages staged in the ring (the
slots from shared address group, pages page0 + p) in one
online-softmax step.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_attend_page(cur, qf, pos, lim0, lim1, low0, low1, sl2, state, o, windowed, fmt)
¶
One page (16 keys) of online-softmax attention of the warp's rows g and g + 8 from registers; pos is the lane's first key, a row sees keys low <= key <= lim.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_check(q, kv_cache, block_table, seq_lens, gate, out, kv_heads, max_seq_len, window, num_splits, workspace, kv_quant)
¶
Raise ValueError naming the first condition the call fails, of those the kernel needs beyond the compiled call's own checks (dtypes, ranks, extents, unit strides, row strides, alignment); returns whether the split kernel runs.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 | |
_finish_row(ox, oy, ls, gate2, eps, out_row, lane, v_scale=None)
¶
The epilogue of one row (lane: dims 2 lane, 2 lane + 1): o / l (times
the FP8 cache's v_scale) rounded to BF16, RMS norm without weight,
sigmoid gate, BF16 store.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_issue_step(ring, step, count, first, bt_row, kv_base, kv_page_stride, tid, fmt)
¶
Copy the pages of ring step step (pages first + 4 step + [0, 4) of
this CTA's count; none past it) into ring slots 4 (step % 2) + [0, 4):
thread i the 16-byte chunks i and i + 128 of each page (FP8: chunk i). The
block-table entries load first, then the copies issue (traced inline).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_kv_words(regs, j, value, fmt)
¶
The eight BF16 words (head dims [16 t, 16 t + 16)) of the key or
value of slot 8 j + g in a page _load_page loaded.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_load_page(regs, kv_base, page_stride, entry, g, t, fmt)
¶
One KV page as a lane holds it, head dims [16 t, 16 t + 16): BF16, words 8 j .. 8 j + 7 the key slot 8 j + g, words 16 + 8 j .. the value slot 8 j + g; FP8, words 4 j .. 4 j + 3 the key slot, 8 + 4 j .. the value slot.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_load_rows(q_base, q_stride, token0, head0, token1, head1, t)
¶
A lane's query dims [16 t, 16 t + 16) of two query-head rows.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_long_cluster(q_base, q_stride, gate_base, gate_stride, kv_base, kv_page_stride, bt_row, out_base, out_stride, sl2, eps, v_scale, window, fmt, counters, partials, smem, seq_len, first, n, b, rank, warp, lane, tid, kvh, kv_heads, slots, split, active, per, merge)
¶
Cluster split of active of a long request: pages
first + split * per + [0, per) (clipped to the request).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 | |
_long_context(q_base, q_stride, gate_base, gate_stride, kv_base, kv_page_stride, bt_row, out_base, out_stride, sl2, eps, v_scale, window, fmt, counters, partials, smem, seq_len, first, n, b, rg, rank, warp, lane, tid, kvh, kv_heads, z, num_z, merge)
¶
A request of n pages from page first (more than SHORT_ROUNDS
rounds of a cluster's warps): the GROUPS * num_z clusters of the
(request, KV head) each take an equal contiguous page range; CTA r streams
its sixteenth of the range through the ring and warp w attends the 16 rows
of group w, so each page is read once per KV head. CTA r owns row
16 w + r of every group w, gathers the cluster's partials of it over
distributed shared memory and merges the clusters through the workspace.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 | |
_merge_cluster_long(recv, n_active, lane)
¶
The owner's merge of its row's partials from the cluster's first
n_active CTAs at recv (stride WARPS slots) in rank order:
(m, l, o[2 lane], o[2 lane + 1]).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_merge_cluster_one(recv, n_active, lane)
¶
The owner's merge of its row's CLUSTER partials at recv in rank
order (ranks below n_active hold pages): (l, o[2 lane], o[2 lane + 1]).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_merge_partials(counters, partials, row_id, slots, split, active, lane, m, ls, ox, oy, merge)
¶
Publish this cluster's (o, m, l) of a row, one of active; the warp
that completes the row's count returns (1, l, o[2 lane], o[2 lane + 1]),
the merge of every partial in cluster order (whichever warp is last,
loading them as merge says), after resetting the counter for the next
launch; the others return 0.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_merge_rows(row_partials, active, lane)
¶
(l, o[2 lane], o[2 lane + 1]) of a row's active cross-cluster
partials, merged in cluster order.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_merge_rows_batched(row_partials, slots, active, lane)
¶
_merge_rows with every partial's loads issued at once: (m, l) and
the o pair of each of the slots partials (those from active on
read partial active - 1 and are not merged).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_merge_rows_m(row_partials, slots, active, lane)
¶
_merge_rows with the m of each of the slots partials loaded at
once (those from active on read partial active - 1 and are not
merged).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_merge_warps_and_push(smem, mbar, tid, rank)
¶
Merge the CTA's four warp partials (8 lanes a row, lane i8 dims [4 i8, 4 i8 + 4) and [32 + 4 i8, ...)) and push row r to CTA r.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_online_step(s0, s1, state, o)
¶
One online-softmax step of rows g (scores s0) and g + 8 (s1): rescales o, returns the weights and the new (m0, m1, l0, l1).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_page_ref(bt_row, index, predicate, other, fmt)
¶
Sub-page index of a request as (block-table entry << shift) | sub:
its entry's index >> shift, or other (a ref) when not predicate.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_page_round(cur, nxt, pg, qf_frag, num_pages, first_page, gw, e_second, bt_row, kv_base, kv_page_stride, g, t, lim0, lim1, low0, low1, sl2, m0, m1, l0, l1, o, windowed, fmt)
¶
One round of the warp's page loop: page pg (in cur) attended while
page pg + 64 loads into nxt, which then becomes cur.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_push_rows(smem, mbar, warp, lane, rank)
¶
The long path's push: warp w's row r (8 lanes a row, 4 rows a lane group) to CTA r.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_pv(o, p0, p1, vlo, vhi)
¶
O += P V for one page: p0 / p1 the BF16-rounded weights of rows g and g + 8 (keys 2 t, 2 t + 1, 8 + 2 t, 9 + 2 t), vlo / vhi the value words of slots g and 8 + g.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_qf(qr)
¶
The four A fragments of the queries, from a lane's 16-byte loads of rows g (qr[0], qr[1]) and g + 8 (qr[2], qr[3]).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_ring_kv_words(page, slot, t, value, fmt)
¶
The eight BF16 words (head dims [16 t, 16 t + 16)) of the key or
value of slot in the ring page at shared address page.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_scores(kw, qf)
¶
Q K^T of a lane's rows g, g + 8 and keys 2 t, 2 t + 1 of eight slots (kw: their key words): (g, k0), (g, k1), (g + 8, k0), (g + 8, k1).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_short_path(q_base, q_stride, gate_base, gate_stride, kv_base, kv_page_stride, bt_row, out_base, out_stride, sl2, eps, v_scale, window, fmt, smem, seq_len, b, rg, rank, warp, lane, tid, first_page, num_pages, e_first, e_second, split, rolled, rounds)
¶
The one-cluster computation of the cluster's 16 rows: pages
first_page + [0, num_pages) of the request (their first two
block-table entries of this warp read: e_first, e_second), at most two
rounds of the cluster's warps in the one-cluster kernel, SHORT_ROUNDS in
the split kernel (rounds > 0: a window's at most rounds rounds,
straight-line; else a loop the compiler unrolls, or a rolled loop in the
one-cluster kernel or with rolled).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | |
_slot_words(address, fmt)
¶
The eight BF16 words of 16 head dims of a BF16 or FP8 ring slot at
address.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_split_ref(ref, fmt)
¶
(block-table entry, sub-page) of a _page_ref.
_stash_partial(so, sm, sl, g, t, o, m0, m1, l0, l1)
¶
A warp's softmax state (lane: dims [16 t, 16 t + 16) of rows g and
g + 8) as rows of logical dims at so, with the row maxima at sm
and sums at sl.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_wait_phase0(mbar)
¶
Spin until the mbarrier's phase 0 completes (cluster-scope acquire), one bounded wait per iteration.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
_widen(raw)
¶
Eight BF16 words of the 16 E4M3 head dims in four raw words, in the BF16 cache's word order.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
attn2(q, kv_cache, block_table, seq_lens, gate, out, kv_heads, enable_pdl=True, max_seq_len=SHORT_MAX_LEN, window=0, num_splits=1, workspace=None, kv_quant=None)
¶
out [8 R, 512 kv_heads] = sigmoid(gate) * rmsnorm(attention(q,
kv_cache)) per query head for R = q.shape[0] / 8 requests whose 8 query
rows are the last 8 of their seq_lens cache entries.
q, gate and out hold the heads of each KV head contiguously (8 x 64
columns per KV head); their rows may be strided (q and gate are column
views of the attention front's output, split_qkv). kv_cache is the
layer's cache: BF16 without kv_quant, else FP8 with its
per-tensor scales (kv_format). Lengths must be
8..max_seq_len and covered by the first ceil(L / 16) block_table entries
(device values, not checked here). max_seq_len is the deployment's maximum
length: above 2048, or with window > 0 (row t of a request sees keys
[L - 8 + t - window + 1, L - 8 + t]), the split kernel runs over
num_splits z slices and needs workspace, uint8 of at least
workspace_bytes whose counters are zero before the first call (every
call leaves them zero). Launched on the current stream of the inputs'
device (the compiled call switches to q's device and back), with PDL when
enable_pdl. Raises ValueError on inputs outside this contract (some
through the compiled call's own checks); allocates nothing, so a call is
graph-capturable once prepare has compiled its variant.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 | |
compile_attn2(split, enable_pdl, kv_heads, num_splits, window, fmt=kvf.BF16, options='')
cached
¶
cute.compile one variant of the kernel for kv_heads KV heads,
num_splits z slices (1 for the one-cluster kernel), window (0:
none) and a cache of layout fmt (kv_format; FP8 as uint8), with
these extra compile options, before CUDA graph capture. The result
takes q, gate, kv_cache, block_table, seq_lens, out, the workspace (None
for the one-cluster kernel), the log2 score scale and v_scale, checks the
tensors' dtypes, ranks, the static extents, unit strides, row-stride
divisibility and alignment, and launches on the current stream.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 | |
counters_bytes(rows)
¶
The workspace's uint32 counters, one per row, 16-byte padded.
page_bytes(fmt)
¶
Bytes of one KV head's 16-slot sub-page (K | V slots).
page_words(fmt)
¶
Registers a lane holds of one page as loaded (_load_page).
prepare(max_seq_len, window, kv_heads, num_splits, enable_pdl=True, fmt=kvf.BF16)
¶
Compile the variant a deployment's layer launches (build time).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
score_scales(kv_quant)
¶
(log2 score scale, v_scale) the kernel takes (FP32 as it reads them): the softmax scale times k_scale, and v_scale (1 for a BF16 cache).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
split_forms(kv_heads, num_splits)
¶
(merge form, rolled short-path loop) of the split kernel.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
split_kernel(max_seq_len, window)
¶
Whether a deployment of max_seq_len launches the split kernel.
window_pages(window)
¶
The most pages from row 0's first visible key to a request's last
with window (0: no window, no bound): ceil(L / 16) - (L - 7 - W) // 16
at most.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/attention/attn2.py
workspace_bytes(rows, num_splits)
¶
Workspace bytes of a split launch over rows (request, KV head,
query-head) rows: the counters, then a partial of SLOT floats per row and
cluster of its (request, KV head).