vllm.model_executor.models.cosmos3_edge ¶
Classes:
-
Cosmos3EdgeAttention–Nemotron-H attention with interleaved multimodal RoPE.
-
Cosmos3EdgeAttentionDecoderLayer–Pre-norm attention layer for the Cosmos3 Edge dense text model.
-
Cosmos3EdgeForCausalLM–Minimal CausalLM wrapper for the Cosmos3 Edge dense text model.
-
Cosmos3EdgeForConditionalGeneration–Cosmos3 Edge model with a SigLIP2 vision encoder.
-
Cosmos3EdgePatchMerger–Projector: LayerNorm -> Linear -> GELU -> Linear
-
Cosmos3EdgeTextModel–Nemotron-H backbone with Cosmos-owned checkpoint name mapping.
-
Cosmos3EdgeVisionEncoder–Adapts Cosmos (T, H, W) metadata to vLLM packed SigLIP2.
-
Cosmos3EdgeVisionModel–Complete Cosmos vision tower returning language-model embeddings.
Functions:
-
patch_merging_by_param–Merge each spatial
merge_sizeblock into the channel dimension.
Cosmos3EdgeAttention ¶
Bases: NemotronHAttention
Nemotron-H attention with interleaved multimodal RoPE.
Source code in vllm/model_executor/models/cosmos3_edge.py
Cosmos3EdgeAttentionDecoderLayer ¶
Bases: Module
Pre-norm attention layer for the Cosmos3 Edge dense text model.
Source code in vllm/model_executor/models/cosmos3_edge.py
Cosmos3EdgeForCausalLM ¶
Bases: Module
Minimal CausalLM wrapper for the Cosmos3 Edge dense text model.
Source code in vllm/model_executor/models/cosmos3_edge.py
Cosmos3EdgeForConditionalGeneration ¶
Bases: Module, SupportsMultiModal, SupportsPP, SupportsMRoPE
Cosmos3 Edge model with a SigLIP2 vision encoder.
Architecture
- self.visual: SigLIP2 encoder + patch merger + projector
- self.language_model: Cosmos3EdgeForCausalLM (pure attention + RoPE)
Source code in vllm/model_executor/models/cosmos3_edge.py
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 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 | |
_get_image_features(pixel_values, grid_thw) ¶
Run the complete vision tower and split by media item.
Source code in vllm/model_executor/models/cosmos3_edge.py
Cosmos3EdgePatchMerger ¶
Bases: Module
Projector: LayerNorm -> Linear -> GELU -> Linear
Reads config from projector_config (not vision_config). input_hidden_size * spatial_merge_size² -> merger_intermediate_size -> out_hidden_size
Source code in vllm/model_executor/models/cosmos3_edge.py
Cosmos3EdgeTextModel ¶
Bases: NemotronHModel
Nemotron-H backbone with Cosmos-owned checkpoint name mapping.
Source code in vllm/model_executor/models/cosmos3_edge.py
Cosmos3EdgeVisionEncoder ¶
Bases: Siglip2VisionTransformer
Adapts Cosmos (T, H, W) metadata to vLLM packed SigLIP2.
Source code in vllm/model_executor/models/cosmos3_edge.py
Cosmos3EdgeVisionModel ¶
Bases: Module
Complete Cosmos vision tower returning language-model embeddings.
Source code in vllm/model_executor/models/cosmos3_edge.py
_cosmos3_edge_diffusers_prefix_map() ¶
Map Diffusers blocks to interleaved Nemotron-H layers.
The checkpoint stores attention and MLP in one layers.N block, while the Nemotron-H model represents them as separate decoder layers. Therefore, checkpoint block N maps its attention to layer 2N and its MLP to layer 2N + 1.
Source code in vllm/model_executor/models/cosmos3_edge.py
patch_merging_by_param(image_embeds, grid_thw, merge_size=2) ¶
Merge each spatial merge_size block into the channel dimension.