vllm.models.step5.nvidia.model
¶
Inference-only Step5 model.
Classes:
-
Step5FusedQKVIndexerLinear–Main-attention qkv and the sparse-indexer q/k/z/g in one GEMM.
-
Step5SparseIndexerIndexTPLinear–Sparse-indexer linear sharded by its own tensor-parallel size.
Step5FusedQKVIndexerLinear
¶
Bases: QKVParallelLinear
Main-attention qkv and the sparse-indexer q/k/z/g in one GEMM.
Both projections consume the same normed hidden state, so they live in a
single weight [qkv_rows | indexer_rows] and one hidden @ W replaces two
GEMMs. The indexer rows are appended to the qkv rows of the base class, which
keeps every q/k/v shard offset (and the kv-head replication for
total_num_kv_heads < tp_size) inside QKVParallelLinear.weight_loader_v2
instead of being reimplemented here.
Methods:
-
assert_fully_loaded–Fail unless this load covered every shard, then forget the record.
Source code in vllm/models/step5/nvidia/model.py
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 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 | |
assert_fully_loaded(prefix)
¶
Fail unless this load covered every shard, then forget the record.
Tracking per load (instead of latching a flag on first success) is what makes weight reloading safe: a reload materializes fresh uninitialized storage for the whole parameter, so a shard the new weight stream omits would otherwise silently become garbage.
Source code in vllm/models/step5/nvidia/model.py
Step5SparseIndexerIndexTPLinear
¶
Bases: Module
Sparse-indexer linear sharded by its own tensor-parallel size.
Source code in vllm/models/step5/nvidia/model.py
_get_step5_layer_types(config)
¶
Per-layer attention types spanning the dense stack and the MTP layers.
config.layer_types only covers the dense stack so that transformers' own
length validation passes; the MTP block indexes past it.
Source code in vllm/models/step5/nvidia/model.py
_set_step5_moe_protocol_metadata(model, example_layer)
¶
Populate the MoE protocol for the layers local to this PP rank.
Source code in vllm/models/step5/nvidia/model.py
_step5_group_partition(*, total_groups, tp_size, tp_rank)
¶
Return the first local group, group count, and replication factor.
Source code in vllm/models/step5/nvidia/model.py
_step5_groups_per_rank(total_groups, tp_size)
¶
Return the number of contiguous groups visible on one TP rank.
Source code in vllm/models/step5/nvidia/model.py
_step5_moe_reduce_policy(tp_size, dp_size)
¶
Return combined-reduce and per-path-reduce settings for Step5 MoE.
Source code in vllm/models/step5/nvidia/model.py
_validate_step5_dsa_parallel_geometry(*, total_num_heads, total_num_kv_heads, indexer_num_heads, index_tp_size, tp_size)
¶
Fail fast when DSA provider and attention GQA groups diverge.
The sparse indexer reduces scores within provider groups, while the attention kernel consumes the corresponding KV groups. These partitions must describe the same global and per-rank geometry; otherwise the model still constructs but selects regions for the wrong query/KV heads.