vllm.models.muse_spark.nvidia.specialized_decode.cutedsl.gemm.unpooler
¶
The Muse Spark unpooler GEMM for small M: this rank's column block y[M, N] = x[M, K] @ W[N, K]^T of the MoE unpooler (N = hidden / tp, K = 4096), BF16 in and out, FP32 accumulate, 1 <= M <= 16. An optional epilogue also publishes y into the next boundary's Lamport mailbox (zero-copy publish).
Grid (N / 16, S), cluster (1, S, 1) when S > 1. CTA (t, s) owns output features [16 t, 16 t + 16) and the K slice [s K / S, (s + 1) K / S); each of its warps owns K / (S * warps) consecutive K. Operands are loaded straight into registers and fed to mma.sync.m16n8k16 (A = 16 weight rows, B = 8 tokens).
Weights are loaded before griddepcontrol.wait, activations after it. Each warp's FP32 partial goes to cluster rank 0's shared memory, which sums the partials in a fixed order, rounds to BF16 and stores y. The summation order depends only on the launch shape, so runs are bitwise reproducible.
Zero-copy epilogue (zerocopy): rank 0 also multicasts y (-0.0 stored as
+0.0) into this rank's slot of the next boundary's LamportMailbox at stage
NEXT_STAGE and sets ACTIVE_STAGE, the same bytes and stage word the mailbox's
own publisher would write.
Ticket stage (ticket_stage, with zerocopy): the stage is instead the
upper 16 bits of the draft boundary's ticket word, and no stage word is stored;
the consuming boundary advances the stage itself.
Classes:
-
Unpooler–One MoE layer's unpooler column block, prepared at build (before CUDA
Functions:
-
compile_unpooler–The compiled kernel for weight [n, k] and one token tile; called as
-
launch_unsupported–Why the kernel has no launch for an [n, k] weight with K split over
Unpooler
¶
One MoE layer's unpooler column block, prepared at build (before CUDA graph capture): the [N, K] BF16 weight shard (this rank's rows of the replicated unpooler weight) and the kernels of both token tiles compiled.
With mailbox (the next boundary's LamportMailbox, width N) the epilogue
also publishes y into it (zero-copy); without, y is only stored and the
boundary publishes it. With ticket (int32 [1], stage << 16: the draft
boundary's ticket on that mailbox) the slot's stage is the ticket's, and the
mailbox's own stage state is not used. With rows only the token tiles
those row counts take are compiled at build (default: every row count); a
call with another row count compiles its tile then, which must not happen
under CUDA graph capture. run is graph-capturable and allocates
nothing.
Methods:
-
from_moe–The unpooler of a MuseSpark1xMoE: rows [rank N, (rank + 1) N) of its
-
run–out[m, N] = x[m, K] @ W^T (and its publish with a mailbox).
-
unsupported–Why the GEMM cannot take
weight(an [N, K] shard) at launch
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/gemm/unpooler.py
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 | |
from_moe(moe, tp, rank, mailbox=None, **options)
classmethod
¶
The unpooler of a MuseSpark1xMoE: rows [rank N, (rank + 1) N) of its replicated [hidden, K] weight, N = hidden / tp (as the stock _project_local_columns takes them).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/gemm/unpooler.py
run(x, out)
¶
out[m, N] = x[m, K] @ W^T (and its publish with a mailbox).
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/gemm/unpooler.py
unsupported(weight, shape=UNPOOLER)
staticmethod
¶
Why the GEMM cannot take weight (an [N, K] shard) at launch
shape shape, or None: the constructor's checks of both, which it
raises as ValueError.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/gemm/unpooler.py
compile_unpooler(n, k, token_tile, *, splits, kw, accs, enable_pdl=True, zerocopy=False, tp=1, rank=0, capacity_m=1, hidden_local=0, ticket_stage=False)
cached
¶
The compiled kernel for weight [n, k] and one token tile; called as
fn(weight, x, out, stage_state, mailbox_multicast_address, m, stream) with
flat views (Unpooler binds them; stage_state is the ticket word
with ticket_stage). Shared by every layer of one shape.
Source code in vllm/models/muse_spark/nvidia/specialized_decode/cutedsl/gemm/unpooler.py
launch_unsupported(n, k, splits, kw, accs)
¶
Why the kernel has no launch for an [n, k] weight with K split over
splits CTAs, kw K per warp and accs accumulators, or None.