vllm.models.muse_spark.amd.muse_moe_runner
¶
ROCm MoE implementation for Muse Spark checkpoints.
Classes:
-
MuseMoERunner–MoE runner whose custom reducer owns the TP reduction.
-
MuseSparkAiterExperts–AITER experts that return one unweighted output per selected route.
-
MuseSparkQuarkOCPMXFusedMoE–Quark W4A4 method using route-preserving stock AITER experts.
-
MuseSparkQuarkW8A8Fp8FusedMoE–Quark W8A8 FP8 method using route-preserving Triton experts.
-
MuseSparkRoutedExperts–MuseSpark routed experts using ROCm BF16, FP8, or MXFP4 methods.
-
MuseSparkRouter–Muse Spark top-k router.
-
MuseSparkTopKWeightAndReduce–Apply MuseSpark's per-route norm before router weighting and reduction.
-
MuseSparkTritonExperts–Triton experts that expose unweighted GEMM2 output per route.
Functions:
-
validate_bf16_deployment–Reject deployments whose BF16 finalization is not implemented.
-
validate_fp8_deployment–Reject deployments whose FP8 finalization is not implemented.
-
validate_mxfp4_deployment–Reject deployments whose MXFP4 finalization is not implemented.
MuseMoERunner
¶
Bases: MoERunner
MoE runner whose custom reducer owns the TP reduction.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
MuseSparkAiterExperts
¶
Bases: _RouteOutputHandoff, AiterMxfp4Experts
AITER experts that return one unweighted output per selected route.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
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 558 559 | |
_unit_weights(num_routes, width, device)
¶
A cached [num_routes, width] fp32 ones buffer (grown on demand).
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
MuseSparkOnlineMXFP4FusedMoE
¶
Bases: Mxfp4OnlineMoEMethod
Unquantized routed experts rounded to OCP MXFP4 (W4A4) after loading, by the online quantization infrastructure, on route-preserving stock AITER experts.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
MuseSparkQuarkOCPMXFusedMoE
¶
Bases: QuarkOCP_MX_MoEMethod
Quark W4A4 method using route-preserving stock AITER experts.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
MuseSparkQuarkW8A8Fp8FusedMoE
¶
Bases: QuarkW8A8Fp8MoEMethod
Quark W8A8 FP8 method using route-preserving Triton experts.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
MuseSparkRoutedExperts
¶
Bases: MuseSparkConsolidatedRoutedExperts
MuseSpark routed experts using ROCm BF16, FP8, or MXFP4 methods.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.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 | |
_get_online_quant_method(prefix, quant_config, moe_config)
¶
Online quantization (--quantization-config) of the BF16 experts.
Layers excluded by the config (ignore, e.g. the first and last decoder
layers, which the Quark MXFP4 export keeps in BF16) stay unquantized.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
MuseSparkRouter
¶
Bases: BaseRouter
Muse Spark top-k router.
Optional metap output multiplier -> sigmoid/softmax -> add expert bias for SELECTION only -> top-k -> gather UNBIASED scores -> divide by (sum + division_eps) -> scale by route_scale.
Attributes:
-
routing_method_type(RoutingMethodType) –Classify this router in vLLM's routing vocabulary.
Source code in vllm/models/muse_spark/common/moe.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 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 | |
routing_method_type
property
¶
Classify this router in vLLM's routing vocabulary.
_compute_routing_native(router_logits, indices_type)
¶
The recipe in torch: the kernel's reference, and the CPU path.
Source code in vllm/models/muse_spark/common/moe.py
MuseSparkTopKWeightAndReduce
¶
Bases: TopKWeightAndReduce
Apply MuseSpark's per-route norm before router weighting and reduction.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
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 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | |
MuseSparkTritonExperts
¶
Bases: _RouteOutputHandoff, TritonExperts
Triton experts that expose unweighted GEMM2 output per route.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
MuseSparkUnquantizedFusedMoE
¶
Bases: UnquantizedFusedMoEMethod
BF16 MoE method pinned to the MuseSpark-aware Triton experts.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
_RouteOutputHandoff
¶
Hand the experts' per-route buffer to the finalize instead of copying it.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
validate_bf16_deployment(moe_config)
¶
Reject deployments whose BF16 finalization is not implemented.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
validate_fp8_deployment(moe_config)
¶
Reject deployments whose FP8 finalization is not implemented.
Source code in vllm/models/muse_spark/amd/muse_moe_runner.py
validate_mxfp4_deployment(moe_config)
¶
Reject deployments whose MXFP4 finalization is not implemented.