vllm.models.muse_spark.amd.mono.decoder
¶
MuseSpark1x decode monokernel: layers 1-60 of a verify step as FlyDSL launches.
See README.md. Every rank must take the same path (the kernel waits on its peers), so the decision uses only rank-invariant data: the static deployment checked at attach, the batch shape and the attention metadata counts.
Classes:
-
LayerWeights–Views of vLLM's parameters (and small norm copies) for layer i's launches.
-
MonoDims–Per-rank tensor sizes of a TP = EP rank.
-
MonoKernels–The FlyDSL kernel modules (
kernels.k3,k5,k5m,attn_frag). -
MuseSparkMono–Runs decoder layers 1-60 of eligible verify steps through the kernels.
Functions:
-
attention_type–"swa"/"full"when the fused attention can run layer's -
batch_refusal–Why this step runs stock, from rank-invariant data only; None = mono.
-
bucket_of–The kernel build that serves
rows(padded up); None = stock. -
built_buckets–The builds a server with
max_num_seqsrequests can use. -
collect_layer_weights–Layer i's kernel weights from decoder layers
iandi + 1; no copy. -
deployment_refusals–Parallel layout and server features the monokernel does not support.
-
effective_norm_weight–The bf16 multiplier the kernel applies:
weight (+ gain_center). -
fused_attention_layers–Layers whose attention the launches can fuse:
{i: type}. -
kv_cache_refusal–K3 writes bf16 LBHNC pages:
[block][kv head][16 tokens][K | V]. -
layer_refusals–Module and tensor guards for layers FIRST_LAYER .. LAST_LAYER + 1.
LayerWeights
dataclass
¶
Views of vLLM's parameters (and small norm copies) for layer i's launches.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
MonoDims
dataclass
¶
Per-rank tensor sizes of a TP = EP rank.
Methods:
-
expert_shapes–MXFP4 expert tensors of the local experts, as uint8.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
expert_shapes()
¶
MXFP4 expert tensors of the local experts, as uint8.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
MonoKernels
dataclass
¶
The FlyDSL kernel modules (kernels.k3, k5, k5m, attn_frag).
Source code in vllm/models/muse_spark/amd/mono/decoder.py
MuseSparkMono
¶
Runs decoder layers 1-60 of eligible verify steps through the kernels.
Methods:
-
poll_health–Raise if a launch timed out waiting for a peer rank.
-
refresh_weights–Re-take the views, e.g. after a weight reload replaced parameters.
-
try_forward–Returns the residual stream after the last layer, or None for stock.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 | |
_validate(attn_o, attn_g, stream)
¶
Check the stock layer-1 tensors the kernels read, once a row count.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
poll_health()
¶
Raise if a launch timed out waiting for a peer rank.
Reads the health words with an asynchronous copy every HEALTH_POLL_INTERVAL calls and checks the previous copy, so the step never waits for the device.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
refresh_weights(model)
¶
Re-take the views, e.g. after a weight reload replaced parameters.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
try_forward(model, positions, x, aux_hidden_states)
¶
Returns the residual stream after the last layer, or None for stock.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
_Bucket
¶
Launchers and persistent buffers of one kernel build (row count).
Methods:
-
layer–Layer i's launches; returns layer i + 1's (stream, q, g).
-
run–Layers FIRST_LAYER..LAST_LAYER; returns layer 61's (stream, q, g).
Source code in vllm/models/muse_spark/amd/mono/decoder.py
layer(mono, i, kind, attn_o, g, stream, kv, aux_layers)
¶
run(mono, layers, positions, o, g, stream, aux_layers, aux_hidden_states)
¶
Layers FIRST_LAYER..LAST_LAYER; returns layer 61's (stream, q, g).
Source code in vllm/models/muse_spark/amd/mono/decoder.py
_FusedAttention
¶
The fused attention of one build: its output, scratch and descriptor
tables (kernels/attn_frag.py; row i = layer i).
A table holds pointers and counts only (q, KV cache, block table, seq_lens, output, request count, scale). Tables are keyed by their contents, so one is written once and never changes after a CUDA graph captured a launch that reads it.
Methods:
-
table–The descriptor table of this step;
q_of(i)= layer i's q.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
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 | |
table(layers, q_of, num_reqs)
¶
The descriptor table of this step; q_of(i) = layer i's q.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
_K3Bucket
¶
Bases: _Bucket
8 / 16 rows: one K3 launch a layer.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
_K5Bucket
¶
Bases: _Bucket
24-128 rows: HA (attention boundary, router, pre-expert projection),
HM (the local experts) and HB (FFN boundary, next QKV) a layer; between
the launches the residual stream lives token-sharded unless the build
replicates it (key.bnd).
Source code in vllm/models/muse_spark/amd/mono/decoder.py
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 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 | |
attention_type(layer)
¶
"swa" / "full" when the fused attention can run layer's
attention (vLLM's sliding_window (2047, 0) or none); else None.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
batch_refusal(num_tokens, forward_context, layer_names)
¶
Why this step runs stock, from rank-invariant data only; None = mono.
Reads the attention metadata of the kernels' layers (layer_names) only:
the dict also holds the draft model's layers.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
bucket_of(rows)
¶
The kernel build that serves rows (padded up); None = stock.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
built_buckets(max_num_seqs)
¶
The builds a server with max_num_seqs requests can use.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
collect_layer_weights(layers, i, rank, dims)
¶
Layer i's kernel weights from decoder layers i and i + 1; no copy.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
deployment_refusals(vllm_config, tp_rank, tp_size, moe_parallel)
¶
Parallel layout and server features the monokernel does not support.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
effective_norm_weight(norm)
¶
The bf16 multiplier the kernel applies: weight (+ gain_center).
Source code in vllm/models/muse_spark/amd/mono/decoder.py
fused_attention_layers(layers, max_model_len, max_keys)
¶
Layers whose attention the launches can fuse: {i: type}.
Empty when a request may hold more keys than a build stages block ids for.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
kv_cache_refusal(kv_cache, kv_heads)
¶
K3 writes bf16 LBHNC pages: [block][kv head][16 tokens][K | V].
Source code in vllm/models/muse_spark/amd/mono/decoder.py
layer_refusals(model, dims)
¶
Module and tensor guards for layers FIRST_LAYER .. LAST_LAYER + 1.
Source code in vllm/models/muse_spark/amd/mono/decoder.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |