vllm.models.minimax_m3.common.vision_tower
¶
Classes:
-
MiniMaxVLAttention–Multi-head attention with MiniMax's partial 3D RoPE.
-
MiniMaxVLEncoderLayer–Single CLIP-style transformer block.
-
MiniMaxVLMultiModalProjector–Two-layer MLP projector: vision_hidden → text_hidden.
-
MiniMaxVLPatchEmbed–Conv3d-based patch embedding.
-
MiniMaxVLVisionModel–Full vision model: ViT → projector → patch merger.
-
MiniMaxVLVisionTransformer–CLIP-based ViT with 3D RoPE (t/h/w decomposed).
MiniMaxVLAttention
¶
Bases: Module
Multi-head attention with MiniMax's partial 3D RoPE.
Partial means only the first rot_dim (< head_dim) dimensions of
Q and K are rotated; the remaining dims are passed through unchanged.
Source code in vllm/models/minimax_m3/common/vision_tower.py
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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 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 | |
MiniMaxVLEncoderLayer
¶
Bases: Module
Single CLIP-style transformer block.
Source code in vllm/models/minimax_m3/common/vision_tower.py
MiniMaxVLMultiModalProjector
¶
Bases: Module
Two-layer MLP projector: vision_hidden → text_hidden.
Source code in vllm/models/minimax_m3/common/vision_tower.py
MiniMaxVLPatchEmbed
¶
Bases: Module
Conv3d-based patch embedding.
Takes flat tokens of shape (N, C * temporal_patch_size * patch_size²) and projects each to a hidden-size embedding.
Source code in vllm/models/minimax_m3/common/vision_tower.py
MiniMaxVLVisionModel
¶
Bases: Module
Full vision model: ViT → projector → patch merger.
Source code in vllm/models/minimax_m3/common/vision_tower.py
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 | |
MiniMaxVLVisionTransformer
¶
Bases: Module
CLIP-based ViT with 3D RoPE (t/h/w decomposed).
Faithfully mirrors the reference MiniMaxVLVisionTransformer.
FLASHINFER backend is not supported; standard flash-attn is used.
Methods:
-
prepare_encoder_metadata–Build all grid-dependent forward inputs as standalone tensors.
Source code in vllm/models/minimax_m3/common/vision_tower.py
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 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 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 | |
prepare_encoder_metadata(grid_thw, *, device, max_batch_size=None, max_seqlen_override=None)
¶
Build all grid-dependent forward inputs as standalone tensors.
The eager path calls this per forward; encoder CUDA graphs call it at capture (dummy grids, padded to fixed buffer sizes) and before each replay (real grids, unpadded — the manager's padding logic completes the captured buffers).
Parameters:
-
(grid_thw¶list[list[int]]) –per-item [t, h, w] patch grids (host metadata).
-
(device¶device) –device for the attention metadata tensors.
-
(max_batch_size¶int | None, default:None) –pad cu_seqlens to this many segments with empty (zero-length) trailing segments; None leaves it unpadded.
-
(max_seqlen_override¶int | None, default:None) –bake this max_seqlen instead of deriving it from the grids; CUDA graph capture passes a worst-case value because max_seqlen is a CPU scalar baked into the graph.
Source code in vllm/models/minimax_m3/common/vision_tower.py
397 398 399 400 401 402 403 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 | |