vllm.model_executor.models.molmo ¶
BlockCollection ¶
Bases: Module
Collection of residual attention blocks used in Vision Transformer.
Source code in vllm/model_executor/models/molmo.py
ImageProjectorMLP ¶
Bases: Module
Molmo's image_projector mlp.
Source code in vllm/model_executor/models/molmo.py
LanguageModelMLP ¶
Bases: Module
Molmo's LLM mlp.
Source code in vllm/model_executor/models/molmo.py
MolmoAttention ¶
Bases: Module
Molmo's LLM attention.
Source code in vllm/model_executor/models/molmo.py
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 | |
MolmoForCausalLM ¶
Bases: Module, SupportsMultiModal, SupportsPP, SupportsLoRA, SupportsQuant
Source code in vllm/model_executor/models/molmo.py
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 | |
get_mm_mapping ¶
Get the module prefix in multimodal models
Source code in vllm/model_executor/models/molmo.py
MolmoImageInputs ¶
Bases: TensorSchema
Dimensions
- bn: Batch size * number of images
- bnc: Batch size * number of images * number of crops (dynamic)
- np: Number of patches
- tp: Token sequence positions
- pd: Patch dimension
Source code in vllm/model_executor/models/molmo.py
image_input_idx instance-attribute ¶
image_input_idx: Annotated[Tensor, TensorShape(bnc, tp)]
An index tensor that maps image features to their corresponding patch tokens.
MolmoVisionBackbone ¶
Bases: Module, SupportsQuant
Source code in vllm/model_executor/models/molmo.py
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 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 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | |
encode_image ¶
: param images: (batch_size, num_crops, num_patch, n_pixels)
Source code in vllm/model_executor/models/molmo.py
MultiHeadDotProductAttention ¶
Bases: Module
Multi-head attention used in Vision Transformer.
Source code in vllm/model_executor/models/molmo.py
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 | |
ResidualAttentionBlock ¶
Bases: Module
Residual attention block used in Vision Transformer.
Source code in vllm/model_executor/models/molmo.py
ViTMLP ¶
Bases: Module
MLP used in Vision Transformer.
Source code in vllm/model_executor/models/molmo.py
VisionTransformer ¶
Bases: Module
Vision Transformer used in Vision Backbone.
Source code in vllm/model_executor/models/molmo.py
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 | |
forward ¶
: param x: (batch_size, num_patch, n_pixels)