vllm-cpu-avx512vnni 0.10.2.post2__cp312-cp312-manylinux_2_17_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of vllm-cpu-avx512vnni might be problematic. Click here for more details.

Files changed (1395) hide show
  1. vllm/_C.abi3.so +0 -0
  2. vllm/__init__.py +220 -0
  3. vllm/_bc_linter.py +59 -0
  4. vllm/_custom_ops.py +2022 -0
  5. vllm/_ipex_ops.py +404 -0
  6. vllm/_version.py +34 -0
  7. vllm/adapter_commons/__init__.py +0 -0
  8. vllm/adapter_commons/layers.py +16 -0
  9. vllm/adapter_commons/models.py +106 -0
  10. vllm/adapter_commons/request.py +26 -0
  11. vllm/adapter_commons/utils.py +93 -0
  12. vllm/adapter_commons/worker_manager.py +39 -0
  13. vllm/assets/__init__.py +0 -0
  14. vllm/assets/audio.py +45 -0
  15. vllm/assets/base.py +41 -0
  16. vllm/assets/image.py +50 -0
  17. vllm/assets/video.py +138 -0
  18. vllm/attention/__init__.py +19 -0
  19. vllm/attention/backends/__init__.py +0 -0
  20. vllm/attention/backends/abstract.py +348 -0
  21. vllm/attention/backends/differential_flash_attn.py +935 -0
  22. vllm/attention/backends/dual_chunk_flash_attn.py +1499 -0
  23. vllm/attention/backends/flash_attn.py +933 -0
  24. vllm/attention/backends/flashmla.py +238 -0
  25. vllm/attention/backends/mla/__init__.py +0 -0
  26. vllm/attention/backends/mla/common.py +1310 -0
  27. vllm/attention/backends/placeholder_attn.py +340 -0
  28. vllm/attention/backends/rocm_aiter_mla.py +410 -0
  29. vllm/attention/backends/rocm_flash_attn.py +953 -0
  30. vllm/attention/backends/triton_mla.py +111 -0
  31. vllm/attention/backends/utils.py +610 -0
  32. vllm/attention/backends/xformers.py +805 -0
  33. vllm/attention/layer.py +552 -0
  34. vllm/attention/layers/__init__.py +0 -0
  35. vllm/attention/layers/chunked_local_attention.py +91 -0
  36. vllm/attention/layers/cross_attention.py +159 -0
  37. vllm/attention/layers/encoder_only_attention.py +86 -0
  38. vllm/attention/ops/__init__.py +0 -0
  39. vllm/attention/ops/chunked_prefill_paged_decode.py +405 -0
  40. vllm/attention/ops/common.py +139 -0
  41. vllm/attention/ops/flashmla.py +123 -0
  42. vllm/attention/ops/merge_attn_states.py +43 -0
  43. vllm/attention/ops/paged_attn.py +261 -0
  44. vllm/attention/ops/pallas_kv_cache_update.py +124 -0
  45. vllm/attention/ops/prefix_prefill.py +928 -0
  46. vllm/attention/ops/rocm_aiter_mla.py +104 -0
  47. vllm/attention/ops/rocm_aiter_paged_attn.py +102 -0
  48. vllm/attention/ops/triton_decode_attention.py +676 -0
  49. vllm/attention/ops/triton_flash_attention.py +984 -0
  50. vllm/attention/ops/triton_merge_attn_states.py +97 -0
  51. vllm/attention/ops/triton_unified_attention.py +854 -0
  52. vllm/attention/selector.py +243 -0
  53. vllm/attention/utils/__init__.py +0 -0
  54. vllm/attention/utils/fa_utils.py +85 -0
  55. vllm/attention/utils/kv_sharing_utils.py +33 -0
  56. vllm/beam_search.py +87 -0
  57. vllm/benchmarks/__init__.py +0 -0
  58. vllm/benchmarks/datasets.py +2651 -0
  59. vllm/benchmarks/latency.py +170 -0
  60. vllm/benchmarks/lib/__init__.py +3 -0
  61. vllm/benchmarks/lib/endpoint_request_func.py +510 -0
  62. vllm/benchmarks/lib/ready_checker.py +72 -0
  63. vllm/benchmarks/lib/utils.py +80 -0
  64. vllm/benchmarks/serve.py +1247 -0
  65. vllm/benchmarks/throughput.py +696 -0
  66. vllm/collect_env.py +823 -0
  67. vllm/compilation/__init__.py +0 -0
  68. vllm/compilation/activation_quant_fusion.py +193 -0
  69. vllm/compilation/backends.py +641 -0
  70. vllm/compilation/base_static_graph.py +51 -0
  71. vllm/compilation/collective_fusion.py +1190 -0
  72. vllm/compilation/compiler_interface.py +572 -0
  73. vllm/compilation/counter.py +47 -0
  74. vllm/compilation/cuda_graph.py +193 -0
  75. vllm/compilation/cuda_piecewise_backend.py +117 -0
  76. vllm/compilation/decorators.py +316 -0
  77. vllm/compilation/fix_functionalization.py +208 -0
  78. vllm/compilation/fusion.py +600 -0
  79. vllm/compilation/fusion_attn.py +303 -0
  80. vllm/compilation/fx_utils.py +84 -0
  81. vllm/compilation/inductor_pass.py +136 -0
  82. vllm/compilation/monitor.py +57 -0
  83. vllm/compilation/multi_output_match.py +109 -0
  84. vllm/compilation/noop_elimination.py +165 -0
  85. vllm/compilation/pass_manager.py +88 -0
  86. vllm/compilation/sequence_parallelism.py +484 -0
  87. vllm/compilation/torch25_custom_graph_pass.py +42 -0
  88. vllm/compilation/vllm_inductor_pass.py +50 -0
  89. vllm/compilation/wrapper.py +138 -0
  90. vllm/config/__init__.py +3921 -0
  91. vllm/config/cache.py +214 -0
  92. vllm/config/compilation.py +580 -0
  93. vllm/config/kv_events.py +50 -0
  94. vllm/config/kv_transfer.py +111 -0
  95. vllm/config/load.py +113 -0
  96. vllm/config/lora.py +132 -0
  97. vllm/config/parallel.py +446 -0
  98. vllm/config/scheduler.py +304 -0
  99. vllm/config/utils.py +29 -0
  100. vllm/connections.py +174 -0
  101. vllm/core/__init__.py +0 -0
  102. vllm/core/block/__init__.py +0 -0
  103. vllm/core/block/block_table.py +399 -0
  104. vllm/core/block/common.py +371 -0
  105. vllm/core/block/cpu_gpu_block_allocator.py +439 -0
  106. vllm/core/block/interfaces.py +319 -0
  107. vllm/core/block/naive_block.py +466 -0
  108. vllm/core/block/prefix_caching_block.py +1135 -0
  109. vllm/core/block/utils.py +28 -0
  110. vllm/core/block_manager.py +523 -0
  111. vllm/core/evictor.py +157 -0
  112. vllm/core/interfaces.py +139 -0
  113. vllm/core/placeholder_block_space_manager.py +103 -0
  114. vllm/core/scheduler.py +2028 -0
  115. vllm/device_allocator/__init__.py +0 -0
  116. vllm/device_allocator/cumem.py +286 -0
  117. vllm/distributed/__init__.py +6 -0
  118. vllm/distributed/communication_op.py +41 -0
  119. vllm/distributed/device_communicators/__init__.py +0 -0
  120. vllm/distributed/device_communicators/all2all.py +259 -0
  121. vllm/distributed/device_communicators/all_reduce_utils.py +292 -0
  122. vllm/distributed/device_communicators/base_device_communicator.py +277 -0
  123. vllm/distributed/device_communicators/cpu_communicator.py +201 -0
  124. vllm/distributed/device_communicators/cuda_communicator.py +294 -0
  125. vllm/distributed/device_communicators/cuda_wrapper.py +180 -0
  126. vllm/distributed/device_communicators/custom_all_reduce.py +311 -0
  127. vllm/distributed/device_communicators/pynccl.py +290 -0
  128. vllm/distributed/device_communicators/pynccl_wrapper.py +382 -0
  129. vllm/distributed/device_communicators/quick_all_reduce.py +278 -0
  130. vllm/distributed/device_communicators/ray_communicator.py +258 -0
  131. vllm/distributed/device_communicators/shm_broadcast.py +585 -0
  132. vllm/distributed/device_communicators/symm_mem.py +136 -0
  133. vllm/distributed/device_communicators/tpu_communicator.py +102 -0
  134. vllm/distributed/device_communicators/xpu_communicator.py +69 -0
  135. vllm/distributed/eplb/__init__.py +8 -0
  136. vllm/distributed/eplb/eplb_state.py +619 -0
  137. vllm/distributed/eplb/rebalance_algo.py +234 -0
  138. vllm/distributed/eplb/rebalance_execute.py +424 -0
  139. vllm/distributed/kv_events.py +362 -0
  140. vllm/distributed/kv_transfer/README.md +29 -0
  141. vllm/distributed/kv_transfer/__init__.py +13 -0
  142. vllm/distributed/kv_transfer/disagg_prefill_workflow.jpg +0 -0
  143. vllm/distributed/kv_transfer/kv_connector/__init__.py +0 -0
  144. vllm/distributed/kv_transfer/kv_connector/base.py +10 -0
  145. vllm/distributed/kv_transfer/kv_connector/factory.py +108 -0
  146. vllm/distributed/kv_transfer/kv_connector/utils.py +246 -0
  147. vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +6 -0
  148. vllm/distributed/kv_transfer/kv_connector/v1/base.py +356 -0
  149. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +167 -0
  150. vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +266 -0
  151. vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +1319 -0
  152. vllm/distributed/kv_transfer/kv_connector/v1/p2p/__init__.py +0 -0
  153. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_connector.py +484 -0
  154. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py +542 -0
  155. vllm/distributed/kv_transfer/kv_connector/v1/p2p/tensor_memory_pool.py +266 -0
  156. vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py +414 -0
  157. vllm/distributed/kv_transfer/kv_lookup_buffer/__init__.py +0 -0
  158. vllm/distributed/kv_transfer/kv_lookup_buffer/base.py +175 -0
  159. vllm/distributed/kv_transfer/kv_lookup_buffer/mooncake_store.py +161 -0
  160. vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py +237 -0
  161. vllm/distributed/kv_transfer/kv_pipe/__init__.py +0 -0
  162. vllm/distributed/kv_transfer/kv_pipe/base.py +67 -0
  163. vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py +290 -0
  164. vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +280 -0
  165. vllm/distributed/kv_transfer/kv_transfer_state.py +73 -0
  166. vllm/distributed/parallel_state.py +1489 -0
  167. vllm/distributed/tpu_distributed_utils.py +178 -0
  168. vllm/distributed/utils.py +536 -0
  169. vllm/engine/__init__.py +0 -0
  170. vllm/engine/arg_utils.py +1857 -0
  171. vllm/engine/async_llm_engine.py +1044 -0
  172. vllm/engine/async_timeout.py +173 -0
  173. vllm/engine/llm_engine.py +1849 -0
  174. vllm/engine/metrics.py +577 -0
  175. vllm/engine/metrics_types.py +84 -0
  176. vllm/engine/multiprocessing/__init__.py +145 -0
  177. vllm/engine/multiprocessing/client.py +643 -0
  178. vllm/engine/multiprocessing/engine.py +470 -0
  179. vllm/engine/output_processor/__init__.py +0 -0
  180. vllm/engine/output_processor/interfaces.py +61 -0
  181. vllm/engine/output_processor/single_step.py +145 -0
  182. vllm/engine/output_processor/stop_checker.py +131 -0
  183. vllm/engine/output_processor/util.py +28 -0
  184. vllm/engine/protocol.py +343 -0
  185. vllm/entrypoints/__init__.py +0 -0
  186. vllm/entrypoints/api_server.py +178 -0
  187. vllm/entrypoints/chat_utils.py +1535 -0
  188. vllm/entrypoints/cli/__init__.py +12 -0
  189. vllm/entrypoints/cli/benchmark/__init__.py +0 -0
  190. vllm/entrypoints/cli/benchmark/base.py +25 -0
  191. vllm/entrypoints/cli/benchmark/latency.py +21 -0
  192. vllm/entrypoints/cli/benchmark/main.py +58 -0
  193. vllm/entrypoints/cli/benchmark/serve.py +21 -0
  194. vllm/entrypoints/cli/benchmark/throughput.py +21 -0
  195. vllm/entrypoints/cli/collect_env.py +36 -0
  196. vllm/entrypoints/cli/main.py +60 -0
  197. vllm/entrypoints/cli/openai.py +214 -0
  198. vllm/entrypoints/cli/run_batch.py +69 -0
  199. vllm/entrypoints/cli/serve.py +232 -0
  200. vllm/entrypoints/cli/types.py +29 -0
  201. vllm/entrypoints/constants.py +10 -0
  202. vllm/entrypoints/context.py +444 -0
  203. vllm/entrypoints/harmony_utils.py +431 -0
  204. vllm/entrypoints/launcher.py +168 -0
  205. vllm/entrypoints/llm.py +1579 -0
  206. vllm/entrypoints/logger.py +79 -0
  207. vllm/entrypoints/openai/__init__.py +0 -0
  208. vllm/entrypoints/openai/api_server.py +2011 -0
  209. vllm/entrypoints/openai/cli_args.py +281 -0
  210. vllm/entrypoints/openai/logits_processors.py +90 -0
  211. vllm/entrypoints/openai/protocol.py +2590 -0
  212. vllm/entrypoints/openai/run_batch.py +497 -0
  213. vllm/entrypoints/openai/serving_chat.py +1591 -0
  214. vllm/entrypoints/openai/serving_classification.py +176 -0
  215. vllm/entrypoints/openai/serving_completion.py +688 -0
  216. vllm/entrypoints/openai/serving_embedding.py +632 -0
  217. vllm/entrypoints/openai/serving_engine.py +996 -0
  218. vllm/entrypoints/openai/serving_models.py +288 -0
  219. vllm/entrypoints/openai/serving_pooling.py +277 -0
  220. vllm/entrypoints/openai/serving_responses.py +1690 -0
  221. vllm/entrypoints/openai/serving_score.py +479 -0
  222. vllm/entrypoints/openai/serving_tokenization.py +196 -0
  223. vllm/entrypoints/openai/serving_transcription.py +136 -0
  224. vllm/entrypoints/openai/speech_to_text.py +388 -0
  225. vllm/entrypoints/openai/tool_parsers/__init__.py +51 -0
  226. vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +164 -0
  227. vllm/entrypoints/openai/tool_parsers/deepseekv31_tool_parser.py +367 -0
  228. vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py +370 -0
  229. vllm/entrypoints/openai/tool_parsers/glm4_moe_tool_parser.py +185 -0
  230. vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py +259 -0
  231. vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py +237 -0
  232. vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py +418 -0
  233. vllm/entrypoints/openai/tool_parsers/hunyuan_a13b_tool_parser.py +372 -0
  234. vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py +216 -0
  235. vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py +308 -0
  236. vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py +377 -0
  237. vllm/entrypoints/openai/tool_parsers/llama4_pythonic_tool_parser.py +316 -0
  238. vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +269 -0
  239. vllm/entrypoints/openai/tool_parsers/minimax_tool_parser.py +816 -0
  240. vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +369 -0
  241. vllm/entrypoints/openai/tool_parsers/openai_tool_parser.py +73 -0
  242. vllm/entrypoints/openai/tool_parsers/phi4mini_tool_parser.py +112 -0
  243. vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py +308 -0
  244. vllm/entrypoints/openai/tool_parsers/qwen3coder_tool_parser.py +707 -0
  245. vllm/entrypoints/openai/tool_parsers/seed_oss_tool_parser.py +679 -0
  246. vllm/entrypoints/openai/tool_parsers/step3_tool_parser.py +296 -0
  247. vllm/entrypoints/openai/tool_parsers/utils.py +124 -0
  248. vllm/entrypoints/openai/tool_parsers/xlam_tool_parser.py +524 -0
  249. vllm/entrypoints/renderer.py +395 -0
  250. vllm/entrypoints/score_utils.py +232 -0
  251. vllm/entrypoints/ssl.py +75 -0
  252. vllm/entrypoints/tool.py +139 -0
  253. vllm/entrypoints/tool_server.py +195 -0
  254. vllm/entrypoints/utils.py +328 -0
  255. vllm/env_override.py +23 -0
  256. vllm/envs.py +1354 -0
  257. vllm/executor/__init__.py +0 -0
  258. vllm/executor/executor_base.py +378 -0
  259. vllm/executor/mp_distributed_executor.py +244 -0
  260. vllm/executor/msgspec_utils.py +35 -0
  261. vllm/executor/multiproc_worker_utils.py +279 -0
  262. vllm/executor/ray_distributed_executor.py +699 -0
  263. vllm/executor/ray_utils.py +410 -0
  264. vllm/executor/uniproc_executor.py +152 -0
  265. vllm/forward_context.py +273 -0
  266. vllm/inputs/__init__.py +44 -0
  267. vllm/inputs/data.py +356 -0
  268. vllm/inputs/parse.py +151 -0
  269. vllm/inputs/preprocess.py +973 -0
  270. vllm/inputs/registry.py +251 -0
  271. vllm/logger.py +229 -0
  272. vllm/logging_utils/__init__.py +8 -0
  273. vllm/logging_utils/dump_input.py +81 -0
  274. vllm/logging_utils/formatter.py +79 -0
  275. vllm/logits_process.py +119 -0
  276. vllm/logprobs.py +28 -0
  277. vllm/lora/__init__.py +0 -0
  278. vllm/lora/layers/__init__.py +34 -0
  279. vllm/lora/layers/base.py +69 -0
  280. vllm/lora/layers/base_linear.py +184 -0
  281. vllm/lora/layers/column_parallel_linear.py +622 -0
  282. vllm/lora/layers/logits_processor.py +247 -0
  283. vllm/lora/layers/qkv_x_parallel_linear.py +8 -0
  284. vllm/lora/layers/replicated_linear.py +61 -0
  285. vllm/lora/layers/row_parallel_linear.py +201 -0
  286. vllm/lora/layers/utils.py +60 -0
  287. vllm/lora/layers/vocal_parallel_embedding.py +172 -0
  288. vllm/lora/lora.py +199 -0
  289. vllm/lora/models.py +792 -0
  290. vllm/lora/ops/__init__.py +0 -0
  291. vllm/lora/ops/ipex_ops/__init__.py +7 -0
  292. vllm/lora/ops/ipex_ops/lora_ops.py +44 -0
  293. vllm/lora/ops/torch_ops/__init__.py +16 -0
  294. vllm/lora/ops/torch_ops/lora_ops.py +119 -0
  295. vllm/lora/ops/triton_ops/__init__.py +12 -0
  296. vllm/lora/ops/triton_ops/kernel_utils.py +243 -0
  297. vllm/lora/ops/triton_ops/lora_expand_op.py +291 -0
  298. vllm/lora/ops/triton_ops/lora_kernel_metadata.py +148 -0
  299. vllm/lora/ops/triton_ops/lora_shrink_op.py +245 -0
  300. vllm/lora/ops/triton_ops/utils.py +126 -0
  301. vllm/lora/ops/xla_ops/__init__.py +7 -0
  302. vllm/lora/ops/xla_ops/lora_ops.py +145 -0
  303. vllm/lora/peft_helper.py +127 -0
  304. vllm/lora/punica_wrapper/__init__.py +10 -0
  305. vllm/lora/punica_wrapper/punica_base.py +458 -0
  306. vllm/lora/punica_wrapper/punica_cpu.py +349 -0
  307. vllm/lora/punica_wrapper/punica_gpu.py +279 -0
  308. vllm/lora/punica_wrapper/punica_selector.py +20 -0
  309. vllm/lora/punica_wrapper/punica_tpu.py +391 -0
  310. vllm/lora/punica_wrapper/punica_xpu.py +276 -0
  311. vllm/lora/punica_wrapper/utils.py +136 -0
  312. vllm/lora/request.py +99 -0
  313. vllm/lora/resolver.py +85 -0
  314. vllm/lora/utils.py +246 -0
  315. vllm/lora/worker_manager.py +256 -0
  316. vllm/model_executor/__init__.py +16 -0
  317. vllm/model_executor/custom_op.py +194 -0
  318. vllm/model_executor/layers/__init__.py +0 -0
  319. vllm/model_executor/layers/activation.py +575 -0
  320. vllm/model_executor/layers/attention_layer_base.py +23 -0
  321. vllm/model_executor/layers/fla/__init__.py +8 -0
  322. vllm/model_executor/layers/fla/ops/__init__.py +17 -0
  323. vllm/model_executor/layers/fla/ops/chunk.py +225 -0
  324. vllm/model_executor/layers/fla/ops/chunk_delta_h.py +290 -0
  325. vllm/model_executor/layers/fla/ops/chunk_o.py +177 -0
  326. vllm/model_executor/layers/fla/ops/chunk_scaled_dot_kkt.py +140 -0
  327. vllm/model_executor/layers/fla/ops/cumsum.py +226 -0
  328. vllm/model_executor/layers/fla/ops/fused_recurrent.py +366 -0
  329. vllm/model_executor/layers/fla/ops/index.py +39 -0
  330. vllm/model_executor/layers/fla/ops/l2norm.py +143 -0
  331. vllm/model_executor/layers/fla/ops/layernorm_guard.py +337 -0
  332. vllm/model_executor/layers/fla/ops/op.py +39 -0
  333. vllm/model_executor/layers/fla/ops/solve_tril.py +365 -0
  334. vllm/model_executor/layers/fla/ops/utils.py +180 -0
  335. vllm/model_executor/layers/fla/ops/wy_fast.py +114 -0
  336. vllm/model_executor/layers/fused_moe/__init__.py +80 -0
  337. vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +304 -0
  338. vllm/model_executor/layers/fused_moe/batched_triton_or_deep_gemm_moe.py +164 -0
  339. vllm/model_executor/layers/fused_moe/config.py +497 -0
  340. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  341. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  342. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  343. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  344. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  345. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +218 -0
  346. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
  347. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  348. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  349. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  350. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  351. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  352. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  353. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  354. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  355. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  356. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20.json +146 -0
  357. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
  358. vllm/model_executor/layers/fused_moe/configs/E=128,N=352,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +122 -0
  359. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  360. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  361. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  362. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  363. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  364. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e.json +146 -0
  365. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20.json +146 -0
  366. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  367. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
  368. vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  369. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +146 -0
  370. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +114 -0
  371. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  372. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  373. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  374. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  375. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  376. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
  377. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  378. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
  379. vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
  380. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  381. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
  382. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200.json +146 -0
  383. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
  384. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  385. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  386. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  387. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  388. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  389. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  390. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  391. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  392. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  393. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  394. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  395. vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  396. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  397. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  398. vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  399. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  400. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  401. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  402. vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  403. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  404. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  405. vllm/model_executor/layers/fused_moe/configs/E=160,N=320,device_name=NVIDIA_H20-3e.json +146 -0
  406. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  407. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  408. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  409. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  410. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  411. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  412. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  413. vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
  414. vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  415. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  416. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  417. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  418. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  419. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  420. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  421. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  422. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  423. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  424. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  425. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  426. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  427. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  428. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  429. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  430. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  431. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  432. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  433. vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  434. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  435. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  436. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  437. vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  438. vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  439. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  440. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  441. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  442. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200.json +146 -0
  443. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  444. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H20-3e.json +146 -0
  445. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H200.json +146 -0
  446. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200.json +146 -0
  447. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  448. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H20-3e.json +146 -0
  449. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H200.json +146 -0
  450. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200.json +146 -0
  451. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  452. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H20-3e.json +146 -0
  453. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H200.json +146 -0
  454. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_B200.json +146 -0
  455. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H20-3e.json +146 -0
  456. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H200.json +146 -0
  457. vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
  458. vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
  459. vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
  460. vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
  461. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  462. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  463. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  464. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  465. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  466. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  467. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  468. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
  469. vllm/model_executor/layers/fused_moe/configs/E=64,N=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  470. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  471. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  472. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
  473. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  474. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20.json +146 -0
  475. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  476. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  477. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  478. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
  479. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  480. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20.json +146 -0
  481. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  482. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  483. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  484. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  485. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  486. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  487. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
  488. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  489. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20.json +146 -0
  490. vllm/model_executor/layers/fused_moe/configs/E=64,N=896,device_name=NVIDIA_H20.json +146 -0
  491. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  492. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  493. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  494. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
  495. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  496. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
  497. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
  498. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  499. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
  500. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  501. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
  502. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  503. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
  504. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  505. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
  506. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  507. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
  508. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  509. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  510. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  511. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  512. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
  513. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  514. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
  515. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  516. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
  517. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  518. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  519. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  520. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +154 -0
  521. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  522. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
  523. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  524. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
  525. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  526. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
  527. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  528. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  529. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  530. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  531. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  532. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  533. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
  534. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
  535. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  536. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
  537. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  538. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
  539. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  540. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  541. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  542. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  543. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
  544. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  545. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
  546. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  547. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
  548. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  549. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  550. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  551. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  552. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
  553. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  554. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
  555. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  556. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
  557. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  558. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  559. vllm/model_executor/layers/fused_moe/configs/README +12 -0
  560. vllm/model_executor/layers/fused_moe/cpu_fused_moe.py +297 -0
  561. vllm/model_executor/layers/fused_moe/cutlass_moe.py +996 -0
  562. vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +370 -0
  563. vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +413 -0
  564. vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +280 -0
  565. vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +229 -0
  566. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_moe.py +243 -0
  567. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_prepare_finalize.py +97 -0
  568. vllm/model_executor/layers/fused_moe/fused_batched_moe.py +1042 -0
  569. vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +240 -0
  570. vllm/model_executor/layers/fused_moe/fused_moe.py +2081 -0
  571. vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py +247 -0
  572. vllm/model_executor/layers/fused_moe/layer.py +1951 -0
  573. vllm/model_executor/layers/fused_moe/modular_kernel.py +892 -0
  574. vllm/model_executor/layers/fused_moe/moe_align_block_size.py +87 -0
  575. vllm/model_executor/layers/fused_moe/moe_pallas.py +80 -0
  576. vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +205 -0
  577. vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
  578. vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +321 -0
  579. vllm/model_executor/layers/fused_moe/prepare_finalize.py +72 -0
  580. vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +431 -0
  581. vllm/model_executor/layers/fused_moe/routing_simulator.py +291 -0
  582. vllm/model_executor/layers/fused_moe/topk_weight_and_reduce.py +146 -0
  583. vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +171 -0
  584. vllm/model_executor/layers/fused_moe/trtllm_moe.py +197 -0
  585. vllm/model_executor/layers/fused_moe/utils.py +270 -0
  586. vllm/model_executor/layers/layernorm.py +381 -0
  587. vllm/model_executor/layers/lightning_attn.py +661 -0
  588. vllm/model_executor/layers/linear.py +1567 -0
  589. vllm/model_executor/layers/logits_processor.py +199 -0
  590. vllm/model_executor/layers/mamba/__init__.py +0 -0
  591. vllm/model_executor/layers/mamba/abstract.py +45 -0
  592. vllm/model_executor/layers/mamba/linear_attn.py +432 -0
  593. vllm/model_executor/layers/mamba/mamba2_metadata.py +186 -0
  594. vllm/model_executor/layers/mamba/mamba_mixer.py +517 -0
  595. vllm/model_executor/layers/mamba/mamba_mixer2.py +803 -0
  596. vllm/model_executor/layers/mamba/mamba_utils.py +202 -0
  597. vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
  598. vllm/model_executor/layers/mamba/ops/causal_conv1d.py +982 -0
  599. vllm/model_executor/layers/mamba/ops/layernorm_gated.py +168 -0
  600. vllm/model_executor/layers/mamba/ops/mamba_ssm.py +414 -0
  601. vllm/model_executor/layers/mamba/ops/ssd_bmm.py +262 -0
  602. vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +574 -0
  603. vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +751 -0
  604. vllm/model_executor/layers/mamba/ops/ssd_combined.py +248 -0
  605. vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +248 -0
  606. vllm/model_executor/layers/mamba/short_conv.py +270 -0
  607. vllm/model_executor/layers/mla.py +158 -0
  608. vllm/model_executor/layers/pooler.py +732 -0
  609. vllm/model_executor/layers/quantization/__init__.py +157 -0
  610. vllm/model_executor/layers/quantization/auto_round.py +388 -0
  611. vllm/model_executor/layers/quantization/awq.py +228 -0
  612. vllm/model_executor/layers/quantization/awq_marlin.py +548 -0
  613. vllm/model_executor/layers/quantization/awq_triton.py +320 -0
  614. vllm/model_executor/layers/quantization/base_config.py +164 -0
  615. vllm/model_executor/layers/quantization/bitblas.py +464 -0
  616. vllm/model_executor/layers/quantization/bitsandbytes.py +621 -0
  617. vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +0 -0
  618. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +795 -0
  619. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +1651 -0
  620. vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +27 -0
  621. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +366 -0
  622. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +55 -0
  623. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +160 -0
  624. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_nvfp4.py +105 -0
  625. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +161 -0
  626. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_fp8.py +169 -0
  627. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_int.py +135 -0
  628. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +121 -0
  629. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +156 -0
  630. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +111 -0
  631. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +201 -0
  632. vllm/model_executor/layers/quantization/compressed_tensors/transform/linear.py +227 -0
  633. vllm/model_executor/layers/quantization/compressed_tensors/transform/module.py +135 -0
  634. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/linear_qutlass_nvfp4.py +21 -0
  635. vllm/model_executor/layers/quantization/compressed_tensors/transform/utils.py +13 -0
  636. vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +206 -0
  637. vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
  638. vllm/model_executor/layers/quantization/deepgemm.py +81 -0
  639. vllm/model_executor/layers/quantization/deepspeedfp.py +196 -0
  640. vllm/model_executor/layers/quantization/experts_int8.py +215 -0
  641. vllm/model_executor/layers/quantization/fbgemm_fp8.py +172 -0
  642. vllm/model_executor/layers/quantization/fp8.py +1179 -0
  643. vllm/model_executor/layers/quantization/gguf.py +597 -0
  644. vllm/model_executor/layers/quantization/gptq.py +300 -0
  645. vllm/model_executor/layers/quantization/gptq_bitblas.py +448 -0
  646. vllm/model_executor/layers/quantization/gptq_marlin.py +700 -0
  647. vllm/model_executor/layers/quantization/gptq_marlin_24.py +297 -0
  648. vllm/model_executor/layers/quantization/hqq_marlin.py +333 -0
  649. vllm/model_executor/layers/quantization/inc.py +61 -0
  650. vllm/model_executor/layers/quantization/input_quant_fp8.py +103 -0
  651. vllm/model_executor/layers/quantization/ipex_quant.py +410 -0
  652. vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
  653. vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +91 -0
  654. vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +93 -0
  655. vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +116 -0
  656. vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +302 -0
  657. vllm/model_executor/layers/quantization/kernels/mixed_precision/conch.py +92 -0
  658. vllm/model_executor/layers/quantization/kernels/mixed_precision/cutlass.py +117 -0
  659. vllm/model_executor/layers/quantization/kernels/mixed_precision/dynamic_4bit.py +92 -0
  660. vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +143 -0
  661. vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +144 -0
  662. vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +139 -0
  663. vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +67 -0
  664. vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +89 -0
  665. vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +163 -0
  666. vllm/model_executor/layers/quantization/kernels/scaled_mm/cpu.py +206 -0
  667. vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +137 -0
  668. vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +41 -0
  669. vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +104 -0
  670. vllm/model_executor/layers/quantization/kv_cache.py +139 -0
  671. vllm/model_executor/layers/quantization/modelopt.py +1548 -0
  672. vllm/model_executor/layers/quantization/moe_wna16.py +473 -0
  673. vllm/model_executor/layers/quantization/mxfp4.py +951 -0
  674. vllm/model_executor/layers/quantization/petit.py +306 -0
  675. vllm/model_executor/layers/quantization/ptpc_fp8.py +129 -0
  676. vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
  677. vllm/model_executor/layers/quantization/quark/quark.py +431 -0
  678. vllm/model_executor/layers/quantization/quark/quark_moe.py +434 -0
  679. vllm/model_executor/layers/quantization/quark/schemes/__init__.py +9 -0
  680. vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +55 -0
  681. vllm/model_executor/layers/quantization/quark/schemes/quark_w4a4_mxfp4.py +112 -0
  682. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +163 -0
  683. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +122 -0
  684. vllm/model_executor/layers/quantization/quark/utils.py +105 -0
  685. vllm/model_executor/layers/quantization/rtn.py +456 -0
  686. vllm/model_executor/layers/quantization/schema.py +86 -0
  687. vllm/model_executor/layers/quantization/torchao.py +214 -0
  688. vllm/model_executor/layers/quantization/tpu_int8.py +125 -0
  689. vllm/model_executor/layers/quantization/utils/__init__.py +6 -0
  690. vllm/model_executor/layers/quantization/utils/allspark_utils.py +52 -0
  691. vllm/model_executor/layers/quantization/utils/bitblas_utils.py +210 -0
  692. vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  693. vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  694. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  695. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  696. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  697. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  698. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  699. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  700. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  701. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  702. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  703. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  704. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  705. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  706. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  707. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  708. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  709. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  710. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  711. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  712. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  713. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  714. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  715. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  716. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  717. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  718. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  719. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  720. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  721. vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  722. vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  723. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  724. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  725. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  726. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  727. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  728. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  729. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  730. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  731. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  732. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  733. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  734. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  735. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  736. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  737. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  738. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  739. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  740. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  741. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  742. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  743. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  744. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  745. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  746. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  747. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  748. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  749. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  750. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  751. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  752. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  753. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  754. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  755. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  756. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  757. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  758. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  759. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  760. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  761. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  762. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  763. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  764. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  765. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  766. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  767. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  768. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  769. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  770. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  771. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  772. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  773. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  774. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  775. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  776. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  777. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  778. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  779. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  780. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  781. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  782. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  783. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  784. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  785. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  786. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  787. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  788. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  789. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  790. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  791. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  792. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  793. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  794. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  795. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  796. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  797. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  798. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  799. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  800. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  801. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  802. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  803. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  804. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  805. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  806. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  807. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  808. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  809. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  810. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  811. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  812. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  813. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  814. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  815. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  816. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  817. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  818. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  819. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  820. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  821. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +18 -0
  822. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  823. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  824. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  825. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  826. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  827. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  828. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  829. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  830. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  831. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  832. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  833. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  834. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  835. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  836. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  837. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  838. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  839. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  840. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  841. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  842. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  843. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  844. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  845. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  846. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  847. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  848. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  849. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  850. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  851. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  852. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  853. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  854. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  855. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  856. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  857. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  858. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  859. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  860. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  861. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  862. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  863. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  864. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  865. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  866. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  867. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  868. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  869. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  870. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  871. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  872. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  873. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  874. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  875. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  876. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  877. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  878. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  879. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  880. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  881. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  882. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  883. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  884. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  885. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  886. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  887. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  888. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  889. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  890. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  891. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  892. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  893. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  894. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  895. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  896. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  897. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  898. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  899. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  900. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  901. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  902. vllm/model_executor/layers/quantization/utils/configs/README.md +3 -0
  903. vllm/model_executor/layers/quantization/utils/flashinfer_fp4_moe.py +85 -0
  904. vllm/model_executor/layers/quantization/utils/flashinfer_utils.py +258 -0
  905. vllm/model_executor/layers/quantization/utils/fp8_utils.py +795 -0
  906. vllm/model_executor/layers/quantization/utils/gptq_utils.py +96 -0
  907. vllm/model_executor/layers/quantization/utils/int8_utils.py +492 -0
  908. vllm/model_executor/layers/quantization/utils/layer_utils.py +40 -0
  909. vllm/model_executor/layers/quantization/utils/machete_utils.py +50 -0
  910. vllm/model_executor/layers/quantization/utils/marlin_utils.py +479 -0
  911. vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +396 -0
  912. vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +345 -0
  913. vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +165 -0
  914. vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +464 -0
  915. vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +132 -0
  916. vllm/model_executor/layers/quantization/utils/mxfp8_utils.py +20 -0
  917. vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +137 -0
  918. vllm/model_executor/layers/quantization/utils/nvfp4_moe_support.py +59 -0
  919. vllm/model_executor/layers/quantization/utils/petit_utils.py +122 -0
  920. vllm/model_executor/layers/quantization/utils/quant_utils.py +627 -0
  921. vllm/model_executor/layers/quantization/utils/w8a8_utils.py +458 -0
  922. vllm/model_executor/layers/resampler.py +270 -0
  923. vllm/model_executor/layers/rotary_embedding/__init__.py +190 -0
  924. vllm/model_executor/layers/rotary_embedding/base.py +156 -0
  925. vllm/model_executor/layers/rotary_embedding/common.py +105 -0
  926. vllm/model_executor/layers/rotary_embedding/deepseek_scaling_rope.py +140 -0
  927. vllm/model_executor/layers/rotary_embedding/dual_chunk_rope.py +197 -0
  928. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_alpha_rope.py +41 -0
  929. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_scaling_rope.py +67 -0
  930. vllm/model_executor/layers/rotary_embedding/ernie45_vl_rope.py +80 -0
  931. vllm/model_executor/layers/rotary_embedding/linear_scaling_rope.py +115 -0
  932. vllm/model_executor/layers/rotary_embedding/llama3_rope.py +54 -0
  933. vllm/model_executor/layers/rotary_embedding/llama4_vision_rope.py +81 -0
  934. vllm/model_executor/layers/rotary_embedding/mrope.py +1140 -0
  935. vllm/model_executor/layers/rotary_embedding/ntk_scaling_rope.py +42 -0
  936. vllm/model_executor/layers/rotary_embedding/phi3_long_rope_scaled_rope.py +129 -0
  937. vllm/model_executor/layers/rotary_embedding/yarn_scaling_rope.py +68 -0
  938. vllm/model_executor/layers/sampler.py +1198 -0
  939. vllm/model_executor/layers/shared_fused_moe/__init__.py +6 -0
  940. vllm/model_executor/layers/shared_fused_moe/shared_fused_moe.py +56 -0
  941. vllm/model_executor/layers/utils.py +196 -0
  942. vllm/model_executor/layers/vocab_parallel_embedding.py +487 -0
  943. vllm/model_executor/model_loader/__init__.py +138 -0
  944. vllm/model_executor/model_loader/base_loader.py +52 -0
  945. vllm/model_executor/model_loader/bitsandbytes_loader.py +787 -0
  946. vllm/model_executor/model_loader/default_loader.py +278 -0
  947. vllm/model_executor/model_loader/dummy_loader.py +28 -0
  948. vllm/model_executor/model_loader/gguf_loader.py +155 -0
  949. vllm/model_executor/model_loader/runai_streamer_loader.py +104 -0
  950. vllm/model_executor/model_loader/sharded_state_loader.py +199 -0
  951. vllm/model_executor/model_loader/tensorizer.py +743 -0
  952. vllm/model_executor/model_loader/tensorizer_loader.py +143 -0
  953. vllm/model_executor/model_loader/tpu.py +114 -0
  954. vllm/model_executor/model_loader/utils.py +271 -0
  955. vllm/model_executor/model_loader/weight_utils.py +946 -0
  956. vllm/model_executor/models/__init__.py +30 -0
  957. vllm/model_executor/models/adapters.py +542 -0
  958. vllm/model_executor/models/aimv2.py +246 -0
  959. vllm/model_executor/models/apertus.py +582 -0
  960. vllm/model_executor/models/arcee.py +423 -0
  961. vllm/model_executor/models/arctic.py +560 -0
  962. vllm/model_executor/models/aria.py +662 -0
  963. vllm/model_executor/models/aya_vision.py +470 -0
  964. vllm/model_executor/models/baichuan.py +475 -0
  965. vllm/model_executor/models/bailing_moe.py +529 -0
  966. vllm/model_executor/models/bamba.py +582 -0
  967. vllm/model_executor/models/bart.py +1343 -0
  968. vllm/model_executor/models/bert.py +613 -0
  969. vllm/model_executor/models/bert_with_rope.py +687 -0
  970. vllm/model_executor/models/blip.py +339 -0
  971. vllm/model_executor/models/blip2.py +716 -0
  972. vllm/model_executor/models/bloom.py +374 -0
  973. vllm/model_executor/models/chameleon.py +1141 -0
  974. vllm/model_executor/models/chatglm.py +479 -0
  975. vllm/model_executor/models/clip.py +407 -0
  976. vllm/model_executor/models/cohere2_vision.py +484 -0
  977. vllm/model_executor/models/commandr.py +467 -0
  978. vllm/model_executor/models/config.py +434 -0
  979. vllm/model_executor/models/constant_size_cache.py +137 -0
  980. vllm/model_executor/models/dbrx.py +473 -0
  981. vllm/model_executor/models/deepseek.py +491 -0
  982. vllm/model_executor/models/deepseek_eagle.py +241 -0
  983. vllm/model_executor/models/deepseek_mtp.py +282 -0
  984. vllm/model_executor/models/deepseek_v2.py +1058 -0
  985. vllm/model_executor/models/deepseek_vl2.py +661 -0
  986. vllm/model_executor/models/donut.py +387 -0
  987. vllm/model_executor/models/dots1.py +547 -0
  988. vllm/model_executor/models/ernie45.py +43 -0
  989. vllm/model_executor/models/ernie45_moe.py +608 -0
  990. vllm/model_executor/models/ernie45_vl.py +1510 -0
  991. vllm/model_executor/models/ernie45_vl_moe.py +728 -0
  992. vllm/model_executor/models/ernie_mtp.py +287 -0
  993. vllm/model_executor/models/exaone.py +552 -0
  994. vllm/model_executor/models/exaone4.py +535 -0
  995. vllm/model_executor/models/fairseq2_llama.py +154 -0
  996. vllm/model_executor/models/falcon.py +511 -0
  997. vllm/model_executor/models/falcon_h1.py +739 -0
  998. vllm/model_executor/models/florence2.py +1107 -0
  999. vllm/model_executor/models/fuyu.py +401 -0
  1000. vllm/model_executor/models/gemma.py +428 -0
  1001. vllm/model_executor/models/gemma2.py +425 -0
  1002. vllm/model_executor/models/gemma3.py +542 -0
  1003. vllm/model_executor/models/gemma3_mm.py +723 -0
  1004. vllm/model_executor/models/gemma3n.py +830 -0
  1005. vllm/model_executor/models/gemma3n_mm.py +767 -0
  1006. vllm/model_executor/models/glm.py +23 -0
  1007. vllm/model_executor/models/glm4.py +305 -0
  1008. vllm/model_executor/models/glm4_1v.py +1669 -0
  1009. vllm/model_executor/models/glm4_moe.py +703 -0
  1010. vllm/model_executor/models/glm4_moe_mtp.py +306 -0
  1011. vllm/model_executor/models/glm4v.py +654 -0
  1012. vllm/model_executor/models/gpt2.py +383 -0
  1013. vllm/model_executor/models/gpt_bigcode.py +346 -0
  1014. vllm/model_executor/models/gpt_j.py +340 -0
  1015. vllm/model_executor/models/gpt_neox.py +333 -0
  1016. vllm/model_executor/models/gpt_oss.py +687 -0
  1017. vllm/model_executor/models/granite.py +498 -0
  1018. vllm/model_executor/models/granite_speech.py +799 -0
  1019. vllm/model_executor/models/granitemoe.py +541 -0
  1020. vllm/model_executor/models/granitemoehybrid.py +684 -0
  1021. vllm/model_executor/models/granitemoeshared.py +342 -0
  1022. vllm/model_executor/models/gritlm.py +262 -0
  1023. vllm/model_executor/models/grok1.py +550 -0
  1024. vllm/model_executor/models/h2ovl.py +536 -0
  1025. vllm/model_executor/models/hunyuan_v1.py +937 -0
  1026. vllm/model_executor/models/hyperclovax_vision.py +1206 -0
  1027. vllm/model_executor/models/idefics2_vision_model.py +416 -0
  1028. vllm/model_executor/models/idefics3.py +758 -0
  1029. vllm/model_executor/models/interfaces.py +854 -0
  1030. vllm/model_executor/models/interfaces_base.py +195 -0
  1031. vllm/model_executor/models/intern_vit.py +481 -0
  1032. vllm/model_executor/models/internlm2.py +453 -0
  1033. vllm/model_executor/models/internlm2_ve.py +148 -0
  1034. vllm/model_executor/models/interns1.py +832 -0
  1035. vllm/model_executor/models/interns1_vit.py +418 -0
  1036. vllm/model_executor/models/internvl.py +1423 -0
  1037. vllm/model_executor/models/jais.py +374 -0
  1038. vllm/model_executor/models/jamba.py +630 -0
  1039. vllm/model_executor/models/jina_vl.py +144 -0
  1040. vllm/model_executor/models/keye.py +1684 -0
  1041. vllm/model_executor/models/keye_vl1_5.py +601 -0
  1042. vllm/model_executor/models/kimi_vl.py +620 -0
  1043. vllm/model_executor/models/lfm2.py +558 -0
  1044. vllm/model_executor/models/llama.py +671 -0
  1045. vllm/model_executor/models/llama4.py +732 -0
  1046. vllm/model_executor/models/llama4_eagle.py +241 -0
  1047. vllm/model_executor/models/llama_eagle.py +171 -0
  1048. vllm/model_executor/models/llama_eagle3.py +292 -0
  1049. vllm/model_executor/models/llava.py +872 -0
  1050. vllm/model_executor/models/llava_next.py +572 -0
  1051. vllm/model_executor/models/llava_next_video.py +479 -0
  1052. vllm/model_executor/models/llava_onevision.py +945 -0
  1053. vllm/model_executor/models/mamba.py +310 -0
  1054. vllm/model_executor/models/mamba2.py +346 -0
  1055. vllm/model_executor/models/mamba_cache.py +83 -0
  1056. vllm/model_executor/models/medusa.py +219 -0
  1057. vllm/model_executor/models/midashenglm.py +788 -0
  1058. vllm/model_executor/models/mimo.py +191 -0
  1059. vllm/model_executor/models/mimo_mtp.py +273 -0
  1060. vllm/model_executor/models/minicpm.py +593 -0
  1061. vllm/model_executor/models/minicpm3.py +230 -0
  1062. vllm/model_executor/models/minicpm_eagle.py +391 -0
  1063. vllm/model_executor/models/minicpmo.py +804 -0
  1064. vllm/model_executor/models/minicpmv.py +1786 -0
  1065. vllm/model_executor/models/minimax_cache.py +36 -0
  1066. vllm/model_executor/models/minimax_text_01.py +1027 -0
  1067. vllm/model_executor/models/minimax_vl_01.py +431 -0
  1068. vllm/model_executor/models/mistral3.py +628 -0
  1069. vllm/model_executor/models/mixtral.py +494 -0
  1070. vllm/model_executor/models/mllama.py +1697 -0
  1071. vllm/model_executor/models/mllama4.py +1079 -0
  1072. vllm/model_executor/models/mlp_speculator.py +206 -0
  1073. vllm/model_executor/models/modernbert.py +374 -0
  1074. vllm/model_executor/models/module_mapping.py +72 -0
  1075. vllm/model_executor/models/molmo.py +1569 -0
  1076. vllm/model_executor/models/moonvit.py +663 -0
  1077. vllm/model_executor/models/motif.py +345 -0
  1078. vllm/model_executor/models/mpt.py +332 -0
  1079. vllm/model_executor/models/nano_nemotron_vl.py +1395 -0
  1080. vllm/model_executor/models/nemotron.py +509 -0
  1081. vllm/model_executor/models/nemotron_h.py +633 -0
  1082. vllm/model_executor/models/nemotron_nas.py +484 -0
  1083. vllm/model_executor/models/nemotron_vl.py +655 -0
  1084. vllm/model_executor/models/nvlm_d.py +203 -0
  1085. vllm/model_executor/models/olmo.py +406 -0
  1086. vllm/model_executor/models/olmo2.py +428 -0
  1087. vllm/model_executor/models/olmoe.py +485 -0
  1088. vllm/model_executor/models/opt.py +413 -0
  1089. vllm/model_executor/models/orion.py +350 -0
  1090. vllm/model_executor/models/ovis.py +572 -0
  1091. vllm/model_executor/models/ovis2_5.py +644 -0
  1092. vllm/model_executor/models/paligemma.py +414 -0
  1093. vllm/model_executor/models/persimmon.py +345 -0
  1094. vllm/model_executor/models/phi.py +357 -0
  1095. vllm/model_executor/models/phi3.py +19 -0
  1096. vllm/model_executor/models/phi3v.py +701 -0
  1097. vllm/model_executor/models/phi4_multimodal.py +1478 -0
  1098. vllm/model_executor/models/phi4flash.py +737 -0
  1099. vllm/model_executor/models/phi4mm.py +1281 -0
  1100. vllm/model_executor/models/phi4mm_audio.py +1254 -0
  1101. vllm/model_executor/models/phi4mm_utils.py +1875 -0
  1102. vllm/model_executor/models/phimoe.py +681 -0
  1103. vllm/model_executor/models/pixtral.py +1348 -0
  1104. vllm/model_executor/models/plamo2.py +1126 -0
  1105. vllm/model_executor/models/qwen.py +363 -0
  1106. vllm/model_executor/models/qwen2.py +526 -0
  1107. vllm/model_executor/models/qwen2_5_omni_thinker.py +985 -0
  1108. vllm/model_executor/models/qwen2_5_vl.py +1256 -0
  1109. vllm/model_executor/models/qwen2_audio.py +492 -0
  1110. vllm/model_executor/models/qwen2_moe.py +558 -0
  1111. vllm/model_executor/models/qwen2_rm.py +122 -0
  1112. vllm/model_executor/models/qwen2_vl.py +1512 -0
  1113. vllm/model_executor/models/qwen3.py +344 -0
  1114. vllm/model_executor/models/qwen3_moe.py +704 -0
  1115. vllm/model_executor/models/qwen3_next.py +1298 -0
  1116. vllm/model_executor/models/qwen3_next_mtp.py +285 -0
  1117. vllm/model_executor/models/qwen_vl.py +795 -0
  1118. vllm/model_executor/models/registry.py +891 -0
  1119. vllm/model_executor/models/roberta.py +252 -0
  1120. vllm/model_executor/models/rvl.py +103 -0
  1121. vllm/model_executor/models/seed_oss.py +488 -0
  1122. vllm/model_executor/models/siglip.py +524 -0
  1123. vllm/model_executor/models/siglip2navit.py +688 -0
  1124. vllm/model_executor/models/skyworkr1v.py +914 -0
  1125. vllm/model_executor/models/smolvlm.py +44 -0
  1126. vllm/model_executor/models/solar.py +506 -0
  1127. vllm/model_executor/models/stablelm.py +344 -0
  1128. vllm/model_executor/models/starcoder2.py +357 -0
  1129. vllm/model_executor/models/step3_text.py +521 -0
  1130. vllm/model_executor/models/step3_vl.py +1091 -0
  1131. vllm/model_executor/models/swin.py +475 -0
  1132. vllm/model_executor/models/tarsier.py +649 -0
  1133. vllm/model_executor/models/telechat2.py +151 -0
  1134. vllm/model_executor/models/teleflm.py +79 -0
  1135. vllm/model_executor/models/terratorch.py +294 -0
  1136. vllm/model_executor/models/transformers.py +883 -0
  1137. vllm/model_executor/models/ultravox.py +667 -0
  1138. vllm/model_executor/models/utils.py +770 -0
  1139. vllm/model_executor/models/vision.py +125 -0
  1140. vllm/model_executor/models/voxtral.py +789 -0
  1141. vllm/model_executor/models/whisper.py +966 -0
  1142. vllm/model_executor/models/zamba2.py +1056 -0
  1143. vllm/model_executor/parameter.py +599 -0
  1144. vllm/model_executor/sampling_metadata.py +597 -0
  1145. vllm/model_executor/utils.py +97 -0
  1146. vllm/model_executor/warmup/__init__.py +0 -0
  1147. vllm/model_executor/warmup/deep_gemm_warmup.py +223 -0
  1148. vllm/model_executor/warmup/kernel_warmup.py +83 -0
  1149. vllm/multimodal/__init__.py +35 -0
  1150. vllm/multimodal/audio.py +116 -0
  1151. vllm/multimodal/base.py +219 -0
  1152. vllm/multimodal/cache.py +507 -0
  1153. vllm/multimodal/hasher.py +110 -0
  1154. vllm/multimodal/image.py +130 -0
  1155. vllm/multimodal/inputs.py +979 -0
  1156. vllm/multimodal/parse.py +496 -0
  1157. vllm/multimodal/processing.py +1921 -0
  1158. vllm/multimodal/profiling.py +313 -0
  1159. vllm/multimodal/registry.py +375 -0
  1160. vllm/multimodal/utils.py +754 -0
  1161. vllm/multimodal/video.py +312 -0
  1162. vllm/outputs.py +517 -0
  1163. vllm/platforms/__init__.py +263 -0
  1164. vllm/platforms/cpu.py +353 -0
  1165. vllm/platforms/cuda.py +731 -0
  1166. vllm/platforms/interface.py +599 -0
  1167. vllm/platforms/rocm.py +504 -0
  1168. vllm/platforms/tpu.py +236 -0
  1169. vllm/platforms/xpu.py +243 -0
  1170. vllm/plugins/__init__.py +72 -0
  1171. vllm/plugins/io_processors/__init__.py +68 -0
  1172. vllm/plugins/io_processors/interface.py +67 -0
  1173. vllm/plugins/lora_resolvers/README.md +16 -0
  1174. vllm/plugins/lora_resolvers/__init__.py +0 -0
  1175. vllm/plugins/lora_resolvers/filesystem_resolver.py +50 -0
  1176. vllm/pooling_params.py +183 -0
  1177. vllm/profiler/__init__.py +0 -0
  1178. vllm/profiler/layerwise_profile.py +375 -0
  1179. vllm/profiler/utils.py +148 -0
  1180. vllm/py.typed +2 -0
  1181. vllm/ray/__init__.py +0 -0
  1182. vllm/ray/lazy_utils.py +22 -0
  1183. vllm/ray/ray_env.py +72 -0
  1184. vllm/reasoning/__init__.py +25 -0
  1185. vllm/reasoning/abs_reasoning_parsers.py +202 -0
  1186. vllm/reasoning/deepseek_r1_reasoning_parser.py +173 -0
  1187. vllm/reasoning/glm4_moe_reasoning_parser.py +151 -0
  1188. vllm/reasoning/gptoss_reasoning_parser.py +87 -0
  1189. vllm/reasoning/granite_reasoning_parser.py +363 -0
  1190. vllm/reasoning/hunyuan_a13b_reasoning_parser.py +245 -0
  1191. vllm/reasoning/mistral_reasoning_parser.py +47 -0
  1192. vllm/reasoning/qwen3_reasoning_parser.py +151 -0
  1193. vllm/reasoning/step3_reasoning_parser.py +109 -0
  1194. vllm/sampling_params.py +577 -0
  1195. vllm/scalar_type.py +349 -0
  1196. vllm/scripts.py +15 -0
  1197. vllm/sequence.py +1465 -0
  1198. vllm/tasks.py +11 -0
  1199. vllm/test_utils.py +130 -0
  1200. vllm/third_party/__init__.py +0 -0
  1201. vllm/third_party/pynvml.py +6140 -0
  1202. vllm/tracing.py +136 -0
  1203. vllm/transformers_utils/__init__.py +24 -0
  1204. vllm/transformers_utils/chat_templates/__init__.py +5 -0
  1205. vllm/transformers_utils/chat_templates/registry.py +71 -0
  1206. vllm/transformers_utils/chat_templates/template_basic.jinja +3 -0
  1207. vllm/transformers_utils/chat_templates/template_blip2.jinja +11 -0
  1208. vllm/transformers_utils/chat_templates/template_chatml.jinja +10 -0
  1209. vllm/transformers_utils/chat_templates/template_deepseek_vl2.jinja +23 -0
  1210. vllm/transformers_utils/chat_templates/template_fuyu.jinja +3 -0
  1211. vllm/transformers_utils/chat_templates/template_minicpmv45.jinja +93 -0
  1212. vllm/transformers_utils/config.py +1043 -0
  1213. vllm/transformers_utils/config_parser_base.py +20 -0
  1214. vllm/transformers_utils/configs/__init__.py +55 -0
  1215. vllm/transformers_utils/configs/arctic.py +207 -0
  1216. vllm/transformers_utils/configs/chatglm.py +72 -0
  1217. vllm/transformers_utils/configs/deepseek_vl2.py +216 -0
  1218. vllm/transformers_utils/configs/eagle.py +84 -0
  1219. vllm/transformers_utils/configs/falcon.py +90 -0
  1220. vllm/transformers_utils/configs/jais.py +238 -0
  1221. vllm/transformers_utils/configs/kimi_vl.py +37 -0
  1222. vllm/transformers_utils/configs/medusa.py +63 -0
  1223. vllm/transformers_utils/configs/midashenglm.py +101 -0
  1224. vllm/transformers_utils/configs/mistral.py +165 -0
  1225. vllm/transformers_utils/configs/mlp_speculator.py +68 -0
  1226. vllm/transformers_utils/configs/moonvit.py +33 -0
  1227. vllm/transformers_utils/configs/nemotron.py +205 -0
  1228. vllm/transformers_utils/configs/nemotron_h.py +259 -0
  1229. vllm/transformers_utils/configs/nemotron_vl.py +56 -0
  1230. vllm/transformers_utils/configs/ovis.py +176 -0
  1231. vllm/transformers_utils/configs/qwen3_next.py +275 -0
  1232. vllm/transformers_utils/configs/speculators/__init__.py +2 -0
  1233. vllm/transformers_utils/configs/speculators/algos.py +32 -0
  1234. vllm/transformers_utils/configs/speculators/base.py +91 -0
  1235. vllm/transformers_utils/configs/step3_vl.py +123 -0
  1236. vllm/transformers_utils/configs/ultravox.py +120 -0
  1237. vllm/transformers_utils/detokenizer.py +169 -0
  1238. vllm/transformers_utils/detokenizer_utils.py +199 -0
  1239. vllm/transformers_utils/dynamic_module.py +60 -0
  1240. vllm/transformers_utils/processor.py +245 -0
  1241. vllm/transformers_utils/processors/__init__.py +16 -0
  1242. vllm/transformers_utils/processors/deepseek_vl2.py +363 -0
  1243. vllm/transformers_utils/processors/ovis.py +420 -0
  1244. vllm/transformers_utils/processors/ovis2_5.py +458 -0
  1245. vllm/transformers_utils/runai_utils.py +99 -0
  1246. vllm/transformers_utils/s3_utils.py +90 -0
  1247. vllm/transformers_utils/tokenizer.py +293 -0
  1248. vllm/transformers_utils/tokenizer_base.py +149 -0
  1249. vllm/transformers_utils/tokenizer_group.py +132 -0
  1250. vllm/transformers_utils/tokenizers/__init__.py +10 -0
  1251. vllm/transformers_utils/tokenizers/mistral.py +520 -0
  1252. vllm/transformers_utils/utils.py +99 -0
  1253. vllm/triton_utils/__init__.py +16 -0
  1254. vllm/triton_utils/importing.py +95 -0
  1255. vllm/usage/__init__.py +0 -0
  1256. vllm/usage/usage_lib.py +259 -0
  1257. vllm/utils/__init__.py +3438 -0
  1258. vllm/utils/deep_gemm.py +212 -0
  1259. vllm/utils/flashinfer.py +372 -0
  1260. vllm/utils/jsontree.py +90 -0
  1261. vllm/utils/tensor_schema.py +236 -0
  1262. vllm/v1/__init__.py +0 -0
  1263. vllm/v1/attention/__init__.py +0 -0
  1264. vllm/v1/attention/backends/__init__.py +0 -0
  1265. vllm/v1/attention/backends/cpu_attn.py +922 -0
  1266. vllm/v1/attention/backends/flash_attn.py +800 -0
  1267. vllm/v1/attention/backends/flashinfer.py +1128 -0
  1268. vllm/v1/attention/backends/flex_attention.py +796 -0
  1269. vllm/v1/attention/backends/gdn_attn.py +320 -0
  1270. vllm/v1/attention/backends/linear_attn.py +68 -0
  1271. vllm/v1/attention/backends/mamba1_attn.py +81 -0
  1272. vllm/v1/attention/backends/mamba2_attn.py +224 -0
  1273. vllm/v1/attention/backends/mamba_attn.py +52 -0
  1274. vllm/v1/attention/backends/mla/__init__.py +0 -0
  1275. vllm/v1/attention/backends/mla/common.py +1608 -0
  1276. vllm/v1/attention/backends/mla/cutlass_mla.py +301 -0
  1277. vllm/v1/attention/backends/mla/flashattn_mla.py +273 -0
  1278. vllm/v1/attention/backends/mla/flashinfer_mla.py +110 -0
  1279. vllm/v1/attention/backends/mla/flashmla.py +213 -0
  1280. vllm/v1/attention/backends/mla/rocm_aiter_mla.py +255 -0
  1281. vllm/v1/attention/backends/mla/triton_mla.py +175 -0
  1282. vllm/v1/attention/backends/pallas.py +413 -0
  1283. vllm/v1/attention/backends/rocm_aiter_fa.py +548 -0
  1284. vllm/v1/attention/backends/short_conv_attn.py +82 -0
  1285. vllm/v1/attention/backends/tree_attn.py +450 -0
  1286. vllm/v1/attention/backends/triton_attn.py +430 -0
  1287. vllm/v1/attention/backends/utils.py +834 -0
  1288. vllm/v1/attention/backends/xformers.py +437 -0
  1289. vllm/v1/core/__init__.py +0 -0
  1290. vllm/v1/core/block_pool.py +330 -0
  1291. vllm/v1/core/encoder_cache_manager.py +333 -0
  1292. vllm/v1/core/kv_cache_coordinator.py +440 -0
  1293. vllm/v1/core/kv_cache_manager.py +398 -0
  1294. vllm/v1/core/kv_cache_utils.py +1169 -0
  1295. vllm/v1/core/sched/__init__.py +0 -0
  1296. vllm/v1/core/sched/async_scheduler.py +47 -0
  1297. vllm/v1/core/sched/interface.py +158 -0
  1298. vllm/v1/core/sched/output.py +162 -0
  1299. vllm/v1/core/sched/request_queue.py +224 -0
  1300. vllm/v1/core/sched/scheduler.py +1287 -0
  1301. vllm/v1/core/sched/utils.py +69 -0
  1302. vllm/v1/core/single_type_kv_cache_manager.py +670 -0
  1303. vllm/v1/cudagraph_dispatcher.py +121 -0
  1304. vllm/v1/engine/__init__.py +202 -0
  1305. vllm/v1/engine/async_llm.py +757 -0
  1306. vllm/v1/engine/coordinator.py +357 -0
  1307. vllm/v1/engine/core.py +1245 -0
  1308. vllm/v1/engine/core_client.py +1333 -0
  1309. vllm/v1/engine/detokenizer.py +300 -0
  1310. vllm/v1/engine/exceptions.py +17 -0
  1311. vllm/v1/engine/llm_engine.py +332 -0
  1312. vllm/v1/engine/logprobs.py +201 -0
  1313. vllm/v1/engine/output_processor.py +558 -0
  1314. vllm/v1/engine/parallel_sampling.py +133 -0
  1315. vllm/v1/engine/processor.py +524 -0
  1316. vllm/v1/engine/utils.py +857 -0
  1317. vllm/v1/executor/__init__.py +0 -0
  1318. vllm/v1/executor/abstract.py +126 -0
  1319. vllm/v1/executor/multiproc_executor.py +683 -0
  1320. vllm/v1/executor/ray_distributed_executor.py +109 -0
  1321. vllm/v1/kv_cache_interface.py +275 -0
  1322. vllm/v1/metrics/__init__.py +0 -0
  1323. vllm/v1/metrics/loggers.py +717 -0
  1324. vllm/v1/metrics/prometheus.py +82 -0
  1325. vllm/v1/metrics/ray_wrappers.py +133 -0
  1326. vllm/v1/metrics/reader.py +246 -0
  1327. vllm/v1/metrics/stats.py +248 -0
  1328. vllm/v1/outputs.py +147 -0
  1329. vllm/v1/pool/__init__.py +0 -0
  1330. vllm/v1/pool/metadata.py +77 -0
  1331. vllm/v1/request.py +237 -0
  1332. vllm/v1/sample/__init__.py +0 -0
  1333. vllm/v1/sample/logits_processor/__init__.py +294 -0
  1334. vllm/v1/sample/logits_processor/builtin.py +273 -0
  1335. vllm/v1/sample/logits_processor/interface.py +97 -0
  1336. vllm/v1/sample/logits_processor/state.py +161 -0
  1337. vllm/v1/sample/metadata.py +43 -0
  1338. vllm/v1/sample/ops/__init__.py +0 -0
  1339. vllm/v1/sample/ops/bad_words.py +39 -0
  1340. vllm/v1/sample/ops/logprobs.py +26 -0
  1341. vllm/v1/sample/ops/penalties.py +43 -0
  1342. vllm/v1/sample/ops/topk_topp_sampler.py +254 -0
  1343. vllm/v1/sample/rejection_sampler.py +623 -0
  1344. vllm/v1/sample/sampler.py +281 -0
  1345. vllm/v1/sample/tpu/__init__.py +0 -0
  1346. vllm/v1/sample/tpu/metadata.py +124 -0
  1347. vllm/v1/sample/tpu/sampler.py +213 -0
  1348. vllm/v1/serial_utils.py +395 -0
  1349. vllm/v1/spec_decode/__init__.py +0 -0
  1350. vllm/v1/spec_decode/eagle.py +740 -0
  1351. vllm/v1/spec_decode/medusa.py +66 -0
  1352. vllm/v1/spec_decode/metadata.py +62 -0
  1353. vllm/v1/spec_decode/metrics.py +191 -0
  1354. vllm/v1/spec_decode/ngram_proposer.py +157 -0
  1355. vllm/v1/spec_decode/utils.py +14 -0
  1356. vllm/v1/structured_output/__init__.py +297 -0
  1357. vllm/v1/structured_output/backend_guidance.py +245 -0
  1358. vllm/v1/structured_output/backend_lm_format_enforcer.py +167 -0
  1359. vllm/v1/structured_output/backend_outlines.py +320 -0
  1360. vllm/v1/structured_output/backend_types.py +134 -0
  1361. vllm/v1/structured_output/backend_xgrammar.py +323 -0
  1362. vllm/v1/structured_output/request.py +86 -0
  1363. vllm/v1/structured_output/utils.py +373 -0
  1364. vllm/v1/utils.py +382 -0
  1365. vllm/v1/worker/__init__.py +0 -0
  1366. vllm/v1/worker/block_table.py +221 -0
  1367. vllm/v1/worker/cpu_model_runner.py +163 -0
  1368. vllm/v1/worker/cpu_worker.py +183 -0
  1369. vllm/v1/worker/gpu_input_batch.py +821 -0
  1370. vllm/v1/worker/gpu_model_runner.py +3743 -0
  1371. vllm/v1/worker/gpu_worker.py +697 -0
  1372. vllm/v1/worker/kv_connector_model_runner_mixin.py +122 -0
  1373. vllm/v1/worker/lora_model_runner_mixin.py +192 -0
  1374. vllm/v1/worker/tpu_input_batch.py +585 -0
  1375. vllm/v1/worker/tpu_model_runner.py +1947 -0
  1376. vllm/v1/worker/tpu_worker.py +340 -0
  1377. vllm/v1/worker/utils.py +290 -0
  1378. vllm/v1/worker/worker_base.py +65 -0
  1379. vllm/v1/worker/xpu_model_runner.py +53 -0
  1380. vllm/v1/worker/xpu_worker.py +179 -0
  1381. vllm/version.py +41 -0
  1382. vllm/vllm_flash_attn/.gitkeep +0 -0
  1383. vllm/worker/__init__.py +0 -0
  1384. vllm/worker/cache_engine.py +145 -0
  1385. vllm/worker/enc_dec_model_runner.py +553 -0
  1386. vllm/worker/model_runner.py +2016 -0
  1387. vllm/worker/model_runner_base.py +307 -0
  1388. vllm/worker/utils.py +49 -0
  1389. vllm/worker/worker.py +670 -0
  1390. vllm/worker/worker_base.py +651 -0
  1391. vllm_cpu_avx512vnni-0.10.2.post2.dist-info/METADATA +326 -0
  1392. vllm_cpu_avx512vnni-0.10.2.post2.dist-info/RECORD +1395 -0
  1393. vllm_cpu_avx512vnni-0.10.2.post2.dist-info/WHEEL +5 -0
  1394. vllm_cpu_avx512vnni-0.10.2.post2.dist-info/entry_points.txt +5 -0
  1395. vllm_cpu_avx512vnni-0.10.2.post2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1684 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+ import math
4
+ from abc import abstractmethod
5
+ from collections.abc import Iterable, Mapping, Sequence
6
+ from functools import partial
7
+ from typing import Annotated, Any, Literal, Optional, TypeVar, Union
8
+
9
+ import numpy as np
10
+ import torch
11
+ import torch.nn as nn
12
+ from einops import rearrange
13
+ from transformers import PretrainedConfig
14
+ from transformers.activations import GELUActivation
15
+ from transformers.feature_extraction_utils import BatchFeature
16
+ from transformers.modeling_outputs import (BaseModelOutput,
17
+ BaseModelOutputWithPooling)
18
+ from transformers.utils import torch_int
19
+
20
+ from vllm.config import VllmConfig
21
+ from vllm.distributed import get_tensor_model_parallel_world_size
22
+ from vllm.logger import init_logger
23
+ from vllm.model_executor import SamplingMetadata
24
+ from vllm.model_executor.layers.linear import (ColumnParallelLinear,
25
+ QKVParallelLinear,
26
+ RowParallelLinear)
27
+ from vllm.model_executor.layers.quantization import QuantizationConfig
28
+ from vllm.model_executor.layers.quantization.gptq import GPTQConfig
29
+ from vllm.model_executor.layers.quantization.gptq_marlin import (
30
+ GPTQMarlinConfig)
31
+ from vllm.model_executor.model_loader.weight_utils import (
32
+ default_weight_loader, maybe_remap_kv_scale_name)
33
+ from vllm.model_executor.models.module_mapping import MultiModelKeys
34
+ from vllm.multimodal import MULTIMODAL_REGISTRY, NestedTensors
35
+ from vllm.multimodal.inputs import (ImageItem, ModalityData,
36
+ MultiModalDataDict, MultiModalFieldConfig,
37
+ MultiModalKwargsItems, VideoItem)
38
+ from vllm.multimodal.parse import (DictEmbeddingItems, ImageSize,
39
+ ModalityDataItems, MultiModalDataItems,
40
+ MultiModalDataParser)
41
+ from vllm.multimodal.processing import (BaseMultiModalProcessor,
42
+ BaseProcessingInfo, PromptReplacement,
43
+ PromptUpdate)
44
+ from vllm.multimodal.profiling import BaseDummyInputsBuilder
45
+ from vllm.platforms import _Backend
46
+ from vllm.sequence import IntermediateTensors
47
+ from vllm.transformers_utils.config import uses_mrope
48
+ from vllm.utils import is_list_of
49
+ from vllm.utils.tensor_schema import TensorSchema, TensorShape
50
+
51
+ from .interfaces import (MultiModalEmbeddings, SupportsLoRA,
52
+ SupportsMultiModal, SupportsPP)
53
+ from .siglip import SiglipMLP
54
+ from .utils import (AutoWeightsLoader, WeightsMapper,
55
+ init_vllm_registered_model, is_pp_missing_parameter,
56
+ maybe_prefix, merge_multimodal_embeddings)
57
+ from .vision import get_vit_attn_backend
58
+
59
+ logger = init_logger(__name__)
60
+
61
+
62
+ def smart_resize(
63
+ height: int,
64
+ width: int,
65
+ factor: int,
66
+ min_pixels: int,
67
+ max_pixels: int,
68
+ ):
69
+ if height < factor:
70
+ logger.warning(
71
+ "smart_resize: height=%s < factor=%s, reset height=factor",
72
+ height,
73
+ factor,
74
+ )
75
+ width = round((width * factor) / height)
76
+ height = factor
77
+
78
+ if width < factor:
79
+ logger.warning(
80
+ "smart_resize: width=%s < factor=%s, reset width=factor",
81
+ width,
82
+ factor,
83
+ )
84
+ height = round((height * factor) / width)
85
+ width = factor
86
+
87
+ if max(height, width) / min(height, width) > 200:
88
+ raise ValueError("absolute aspect ratio must be smaller than 200, got "
89
+ "{max(height, width) / min(height, width)}")
90
+ h_bar = round(height / factor) * factor
91
+ w_bar = round(width / factor) * factor
92
+ if h_bar * w_bar > max_pixels:
93
+ beta = math.sqrt((height * width) / max_pixels)
94
+ h_bar = math.floor(height / beta / factor) * factor
95
+ w_bar = math.floor(width / beta / factor) * factor
96
+ elif h_bar * w_bar < min_pixels:
97
+ beta = math.sqrt(min_pixels / (height * width))
98
+ h_bar = math.ceil(height * beta / factor) * factor
99
+ w_bar = math.ceil(width * beta / factor) * factor
100
+ return h_bar, w_bar
101
+
102
+
103
+ class KeyeImagePixelInputs(TensorSchema):
104
+ """
105
+ Dimensions:
106
+ - b: Batch size
107
+ - np: Number of patches
108
+ - c: Number of channels
109
+ - ps: Patch size
110
+ - ni: Number of images
111
+ - g: Grid dimensions (3 for t, h, w)
112
+ """
113
+ type: Literal["pixel_values"]
114
+ pixel_values: Annotated[
115
+ torch.Tensor,
116
+ TensorShape("b", "np", 3, "ps", "ps", dynamic_dims={"np"})]
117
+ image_grid_thw: Annotated[torch.Tensor, TensorShape("ni", 3)]
118
+
119
+
120
+ class KeyeImageEmbeddingInputs(TensorSchema):
121
+ """
122
+ Dimensions:
123
+ - nf: Number of image features
124
+ - hs: Hidden size (must match the hidden size of language model
125
+ backbone)
126
+ - ni: Number of images
127
+ - g: Grid dimensions (3 for t, h, w)
128
+ """
129
+ type: Literal["image_embeds"]
130
+ image_embeds: Annotated[torch.Tensor, TensorShape("nf", "hs")]
131
+ image_grid_thw: Annotated[torch.Tensor, TensorShape("ni", 3)]
132
+
133
+
134
+ KeyeImageInputs = Union[KeyeImagePixelInputs, KeyeImageEmbeddingInputs]
135
+
136
+
137
+ class KeyeVideoPixelInputs(TensorSchema):
138
+ """
139
+ Dimensions:
140
+ - b: Batch size
141
+ - np: Number of patches
142
+ - c: Number of channels
143
+ - ps: Patch size
144
+ - ni: Number of images
145
+ - g: Grid dimensions (3 for t, h, w)
146
+ """
147
+ type: Literal["pixel_values_videos"]
148
+ pixel_values_videos: Annotated[
149
+ torch.Tensor,
150
+ TensorShape("b", "np", 3, "ps", "ps", dynamic_dims={"np"})]
151
+ video_grid_thw: Annotated[torch.Tensor, TensorShape("nv", 3)]
152
+
153
+
154
+ class KeyeVideoEmbeddingInputs(TensorSchema):
155
+ """
156
+ Dimensions:
157
+ - nf: Number of video features
158
+ - hs: Hidden size (must match the hidden size of language model
159
+ backbone)
160
+ - nv: Number of videos
161
+ - g: Grid dimensions (3 for t, h, w)
162
+ """
163
+ type: Literal["video_embeds"]
164
+ video_embeds: Annotated[torch.Tensor, TensorShape("nf", "hs")]
165
+ video_grid_thw: Annotated[torch.Tensor, TensorShape("nv", 3)]
166
+
167
+
168
+ KeyeVideoInputs = Union[KeyeVideoPixelInputs, KeyeVideoEmbeddingInputs]
169
+
170
+
171
+ class KeyeVisionEmbeddings(nn.Module):
172
+
173
+ def __init__(self, config: PretrainedConfig):
174
+ super().__init__()
175
+ self.config = config
176
+ self.embed_dim = config.hidden_size
177
+ self.image_size = config.image_size
178
+ self.patch_size = config.patch_size
179
+
180
+ self.patch_embedding = nn.Conv2d(
181
+ in_channels=config.num_channels,
182
+ out_channels=self.embed_dim,
183
+ kernel_size=self.patch_size,
184
+ stride=self.patch_size,
185
+ padding="valid",
186
+ )
187
+
188
+ self.num_patches = (self.image_size // self.patch_size)**2
189
+ self.num_positions = self.num_patches
190
+ self.cache_position_embedding = dict()
191
+ self.cache_position_count = dict()
192
+ self.position_embedding = nn.Embedding(self.num_positions,
193
+ self.embed_dim)
194
+ self.packing_position_embedding = nn.Embedding(32768, self.embed_dim)
195
+
196
+ self.register_buffer(
197
+ "position_ids",
198
+ torch.arange(self.num_positions).expand((1, -1)),
199
+ persistent=False,
200
+ )
201
+
202
+ def interpolate_pos_encoding(
203
+ self,
204
+ embeddings: torch.Tensor,
205
+ height: int,
206
+ width: int,
207
+ is_after_patchify: bool = False,
208
+ ) -> torch.Tensor:
209
+
210
+ num_positions = self.position_embedding.weight.shape[0]
211
+
212
+ patch_pos_embed = self.position_embedding.weight.unsqueeze(0)
213
+
214
+ dim = embeddings.shape[-1]
215
+
216
+ if is_after_patchify:
217
+ new_height = height
218
+ new_width = width
219
+ else:
220
+ new_height = height // self.patch_size
221
+ new_width = width // self.patch_size
222
+
223
+ sqrt_num_positions = torch_int(num_positions**0.5)
224
+ patch_pos_embed = patch_pos_embed.reshape(1, sqrt_num_positions,
225
+ sqrt_num_positions, dim)
226
+ patch_pos_embed = patch_pos_embed.permute(0, 3, 1, 2)
227
+
228
+ patch_pos_embed = nn.functional.interpolate(
229
+ patch_pos_embed,
230
+ size=(new_height, new_width),
231
+ mode="bilinear",
232
+ align_corners=False,
233
+ )
234
+
235
+ patch_pos_embed = patch_pos_embed.permute(0, 2, 3, 1).view(1, -1, dim)
236
+ return patch_pos_embed
237
+
238
+ def fetch_position_embedding_lfu_cache(self,
239
+ embeddings,
240
+ h,
241
+ w,
242
+ max_cache: int = 20):
243
+ grid = (h, w)
244
+ if grid in self.cache_position_embedding:
245
+ self.cache_position_count[grid] += 1
246
+ return self.cache_position_embedding[grid]
247
+
248
+ if len(self.cache_position_embedding) >= max_cache:
249
+ min_hit_grid = min(
250
+ self.cache_position_count,
251
+ key=self.cache_position_count.get,
252
+ )
253
+ self.cache_position_count.pop(min_hit_grid)
254
+ self.cache_position_embedding.pop(min_hit_grid)
255
+
256
+ position_embedding = self.interpolate_pos_encoding(
257
+ embeddings, h, w, True)
258
+ self.cache_position_count[grid] = 1
259
+ self.cache_position_embedding[grid] = position_embedding
260
+ return position_embedding
261
+
262
+ def forward(
263
+ self,
264
+ pixel_values: torch.FloatTensor,
265
+ position_ids: Optional[torch.Tensor] = None,
266
+ image_grid_thw: Optional[list[Union[
267
+ tuple[int, int, int],
268
+ list[tuple[int, int, int]],
269
+ ]]] = None,
270
+ interpolate_pos_encoding=False,
271
+ ) -> torch.Tensor:
272
+ if pixel_values.dim() == 4:
273
+ pixel_values = pixel_values.unsqueeze(0)
274
+ if pixel_values.dim() == 5:
275
+ if position_ids is None:
276
+ raise ValueError(
277
+ "position_ids cannot be None when pixel_values.dim() is 5."
278
+ )
279
+ (
280
+ batch_size,
281
+ squence_len,
282
+ channel,
283
+ height,
284
+ width,
285
+ ) = pixel_values.shape
286
+ target_dtype = self.patch_embedding.weight.dtype
287
+ pixel_values = rearrange(pixel_values, "b l c h w -> (b l) c h w")
288
+ patch_embeds = self.patch_embedding(
289
+ pixel_values.to(dtype=target_dtype))
290
+ embeddings = patch_embeds.flatten(-2).squeeze(-1)
291
+
292
+ if interpolate_pos_encoding and image_grid_thw is not None:
293
+ start = 0
294
+ tmp_embeddings = list()
295
+ for image_grid in image_grid_thw:
296
+ t, h, w = image_grid
297
+ end = start + t * h * w
298
+ image_embeddings = embeddings[start:end, :]
299
+ position_embedding = (self.interpolate_pos_encoding(
300
+ image_embeddings, h, w, True).squeeze(0).repeat(t, 1))
301
+ image_embeddings = image_embeddings + position_embedding
302
+ tmp_embeddings.append(image_embeddings)
303
+ start = end
304
+ embeddings = torch.concat(tmp_embeddings, dim=0).unsqueeze(0)
305
+ else:
306
+ embeddings = embeddings + self.packing_position_embedding(
307
+ position_ids)
308
+ return embeddings
309
+ else:
310
+ raise ValueError("Unsupported pixel_values dimension:"
311
+ f" {pixel_values.dim()}. Expected 4 or 5.")
312
+
313
+
314
+ def apply_rotary_pos_emb_flashatt(
315
+ q: torch.Tensor,
316
+ k: torch.Tensor,
317
+ cos: torch.Tensor,
318
+ sin: torch.Tensor,
319
+ ) -> tuple[torch.Tensor, torch.Tensor]:
320
+ cos = cos.chunk(2, dim=-1)[0].contiguous()
321
+ sin = sin.chunk(2, dim=-1)[0].contiguous()
322
+
323
+ from vllm.vllm_flash_attn.layers.rotary import apply_rotary_emb
324
+
325
+ q_embed = apply_rotary_emb(q.float(), cos.float(), sin.float()).type_as(q)
326
+ k_embed = apply_rotary_emb(k.float(), cos.float(), sin.float()).type_as(k)
327
+ return q_embed, k_embed
328
+
329
+
330
+ class KeyeSiglipAttention(nn.Module):
331
+ """Multi-headed attention from 'Attention Is All You
332
+ Need' paper."""
333
+
334
+ def __init__(
335
+ self,
336
+ config: PretrainedConfig,
337
+ quant_config: Optional[QuantizationConfig] = None,
338
+ prefix: str = "",
339
+ ):
340
+ super().__init__()
341
+ self.config = config
342
+
343
+ hidden_size = config.hidden_size
344
+ self.hidden_size = config.hidden_size
345
+ tp_size = get_tensor_model_parallel_world_size()
346
+ self.total_num_heads = config.num_attention_heads
347
+ assert self.total_num_heads % tp_size == 0
348
+ self.num_heads = self.total_num_heads // tp_size
349
+ self.total_num_kv_heads = config.num_attention_heads
350
+ if self.total_num_kv_heads >= tp_size:
351
+ assert self.total_num_kv_heads % tp_size == 0
352
+ else:
353
+ assert tp_size % self.total_num_kv_heads == 0
354
+ self.num_kv_heads = max(1, self.total_num_kv_heads // tp_size)
355
+ self.head_dim = config.hidden_size // self.total_num_heads
356
+ self.q_size = self.num_heads * self.head_dim
357
+ self.kv_size = self.num_kv_heads * self.head_dim
358
+ self.scale = self.head_dim**-0.5
359
+
360
+ self.qkv_proj = QKVParallelLinear(
361
+ hidden_size,
362
+ self.head_dim,
363
+ self.total_num_heads,
364
+ self.total_num_kv_heads,
365
+ bias=True,
366
+ quant_config=quant_config,
367
+ prefix=f"{prefix}.qkv_proj",
368
+ )
369
+ self.out_proj = RowParallelLinear(
370
+ input_size=hidden_size,
371
+ output_size=hidden_size,
372
+ quant_config=quant_config,
373
+ prefix=f"{prefix}.out_proj",
374
+ )
375
+
376
+ # Detect attention implementation.
377
+ self.attn_backend: _Backend = get_vit_attn_backend(support_fa=True)
378
+ if self.attn_backend not in {_Backend.FLASH_ATTN, _Backend.XFORMERS}:
379
+ raise RuntimeError(
380
+ f"Keye-VL does not support {self.attn_backend} backend now.")
381
+
382
+ def forward(
383
+ self,
384
+ hidden_states: torch.Tensor,
385
+ attention_mask: Optional[torch.Tensor] = None,
386
+ output_attentions: Optional[bool] = False,
387
+ cu_seqlens: Optional[list[torch.Tensor]] = None,
388
+ rope_emb: Optional[tuple[torch.Tensor, torch.Tensor]] = None,
389
+ ) -> torch.Tensor:
390
+ qkv, _ = self.qkv_proj(hidden_states)
391
+ q, k, v = qkv.split(
392
+ [self.q_size, self.kv_size, self.kv_size],
393
+ dim=-1,
394
+ )
395
+
396
+ max_seqlen = (cu_seqlens[1:] - cu_seqlens[:-1]).max().item()
397
+ seqlens = (cu_seqlens[1:] - cu_seqlens[:-1]).tolist()
398
+ batch_size = q.shape[0]
399
+
400
+ if rope_emb is None:
401
+ q = q.view(*q.shape[:-1], self.num_heads, self.head_dim)
402
+ k = k.view(
403
+ *k.shape[:-1],
404
+ self.num_kv_heads,
405
+ self.head_dim,
406
+ )
407
+ v = v.view(
408
+ *v.shape[:-1],
409
+ self.num_kv_heads,
410
+ self.head_dim,
411
+ )
412
+ else:
413
+ if cu_seqlens is None:
414
+ raise ValueError(
415
+ "cu_seqlens cannot be None when rope_emb is not None.")
416
+ cos, sin = rope_emb
417
+ q = q.view(*q.shape[:-1], self.num_heads, self.head_dim)
418
+ k = k.view(
419
+ *k.shape[:-1],
420
+ self.num_kv_heads,
421
+ self.head_dim,
422
+ )
423
+ q, k = apply_rotary_pos_emb_flashatt(q, k, cos, sin)
424
+ v = v.view(
425
+ *v.shape[:-1],
426
+ self.num_kv_heads,
427
+ self.head_dim,
428
+ )
429
+
430
+ if self.attn_backend == _Backend.FLASH_ATTN:
431
+ from flash_attn import flash_attn_varlen_func
432
+
433
+ q, k, v = (rearrange(x, "b s ... -> (b s) ...") for x in [q, k, v])
434
+
435
+ output = flash_attn_varlen_func(
436
+ q,
437
+ k,
438
+ v,
439
+ cu_seqlens_q=cu_seqlens,
440
+ cu_seqlens_k=cu_seqlens,
441
+ max_seqlen_q=max_seqlen,
442
+ max_seqlen_k=max_seqlen,
443
+ causal=False,
444
+ softmax_scale=self.scale,
445
+ )
446
+ context_layer = rearrange(output,
447
+ "(b s) ... -> b s ...",
448
+ b=batch_size)
449
+ elif self.attn_backend == _Backend.XFORMERS:
450
+ from xformers import ops as xops
451
+ from xformers.ops.fmha.attn_bias import BlockDiagonalMask
452
+
453
+ attn_bias = BlockDiagonalMask.from_seqlens(q_seqlen=seqlens,
454
+ kv_seqlen=None,
455
+ device=q.device)
456
+
457
+ context_layer = xops.memory_efficient_attention_forward(
458
+ q, k, v, attn_bias=attn_bias, p=0, scale=None)
459
+
460
+ context_layer = rearrange(context_layer,
461
+ "b s h d -> b s (h d)").contiguous()
462
+
463
+ output, _ = self.out_proj(context_layer)
464
+ return output
465
+
466
+
467
+ class SigLIPRotaryEmbedding(nn.Module):
468
+
469
+ def __init__(self, dim: int, theta: float = 10000.0) -> None:
470
+ super().__init__()
471
+ self.dim = dim
472
+ self.theta = theta
473
+ self.rope_init()
474
+
475
+ def rope_init(self):
476
+ inv_freq = 1.0 / (self.theta**(
477
+ torch.arange(0, self.dim, 2, dtype=torch.float) / self.dim))
478
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
479
+
480
+ def forward(self, seqlen: int) -> torch.Tensor:
481
+ seq = torch.arange(
482
+ seqlen,
483
+ device=self.inv_freq.device,
484
+ dtype=self.inv_freq.dtype,
485
+ )
486
+ freqs = torch.outer(seq, self.inv_freq)
487
+ return freqs
488
+
489
+
490
+ class KeyeSiglipEncoderLayer(nn.Module):
491
+
492
+ def __init__(
493
+ self,
494
+ config: Union[PretrainedConfig],
495
+ quant_config: Optional[QuantizationConfig] = None,
496
+ prefix: str = "",
497
+ ):
498
+ super().__init__()
499
+ self.embed_dim = config.hidden_size
500
+ self.layer_norm1 = nn.LayerNorm(self.embed_dim,
501
+ eps=config.layer_norm_eps)
502
+ self.self_attn = KeyeSiglipAttention(
503
+ config,
504
+ quant_config=quant_config,
505
+ prefix=f"{prefix}.self_attn",
506
+ )
507
+ self.layer_norm2 = nn.LayerNorm(self.embed_dim,
508
+ eps=config.layer_norm_eps)
509
+ self.mlp = SiglipMLP(
510
+ config,
511
+ quant_config=quant_config,
512
+ prefix=f"{prefix}.mlp",
513
+ )
514
+
515
+ def forward(
516
+ self,
517
+ hidden_states: torch.Tensor,
518
+ attention_mask: torch.Tensor,
519
+ output_attentions: Optional[bool] = False,
520
+ cu_seqlens: Optional[list[torch.Tensor]] = None,
521
+ rope_emb: Optional[tuple[torch.Tensor, torch.Tensor]] = None,
522
+ ) -> tuple[torch.FloatTensor]:
523
+
524
+ residual = hidden_states
525
+
526
+ hidden_states = self.layer_norm1(hidden_states)
527
+ hidden_states = self.self_attn(
528
+ hidden_states=hidden_states,
529
+ attention_mask=attention_mask,
530
+ output_attentions=output_attentions,
531
+ cu_seqlens=cu_seqlens,
532
+ rope_emb=rope_emb,
533
+ )
534
+
535
+ hidden_states = residual + hidden_states
536
+
537
+ residual = hidden_states
538
+ hidden_states = self.layer_norm2(hidden_states)
539
+ hidden_states = self.mlp(hidden_states)
540
+
541
+ hidden_states = residual + hidden_states
542
+
543
+ return hidden_states
544
+
545
+
546
+ class KeyeSiglipEncoder(nn.Module):
547
+
548
+ def __init__(
549
+ self,
550
+ config: PretrainedConfig,
551
+ quant_config: Optional[QuantizationConfig] = None,
552
+ prefix: str = "",
553
+ ):
554
+ super().__init__()
555
+ self.config = config
556
+ embed_dim = config.hidden_size
557
+ num_heads = config.num_attention_heads
558
+ head_dim = embed_dim // num_heads
559
+ self.layers = nn.ModuleList([
560
+ KeyeSiglipEncoderLayer(
561
+ config,
562
+ quant_config=quant_config,
563
+ prefix=f"{prefix}.layers.{layer_idx}",
564
+ ) for layer_idx in range(config.num_hidden_layers)
565
+ ])
566
+ self.rotary_pos_emb = SigLIPRotaryEmbedding(head_dim // 2)
567
+
568
+ @staticmethod
569
+ def flatten_list(image_grid_thw):
570
+ tmp_image_grid_thw = list()
571
+ for image_grid in image_grid_thw:
572
+ if isinstance(image_grid, list):
573
+ tmp_image_grid_thw.extend(image_grid)
574
+ else:
575
+ tmp_image_grid_thw.append(image_grid)
576
+ return tmp_image_grid_thw
577
+
578
+ def forward(
579
+ self,
580
+ inputs_embeds,
581
+ attention_mask: Optional[torch.Tensor] = None,
582
+ output_attentions: Optional[bool] = None,
583
+ output_hidden_states: Optional[bool] = None,
584
+ cu_seqlens: Optional[list[torch.Tensor]] = None,
585
+ image_grid_thw: Optional[list[Union[
586
+ tuple[int, int, int],
587
+ list[tuple[int, int, int]],
588
+ ]]] = None,
589
+ height_position_ids: Optional[torch.Tensor] = None,
590
+ width_position_ids: Optional[torch.Tensor] = None,
591
+ use_rope: Optional[bool] = False,
592
+ window_size: Optional[bool] = -1,
593
+ vision_or_text: str = "vision",
594
+ ) -> BaseModelOutput:
595
+ device = inputs_embeds.device
596
+ hidden_states = inputs_embeds
597
+ if use_rope is True:
598
+ flatten_image_grid_thw = self.flatten_list(image_grid_thw)
599
+
600
+ if width_position_ids is None or height_position_ids is None:
601
+ split_hids = list()
602
+ split_wids = list()
603
+ for t, h, w in flatten_image_grid_thw:
604
+ image_pids = torch.arange(t * h * w,
605
+ device=device) % (h * w)
606
+ sample_hids = image_pids // w
607
+ sample_wids = image_pids % w
608
+ split_hids.append(sample_hids)
609
+ split_wids.append(sample_wids)
610
+ width_position_ids = torch.concat(split_wids, dim=0)
611
+ height_position_ids = torch.concat(split_hids, dim=0)
612
+
613
+ pids = torch.stack(
614
+ [height_position_ids, width_position_ids],
615
+ dim=-1,
616
+ )
617
+ max_grid_size = pids.max() + 1
618
+ rope_emb_max_grid = self.rotary_pos_emb(max_grid_size)
619
+ rope_emb = rope_emb_max_grid[pids].flatten(1)
620
+ rope_emb = rope_emb.repeat(1, 2)
621
+ rope_emb = (rope_emb.cos(), rope_emb.sin())
622
+ else:
623
+ rope_emb = None
624
+
625
+ attn_cu_seqlens = cu_seqlens
626
+ hidden_states = inputs_embeds
627
+ assert attention_mask is None
628
+
629
+ for encoder_layer in self.layers:
630
+ hidden_states = encoder_layer(
631
+ hidden_states,
632
+ attention_mask,
633
+ output_attentions=output_attentions,
634
+ cu_seqlens=attn_cu_seqlens,
635
+ rope_emb=rope_emb,
636
+ )
637
+ return hidden_states
638
+
639
+
640
+ class KeyeSiglipVisionTransformer(nn.Module):
641
+
642
+ def __init__(
643
+ self,
644
+ config: PretrainedConfig,
645
+ quant_config: Optional[QuantizationConfig] = None,
646
+ prefix: str = "",
647
+ ):
648
+ super().__init__()
649
+ self.config = config
650
+ embed_dim = config.hidden_size
651
+
652
+ self.embeddings = KeyeVisionEmbeddings(config)
653
+ self.encoder = KeyeSiglipEncoder(
654
+ config,
655
+ quant_config=quant_config,
656
+ prefix=f"{prefix}.encoder",
657
+ )
658
+ self.post_layernorm = nn.LayerNorm(embed_dim,
659
+ eps=config.layer_norm_eps)
660
+
661
+ def forward(
662
+ self,
663
+ pixel_values,
664
+ output_attentions: Optional[bool] = None,
665
+ output_hidden_states: Optional[bool] = None,
666
+ interpolate_pos_encoding: Optional[bool] = False,
667
+ attention_mask: Optional[torch.Tensor] = None,
668
+ sample_indices: Optional[torch.Tensor] = None,
669
+ image_indices: Optional[torch.Tensor] = None,
670
+ position_ids: Optional[torch.Tensor] = None,
671
+ height_position_ids: Optional[torch.Tensor] = None,
672
+ width_position_ids: Optional[torch.Tensor] = None,
673
+ cu_seqlens: Optional[list[torch.Tensor]] = None,
674
+ padding_mask: Optional[torch.Tensor] = None,
675
+ vision_return_embed_list: Optional[bool] = False,
676
+ image_grid_thw: Optional[list[Union[
677
+ tuple[int, int, int],
678
+ list[tuple[int, int, int]],
679
+ ]]] = None,
680
+ return_pooler_output: Optional[bool] = True,
681
+ use_rope: Optional[bool] = False,
682
+ window_size: Optional[bool] = -1,
683
+ ) -> BaseModelOutputWithPooling:
684
+
685
+ hidden_states = self.embeddings(
686
+ pixel_values,
687
+ interpolate_pos_encoding=interpolate_pos_encoding,
688
+ position_ids=position_ids,
689
+ image_grid_thw=image_grid_thw,
690
+ )
691
+
692
+ last_hidden_state = self.encoder(
693
+ inputs_embeds=hidden_states,
694
+ output_attentions=output_attentions,
695
+ output_hidden_states=output_hidden_states,
696
+ attention_mask=attention_mask,
697
+ cu_seqlens=cu_seqlens,
698
+ image_grid_thw=image_grid_thw,
699
+ use_rope=use_rope,
700
+ height_position_ids=height_position_ids,
701
+ width_position_ids=width_position_ids,
702
+ window_size=window_size,
703
+ vision_or_text="vision",
704
+ )
705
+
706
+ last_hidden_state = self.post_layernorm(last_hidden_state)
707
+
708
+ sample_hidden_state = list()
709
+ if cu_seqlens is None:
710
+ raise ValueError("cu_seqlens cannot be None for "
711
+ "SiglipVisionTransformer output processing.")
712
+ for i in range(cu_seqlens.shape[0] - 1):
713
+ start = cu_seqlens[i]
714
+ end = cu_seqlens[i + 1]
715
+ tensor = last_hidden_state[:, start:end, :].squeeze(0)
716
+ sample_hidden_state.append(tensor)
717
+
718
+ return sample_hidden_state
719
+
720
+
721
+ class KeyeSiglipVisionModel(nn.Module):
722
+ config_class = PretrainedConfig
723
+ main_input_name = "pixel_values"
724
+
725
+ def __init__(
726
+ self,
727
+ config: PretrainedConfig,
728
+ quant_config: Optional[QuantizationConfig] = None,
729
+ prefix: str = "",
730
+ ):
731
+ super().__init__()
732
+
733
+ self.vision_model = KeyeSiglipVisionTransformer(
734
+ config,
735
+ quant_config=quant_config,
736
+ prefix=f"{prefix}.vision_model",
737
+ )
738
+ self.quant_config = quant_config
739
+
740
+ @property
741
+ def dtype(self) -> torch.dtype:
742
+ return self.vision_model.embeddings.patch_embedding.weight.dtype
743
+
744
+ @property
745
+ def device(self) -> torch.device:
746
+ return self.vision_model.embeddings.patch_embedding.weight.device
747
+
748
+ def get_input_embeddings(self) -> nn.Module:
749
+ return self.vision_model.embeddings.patch_embedding
750
+
751
+ def forward(
752
+ self,
753
+ pixel_values,
754
+ sample_indices: Optional[torch.Tensor] = None,
755
+ output_attentions: Optional[bool] = None,
756
+ output_hidden_states: Optional[bool] = None,
757
+ interpolate_pos_encoding: bool = False,
758
+ position_ids: Optional[torch.Tensor] = None,
759
+ vision_return_embed_list: Optional[bool] = False,
760
+ image_grid_thw: Optional[list[Union[
761
+ tuple[int, int, int],
762
+ list[tuple[int, int, int]],
763
+ ]]] = None,
764
+ cu_seqlens: Optional[list[torch.Tensor]] = None,
765
+ return_pooler_output: Optional[bool] = True,
766
+ use_rope: Optional[bool] = False,
767
+ window_size: Optional[bool] = -1,
768
+ ) -> BaseModelOutputWithPooling:
769
+
770
+ return self.vision_model(
771
+ pixel_values=pixel_values,
772
+ output_attentions=output_attentions,
773
+ output_hidden_states=output_hidden_states,
774
+ interpolate_pos_encoding=interpolate_pos_encoding,
775
+ position_ids=position_ids,
776
+ vision_return_embed_list=vision_return_embed_list,
777
+ image_grid_thw=image_grid_thw,
778
+ sample_indices=sample_indices,
779
+ cu_seqlens=cu_seqlens,
780
+ return_pooler_output=return_pooler_output,
781
+ use_rope=use_rope,
782
+ window_size=window_size,
783
+ )
784
+
785
+ def load_weights(self, weights: Iterable[tuple[str,
786
+ torch.Tensor]]) -> set[str]:
787
+ stacked_params_mapping = [
788
+ ("qkv_proj", "q_proj", "q"),
789
+ ("qkv_proj", "k_proj", "k"),
790
+ ("qkv_proj", "v_proj", "v"),
791
+ ]
792
+ params_dict = dict(self.named_parameters(remove_duplicate=False))
793
+ loaded_params: set[str] = set()
794
+ for name, loaded_weight in weights:
795
+ if "rotary_emb.inv_freq" in name:
796
+ continue
797
+ if "head.attention" in name or "head.layernorm" in name:
798
+ continue
799
+ if "head.mlp" in name or "head.probe" in name:
800
+ continue
801
+ if self.quant_config is not None and (
802
+ scale_name := self.quant_config.get_cache_scale(name)):
803
+ param = params_dict[scale_name]
804
+ weight_loader = getattr(
805
+ param,
806
+ "weight_loader",
807
+ default_weight_loader,
808
+ )
809
+ loaded_weight = (loaded_weight if loaded_weight.dim() == 0 else
810
+ loaded_weight[0])
811
+ weight_loader(param, loaded_weight)
812
+ loaded_params.add(scale_name)
813
+ continue
814
+ for (
815
+ param_name,
816
+ weight_name,
817
+ shard_id,
818
+ ) in stacked_params_mapping:
819
+ if weight_name not in name:
820
+ continue
821
+ name = name.replace(weight_name, param_name)
822
+ if name.endswith(".bias") and name not in params_dict:
823
+ continue
824
+ if is_pp_missing_parameter(name, self):
825
+ continue
826
+ param = params_dict[name]
827
+ weight_loader = param.weight_loader
828
+ weight_loader(param, loaded_weight, shard_id)
829
+ break
830
+ else:
831
+ if name.endswith(".bias") and name not in params_dict:
832
+ continue
833
+ name = maybe_remap_kv_scale_name(name, params_dict)
834
+ if name is None:
835
+ continue
836
+ if is_pp_missing_parameter(name, self):
837
+ continue
838
+ param = params_dict[name]
839
+ weight_loader = getattr(
840
+ param,
841
+ "weight_loader",
842
+ default_weight_loader,
843
+ )
844
+ weight_loader(param, loaded_weight)
845
+ loaded_params.add(name)
846
+ return loaded_params
847
+
848
+
849
+ class Projector(nn.Module):
850
+
851
+ def __init__(
852
+ self,
853
+ text_config: PretrainedConfig,
854
+ vision_config: PretrainedConfig,
855
+ quant_config: Optional[QuantizationConfig] = None,
856
+ prefix: str = "",
857
+ ):
858
+ super().__init__()
859
+ self.text_config = text_config
860
+ self.vision_config = vision_config
861
+ self.merge_kernel_size = (2, 2)
862
+
863
+ self.hidden_size = (self.vision_config.hidden_size *
864
+ self.merge_kernel_size[0] *
865
+ self.merge_kernel_size[1])
866
+
867
+ self.pre_norm = torch.nn.LayerNorm(self.vision_config.hidden_size,
868
+ eps=1e-05)
869
+ self.act = GELUActivation()
870
+
871
+ self.linear_1 = ColumnParallelLinear(
872
+ self.hidden_size,
873
+ self.hidden_size,
874
+ bias=True,
875
+ quant_config=quant_config,
876
+ prefix=f"{prefix}.linear_1",
877
+ )
878
+ self.linear_2 = RowParallelLinear(
879
+ self.hidden_size,
880
+ self.text_config.hidden_size,
881
+ bias=True,
882
+ quant_config=quant_config,
883
+ prefix=f"{prefix}.linear_2",
884
+ )
885
+
886
+ def forward(
887
+ self,
888
+ image_features: Union[torch.Tensor, list[torch.Tensor]],
889
+ image_grid_thw: list[tuple[int, int, int]],
890
+ ) -> Union[torch.Tensor, list[torch.Tensor]]:
891
+ m1, m2 = self.merge_kernel_size
892
+ if isinstance(image_features, (list, tuple)):
893
+ processed_features = list()
894
+ for image_feature, image_grid in zip(image_features,
895
+ image_grid_thw):
896
+ image_feature = self.pre_norm(image_feature)
897
+ t, h, w = image_grid
898
+
899
+ image_feature = rearrange(
900
+ image_feature,
901
+ "(t h p1 w p2) d -> (t h w) (p1 p2 d)",
902
+ t=t,
903
+ h=h // m1,
904
+ p1=m1,
905
+ w=w // m2,
906
+ p2=m2,
907
+ )
908
+ hidden_states, _ = self.linear_1(image_feature)
909
+ hidden_states = self.act(hidden_states)
910
+ hidden_states, _ = self.linear_2(hidden_states)
911
+ processed_features.append(hidden_states)
912
+
913
+ return processed_features
914
+
915
+ dims = image_features.shape[:-1]
916
+ dim = image_features.shape[-1]
917
+ image_features = image_features.view(np.prod(dims), dim)
918
+ hidden_states = self.pre_norm(image_features).view(
919
+ -1, self.hidden_size)
920
+ hidden_states = self.linear_1(hidden_states)
921
+ hidden_states = self.act(hidden_states)
922
+ hidden_states = self.linear_2(hidden_states)
923
+
924
+ return hidden_states.view(*dims, -1)
925
+
926
+
927
+ def _keye_field_config(hf_inputs: Mapping[str, torch.Tensor], ):
928
+ image_grid_thw = hf_inputs.get("image_grid_thw", torch.empty((0, 3)))
929
+ image_grid_sizes = image_grid_thw.prod(-1)
930
+
931
+ video_grid_thw = hf_inputs.get("video_grid_thw", torch.empty((0, 3)))
932
+ video_grid_sizes = video_grid_thw.prod(-1)
933
+
934
+ return dict(
935
+ pixel_values=MultiModalFieldConfig.flat_from_sizes(
936
+ "image", image_grid_sizes),
937
+ image_embeds=MultiModalFieldConfig.flat_from_sizes(
938
+ "image", image_grid_sizes),
939
+ image_grid_thw=MultiModalFieldConfig.batched("image"),
940
+ pixel_values_videos=MultiModalFieldConfig.flat_from_sizes(
941
+ "video", video_grid_sizes),
942
+ video_embeds=MultiModalFieldConfig.flat_from_sizes(
943
+ "video", video_grid_sizes),
944
+ video_grid_thw=MultiModalFieldConfig.batched("video"),
945
+ )
946
+
947
+
948
+ class KeyeMultiModalDataParser(MultiModalDataParser):
949
+
950
+ def _parse_image_data(
951
+ self,
952
+ data: Union[dict[str, torch.Tensor], ModalityData[ImageItem]],
953
+ ) -> ModalityDataItems[Any, Any]:
954
+ if isinstance(data, dict):
955
+ return DictEmbeddingItems(
956
+ data,
957
+ modality="image",
958
+ required_fields={
959
+ "image_embeds",
960
+ "image_grid_thw",
961
+ },
962
+ fields_factory=_keye_field_config,
963
+ )
964
+
965
+ return super()._parse_image_data(data)
966
+
967
+ def _parse_video_data(
968
+ self,
969
+ data: Union[dict[str, torch.Tensor], ModalityData[VideoItem]],
970
+ ) -> ModalityDataItems[Any, Any]:
971
+ if isinstance(data, dict):
972
+ return DictEmbeddingItems(
973
+ data,
974
+ modality="video",
975
+ required_fields={
976
+ "video_embeds",
977
+ "video_grid_thw",
978
+ },
979
+ fields_factory=_keye_field_config,
980
+ )
981
+
982
+ return super()._parse_video_data(data)
983
+
984
+
985
+ class KeyeProcessingInfo(BaseProcessingInfo):
986
+
987
+ def get_max_image_size(self) -> int:
988
+ return 9999999 #_MAX_IMAGE_SIZE
989
+
990
+ def get_max_frame_per_video(self) -> int:
991
+ return 16 #_MAX_FRAMES_PER_VIDEO
992
+
993
+ def get_image_processor(self, **kwargs: object):
994
+ return self.get_hf_processor(**kwargs).image_processor
995
+
996
+ def get_supported_mm_limits(self, ) -> Mapping[str, Optional[int]]:
997
+ return {"image": None, "video": None}
998
+
999
+ def get_mm_max_tokens_per_item(
1000
+ self,
1001
+ seq_len: int,
1002
+ mm_counts: Mapping[str, int],
1003
+ ) -> Mapping[str, int]:
1004
+ return {
1005
+ "image": self.get_max_image_tokens(),
1006
+ "video": self.get_max_video_tokens(seq_len),
1007
+ }
1008
+
1009
+ def _get_vision_info(
1010
+ self,
1011
+ *,
1012
+ image_width: int,
1013
+ image_height: int,
1014
+ num_frames: int = 1,
1015
+ do_resize: bool = True,
1016
+ image_processor,
1017
+ ) -> tuple[ImageSize, int]:
1018
+ if image_processor is None:
1019
+ image_processor = self.get_image_processor()
1020
+
1021
+ hf_config = self.get_hf_config()
1022
+ vision_config = hf_config.vision_config
1023
+ patch_size = vision_config.patch_size
1024
+ merge_size = vision_config.spatial_merge_size
1025
+ temporal_patch_size = 1
1026
+
1027
+ if do_resize:
1028
+ resized_height, resized_width = smart_resize(
1029
+ height=image_height,
1030
+ width=image_width,
1031
+ factor=patch_size * merge_size,
1032
+ min_pixels=image_processor.min_pixels,
1033
+ max_pixels=image_processor.max_pixels,
1034
+ )
1035
+ preprocessed_size = ImageSize(width=resized_width,
1036
+ height=resized_height)
1037
+ else:
1038
+ preprocessed_size = ImageSize(width=image_width,
1039
+ height=image_height)
1040
+
1041
+ padded_num_frames = num_frames + num_frames % temporal_patch_size
1042
+
1043
+ grid_t = max(padded_num_frames // temporal_patch_size, 1)
1044
+ grid_h = preprocessed_size.height // patch_size
1045
+ grid_w = preprocessed_size.width // patch_size
1046
+
1047
+ num_patches = grid_t * grid_h * grid_w
1048
+ num_vision_tokens = num_patches // (merge_size**2)
1049
+
1050
+ return preprocessed_size, num_vision_tokens
1051
+
1052
+ def get_num_image_tokens(
1053
+ self,
1054
+ *,
1055
+ image_width: int,
1056
+ image_height: int,
1057
+ image_processor,
1058
+ ) -> int:
1059
+ _, num_image_tokens = self._get_vision_info(
1060
+ image_width=image_width,
1061
+ image_height=image_height,
1062
+ image_processor=image_processor,
1063
+ )
1064
+ return num_image_tokens
1065
+
1066
+ def get_num_video_tokens(
1067
+ self,
1068
+ *,
1069
+ image_width: int,
1070
+ image_height: int,
1071
+ num_frames: int,
1072
+ image_processor,
1073
+ ) -> int:
1074
+ _, num_video_tokens = self._get_vision_info(
1075
+ image_width=image_width,
1076
+ image_height=image_height,
1077
+ num_frames=num_frames,
1078
+ image_processor=image_processor,
1079
+ )
1080
+ return num_video_tokens
1081
+
1082
+ def get_image_size_with_most_features(self, ) -> ImageSize:
1083
+ max_image_size, _ = self._get_vision_info(
1084
+ image_width=self.get_max_image_size(),
1085
+ image_height=self.get_max_image_size(),
1086
+ image_processor=None,
1087
+ )
1088
+ return max_image_size
1089
+
1090
+ def get_max_image_tokens(self) -> int:
1091
+ target_width, target_height = self.get_image_size_with_most_features()
1092
+
1093
+ return self.get_num_image_tokens(
1094
+ image_width=target_width,
1095
+ image_height=target_height,
1096
+ image_processor=None,
1097
+ )
1098
+
1099
+ def _get_max_video_frames(self, max_tokens: int) -> int:
1100
+ target_width, target_height = self.get_image_size_with_most_features()
1101
+
1102
+ num_frames = 0
1103
+
1104
+ while True:
1105
+ next_num_frames = num_frames + 1
1106
+ next_max_tokens = self.get_num_video_tokens(
1107
+ image_width=target_width,
1108
+ image_height=target_height,
1109
+ num_frames=next_num_frames,
1110
+ image_processor=None,
1111
+ )
1112
+
1113
+ if next_max_tokens > max_tokens:
1114
+ break
1115
+
1116
+ num_frames = next_num_frames
1117
+
1118
+ return num_frames
1119
+
1120
+ def get_num_frames_with_most_features(self, seq_len: int) -> int:
1121
+ mm_config = self.ctx.get_mm_config()
1122
+ max_images = mm_config.get_limit_per_prompt("image")
1123
+ max_videos = mm_config.get_limit_per_prompt("video")
1124
+
1125
+ max_image_tokens = self.get_max_image_tokens() * max_images
1126
+ max_total_frames = self._get_max_video_frames(seq_len -
1127
+ max_image_tokens)
1128
+ max_frames_per_video = min(
1129
+ max_total_frames // max(max_videos, 1),
1130
+ self.get_max_frame_per_video(),
1131
+ )
1132
+
1133
+ return max(max_frames_per_video, 1)
1134
+
1135
+ def get_max_video_tokens(self, seq_len: int) -> int:
1136
+ target_width, target_height = self.get_image_size_with_most_features()
1137
+
1138
+ return self.get_num_video_tokens(
1139
+ image_width=target_width,
1140
+ image_height=target_height,
1141
+ num_frames=self.get_num_frames_with_most_features(seq_len),
1142
+ image_processor=None,
1143
+ )
1144
+
1145
+
1146
+ _I = TypeVar("_I", bound=KeyeProcessingInfo)
1147
+
1148
+
1149
+ class KeyeBaseDummyInputsBuilder(BaseDummyInputsBuilder[_I]):
1150
+
1151
+ def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str:
1152
+ num_images = mm_counts.get("image", 0)
1153
+ num_videos = mm_counts.get("video", 0)
1154
+
1155
+ hf_processor = self.info.get_hf_processor()
1156
+ image_token: str = hf_processor.image_token
1157
+ video_token: str = hf_processor.video_token
1158
+
1159
+ return image_token * num_images + video_token * num_videos
1160
+
1161
+ def get_dummy_mm_data(
1162
+ self,
1163
+ seq_len: int,
1164
+ mm_counts: Mapping[str, int],
1165
+ ) -> MultiModalDataDict:
1166
+ num_images = mm_counts.get("image", 0)
1167
+ num_videos = mm_counts.get("video", 0)
1168
+
1169
+ target_width, target_height = (
1170
+ self.info.get_image_size_with_most_features())
1171
+ target_num_frames = self.info.get_num_frames_with_most_features(
1172
+ seq_len)
1173
+
1174
+ mm_data = {
1175
+ "image":
1176
+ self._get_dummy_images(
1177
+ width=target_width,
1178
+ height=target_height,
1179
+ num_images=num_images,
1180
+ ),
1181
+ "video":
1182
+ self._get_dummy_videos(
1183
+ width=target_width,
1184
+ height=target_height,
1185
+ num_frames=target_num_frames,
1186
+ num_videos=num_videos,
1187
+ ),
1188
+ }
1189
+
1190
+ return mm_data
1191
+
1192
+
1193
+ class KeyeDummyInputsBuilder(KeyeBaseDummyInputsBuilder[KeyeProcessingInfo]):
1194
+ ...
1195
+
1196
+
1197
+ class KeyeMultiModalProcessor(BaseMultiModalProcessor[KeyeProcessingInfo]):
1198
+
1199
+ def _get_data_parser(self) -> MultiModalDataParser:
1200
+ return KeyeMultiModalDataParser()
1201
+
1202
+ def _get_prompt_updates(
1203
+ self,
1204
+ mm_items: MultiModalDataItems,
1205
+ hf_processor_mm_kwargs: Mapping[str, Any],
1206
+ out_mm_kwargs: MultiModalKwargsItems,
1207
+ ) -> Sequence[PromptUpdate]:
1208
+ hf_processor = self.info.get_hf_processor(**hf_processor_mm_kwargs)
1209
+ image_processor = self.info.get_image_processor(
1210
+ **hf_processor_mm_kwargs)
1211
+ tokenizer = self.info.get_tokenizer()
1212
+ vocab = tokenizer.get_vocab()
1213
+
1214
+ placeholder = {
1215
+ "image": vocab[hf_processor.image_token],
1216
+ "video": vocab[hf_processor.video_token],
1217
+ }
1218
+
1219
+ merge_length = image_processor.merge_size**2
1220
+
1221
+ def get_replacement_keye(item_idx: int, modality: str):
1222
+ out_item = out_mm_kwargs[modality][item_idx]
1223
+ grid_thw = out_item[f"{modality}_grid_thw"].data
1224
+ assert isinstance(grid_thw, torch.Tensor)
1225
+
1226
+ num_tokens = int(grid_thw.prod()) // merge_length
1227
+ return [placeholder[modality]] * num_tokens
1228
+
1229
+ return [
1230
+ PromptReplacement(
1231
+ modality=modality,
1232
+ target=[placeholder[modality]],
1233
+ replacement=partial(get_replacement_keye, modality=modality),
1234
+ ) for modality in ("image", "video")
1235
+ ]
1236
+
1237
+ def _get_mm_fields_config(
1238
+ self,
1239
+ hf_inputs: BatchFeature,
1240
+ hf_processor_mm_kwargs: Mapping[str, object],
1241
+ ) -> Mapping[str, MultiModalFieldConfig]:
1242
+ return _keye_field_config(hf_inputs)
1243
+
1244
+
1245
+ class BaseKeyeModule(nn.Module):
1246
+ packed_modules_mapping = {
1247
+ "qkv_proj": [
1248
+ "q_proj",
1249
+ "k_proj",
1250
+ "v_proj",
1251
+ ],
1252
+ "gate_up_proj": [
1253
+ "gate_proj",
1254
+ "up_proj",
1255
+ ],
1256
+ }
1257
+
1258
+ hf_to_vllm_mapper = WeightsMapper(orig_to_new_prefix={
1259
+ "lm_head.": "language_model.lm_head.",
1260
+ "model.": "language_model.model.",
1261
+ })
1262
+
1263
+ @classmethod
1264
+ def get_placeholder_str(cls, modality: str, i: int) -> Optional[str]:
1265
+ if modality.startswith("image"):
1266
+ return "<|vision_start|><|image_pad|><|vision_end|>"
1267
+ if modality.startswith("video"):
1268
+ return "<|vision_start|><|video_pad|><|vision_end|>"
1269
+
1270
+ raise ValueError("Only image or video modality is supported")
1271
+
1272
+ def _maybe_ignore_quant_config(self, quant_config: QuantizationConfig):
1273
+ if isinstance(quant_config, (GPTQConfig, GPTQMarlinConfig)):
1274
+ return None
1275
+ return quant_config
1276
+
1277
+ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
1278
+ super().__init__()
1279
+ config: PretrainedConfig = vllm_config.model_config.hf_config
1280
+ quant_config = vllm_config.quant_config
1281
+ multimodal_config = vllm_config.model_config.multimodal_config
1282
+
1283
+ self.config = config
1284
+ self.multimodal_config = multimodal_config
1285
+
1286
+ self.visual = KeyeSiglipVisionModel(
1287
+ config.vision_config,
1288
+ quant_config=self._maybe_ignore_quant_config(quant_config),
1289
+ prefix=maybe_prefix(prefix, "visual"),
1290
+ )
1291
+
1292
+ self.mlp_AR = self._build_projector(
1293
+ config,
1294
+ config.vision_config,
1295
+ quant_config=self._maybe_ignore_quant_config(quant_config),
1296
+ prefix=maybe_prefix(prefix, "mlp_AR"),
1297
+ )
1298
+
1299
+ self.language_model = init_vllm_registered_model(
1300
+ vllm_config=vllm_config,
1301
+ prefix=maybe_prefix(prefix, "language_model"),
1302
+ architectures=["Qwen3ForCausalLM"],
1303
+ )
1304
+
1305
+ self.make_empty_intermediate_tensors = (
1306
+ self.language_model.make_empty_intermediate_tensors)
1307
+
1308
+ @abstractmethod
1309
+ def _build_projector(self,
1310
+ text_config: PretrainedConfig,
1311
+ vision_config: PretrainedConfig,
1312
+ quant_config: Optional[QuantizationConfig] = None,
1313
+ prefix: str = "") -> nn.Module:
1314
+ raise ValueError("Need projector")
1315
+
1316
+ def _process_image_input(self,
1317
+ image_input: Any) -> tuple[torch.Tensor, ...]:
1318
+ siglip_position_ids = list()
1319
+ image_grid_hws = list()
1320
+ sample_indices = list()
1321
+ cu_seqlens = [0]
1322
+
1323
+ image_grid_thw = image_input["image_grid_thw"]
1324
+ assert image_grid_thw.ndim == 2
1325
+
1326
+ for idx, thaw in enumerate(image_grid_thw):
1327
+ thw_tuple = tuple(thaw.detach().cpu().numpy().tolist())
1328
+ numel = np.prod(thw_tuple)
1329
+ image_grid_hws.append(thw_tuple)
1330
+ image_position_ids = torch.arange(numel) % np.prod(thw_tuple[1:])
1331
+ siglip_position_ids.append(image_position_ids)
1332
+ sample_indices.append(torch.full((numel, ), idx,
1333
+ dtype=torch.int64))
1334
+ cu_seqlens.append(cu_seqlens[-1] + numel)
1335
+
1336
+ if image_input["type"] == "image_embeds":
1337
+ raise ValueError(
1338
+ "Image embeddings are not supported for this processing path.")
1339
+ else:
1340
+ pixel_values = image_input["pixel_values"].type(self.visual.dtype)
1341
+ siglip_position_ids = torch.concat(siglip_position_ids,
1342
+ dim=0).to(pixel_values.device)
1343
+ cu_seqlens = torch.tensor(cu_seqlens, dtype=torch.int32).to(
1344
+ pixel_values.device)
1345
+ sample_indices = torch.concat(sample_indices,
1346
+ dim=0).to(pixel_values.device)
1347
+
1348
+ image_embeds = self.visual(
1349
+ pixel_values=pixel_values,
1350
+ image_grid_thw=image_grid_hws,
1351
+ position_ids=siglip_position_ids,
1352
+ vision_return_embed_list=False,
1353
+ interpolate_pos_encoding=True,
1354
+ sample_indices=sample_indices,
1355
+ cu_seqlens=cu_seqlens,
1356
+ use_rope=True,
1357
+ window_size=-1,
1358
+ )
1359
+ image_embeds = tuple(self.mlp_AR(image_embeds, image_grid_thw))
1360
+ return image_embeds
1361
+
1362
+ def _process_video_embeds(
1363
+ self,
1364
+ video_type: Literal["video_embeds", "pixel_values_videos"],
1365
+ video_grid_thw: list[torch.Tensor],
1366
+ pixel_values_videos: Optional[torch.Tensor] = None
1367
+ ) -> Union[torch.Tensor, list[torch.Tensor]]:
1368
+ siglip_position_ids = list()
1369
+ video_grid_hws = list()
1370
+ sample_indices = list()
1371
+ cu_seqlens = [0]
1372
+
1373
+ assert video_grid_thw.ndim == 2
1374
+ for idx, sub_thw in enumerate(video_grid_thw):
1375
+ thw_tuple = tuple(sub_thw.detach().cpu().numpy().tolist())
1376
+ numel = np.prod(thw_tuple)
1377
+
1378
+ video_grid_hws.append(thw_tuple)
1379
+ video_position_ids = torch.arange(numel) % np.prod(thw_tuple[1:])
1380
+ siglip_position_ids.append(video_position_ids)
1381
+ sample_indices.append(torch.full((numel, ), idx,
1382
+ dtype=torch.int64))
1383
+ cu_seqlens.append(cu_seqlens[-1] + numel)
1384
+
1385
+ if video_type == "video_embeds":
1386
+ raise ValueError(
1387
+ "Video embeddings are not supported for this processing path.")
1388
+ else:
1389
+ pixel_values_videos = pixel_values_videos.type(self.visual.dtype)
1390
+ siglip_position_ids = torch.concat(siglip_position_ids, dim=0).to(
1391
+ pixel_values_videos.device)
1392
+ cu_seqlens = torch.tensor(cu_seqlens, dtype=torch.int32).to(
1393
+ pixel_values_videos.device)
1394
+ sample_indices = torch.concat(sample_indices,
1395
+ dim=0).to(pixel_values_videos.device)
1396
+
1397
+ video_embeds = self.visual(
1398
+ pixel_values=pixel_values_videos,
1399
+ image_grid_thw=video_grid_hws,
1400
+ position_ids=siglip_position_ids,
1401
+ vision_return_embed_list=True,
1402
+ interpolate_pos_encoding=True,
1403
+ sample_indices=sample_indices,
1404
+ cu_seqlens=cu_seqlens,
1405
+ use_rope=True,
1406
+ window_size=-1,
1407
+ )
1408
+ video_embeds = self.mlp_AR(video_embeds, video_grid_thw)
1409
+ return video_embeds
1410
+
1411
+ def _parse_and_validate_multimodal_inputs(self, **kwargs: object) -> dict:
1412
+ modalities = {}
1413
+
1414
+ for input_key in kwargs:
1415
+ if (input_key in ("pixel_values", "image_embeds")
1416
+ and "images" not in modalities):
1417
+ modalities["images"] = self._parse_and_validate_image_input(
1418
+ **kwargs)
1419
+ if (input_key in ("pixel_values_videos", "video_embeds")
1420
+ and "videos" not in modalities):
1421
+ modalities["videos"] = self._parse_and_validate_video_input(
1422
+ **kwargs)
1423
+
1424
+ return modalities
1425
+
1426
+ def get_language_model(self) -> torch.nn.Module:
1427
+ return self.language_model
1428
+
1429
+ def get_multimodal_embeddings(
1430
+ self, **kwargs: object) -> Optional[MultiModalEmbeddings]:
1431
+
1432
+ modalities = self._parse_and_validate_multimodal_inputs(**kwargs)
1433
+ if not modalities:
1434
+ return None
1435
+
1436
+ multimodal_embeddings: tuple[torch.Tensor, ...] = ()
1437
+
1438
+ for modality in modalities:
1439
+ if modality == "images":
1440
+ image_input = modalities["images"]
1441
+ vision_embeddings = self._process_image_input(image_input)
1442
+ multimodal_embeddings += vision_embeddings
1443
+ if modality == "videos":
1444
+ video_input = modalities["videos"]
1445
+ video_embeddings = self._process_video_input(video_input)
1446
+ multimodal_embeddings += video_embeddings
1447
+ return multimodal_embeddings
1448
+
1449
+ def get_input_embeddings(
1450
+ self,
1451
+ input_ids: torch.Tensor,
1452
+ multimodal_embeddings: Optional[MultiModalEmbeddings] = None,
1453
+ ) -> torch.Tensor:
1454
+ inputs_embeds = self.language_model.get_input_embeddings(input_ids)
1455
+ if multimodal_embeddings is not None:
1456
+ inputs_embeds = merge_multimodal_embeddings(
1457
+ input_ids,
1458
+ inputs_embeds,
1459
+ multimodal_embeddings,
1460
+ [
1461
+ self.config.image_token_id,
1462
+ self.config.video_token_id,
1463
+ ],
1464
+ )
1465
+ return inputs_embeds
1466
+
1467
+ def get_input_embeddings_v0(
1468
+ self,
1469
+ input_ids: torch.Tensor,
1470
+ image_input: Optional[Any] = None,
1471
+ video_input: Optional[Any] = None,
1472
+ ) -> torch.Tensor:
1473
+ inputs_embeds = self.get_input_embeddings(input_ids)
1474
+ if image_input is not None:
1475
+ image_embeds = self._process_image_input(image_input)
1476
+ inputs_embeds = merge_multimodal_embeddings(
1477
+ input_ids,
1478
+ inputs_embeds,
1479
+ image_embeds,
1480
+ placeholder_token_id=self.config.image_token_id,
1481
+ )
1482
+
1483
+ if video_input is not None:
1484
+ video_embeds = self._process_video_input(video_input)
1485
+ inputs_embeds = merge_multimodal_embeddings(
1486
+ input_ids,
1487
+ inputs_embeds,
1488
+ video_embeds,
1489
+ placeholder_token_id=self.config.video_token_id,
1490
+ )
1491
+ return inputs_embeds
1492
+
1493
+ def forward(
1494
+ self,
1495
+ input_ids: torch.Tensor,
1496
+ positions: torch.Tensor,
1497
+ intermediate_tensors: Optional[IntermediateTensors] = None,
1498
+ inputs_embeds: Optional[torch.Tensor] = None,
1499
+ **kwargs: object,
1500
+ ) -> Union[torch.Tensor, IntermediateTensors]:
1501
+ """Run forward pass for Keye-VL.
1502
+
1503
+ Args:
1504
+ input_ids: Flattened (concatenated) input_ids corresponding to a
1505
+ batch.
1506
+ positions: Flattened (concatenated) position ids corresponding to a
1507
+ batch.
1508
+ **NOTE**: If mrope is enabled (default setting for Qwen2-VL
1509
+ opensource models), the shape will be `(3, seq_len)`,
1510
+ otherwise it will be `(seq_len,).
1511
+ pixel_values: Pixel values to be fed to a model.
1512
+ `None` if no images are passed.
1513
+ image_grid_thw: Tensor `(n_images, 3)` of image 3D grid in LLM.
1514
+ `None` if no images are passed.
1515
+ pixel_values_videos: Pixel values of videos to be fed to a model.
1516
+ `None` if no videos are passed.
1517
+ video_grid_thw: Tensor `(n_videos, 3)` of video 3D grid in LLM.
1518
+ `None` if no videos are passed.
1519
+ """
1520
+ if intermediate_tensors is not None:
1521
+ inputs_embeds = None
1522
+
1523
+ elif inputs_embeds is None:
1524
+ image_input = self._parse_and_validate_image_input(**kwargs)
1525
+ video_input = self._parse_and_validate_video_input(**kwargs)
1526
+ if image_input is None and video_input is None:
1527
+ inputs_embeds = None
1528
+ else:
1529
+ if uses_mrope(self.config):
1530
+ assert positions.ndim == 2 and positions.size(0) == 3, (
1531
+ "multimodal section rotary embedding requires "
1532
+ f"(3, seq_len) positions, but got {positions.size()}")
1533
+ inputs_embeds = self.get_input_embeddings_v0(
1534
+ input_ids,
1535
+ image_input=image_input,
1536
+ video_input=video_input,
1537
+ )
1538
+ input_ids = None
1539
+
1540
+ hidden_states = self.language_model.model(
1541
+ input_ids=input_ids,
1542
+ positions=positions,
1543
+ intermediate_tensors=intermediate_tensors,
1544
+ inputs_embeds=inputs_embeds,
1545
+ )
1546
+
1547
+ return hidden_states
1548
+
1549
+ def compute_logits(
1550
+ self,
1551
+ hidden_states: torch.Tensor,
1552
+ sampling_metadata: SamplingMetadata,
1553
+ ) -> Optional[torch.Tensor]:
1554
+ return self.language_model.compute_logits(hidden_states,
1555
+ sampling_metadata)
1556
+
1557
+ def load_weights(self, weights: Iterable[tuple[str,
1558
+ torch.Tensor]]) -> set[str]:
1559
+ loader = AutoWeightsLoader(self)
1560
+ return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
1561
+
1562
+ def get_mm_mapping(self) -> MultiModelKeys:
1563
+ """Get the module prefix in multimodal models."""
1564
+ return MultiModelKeys.from_string_field(
1565
+ language_model="language_model",
1566
+ connector="mlp_AR.",
1567
+ tower_model="visual.",
1568
+ )
1569
+
1570
+
1571
+ @MULTIMODAL_REGISTRY.register_processor(
1572
+ KeyeMultiModalProcessor,
1573
+ info=KeyeProcessingInfo,
1574
+ dummy_inputs=KeyeDummyInputsBuilder,
1575
+ )
1576
+ class KeyeForConditionalGeneration(BaseKeyeModule, SupportsMultiModal,
1577
+ SupportsLoRA, SupportsPP):
1578
+
1579
+ def _build_projector(self,
1580
+ text_config: PretrainedConfig,
1581
+ vision_config: PretrainedConfig,
1582
+ quant_config: Optional[QuantizationConfig] = None,
1583
+ prefix: str = "") -> nn.Module:
1584
+ return Projector(text_config, vision_config, quant_config, prefix)
1585
+
1586
+ def _validate_and_reshape_mm_tensor(
1587
+ self, mm_input: NestedTensors,
1588
+ name: str) -> Union[torch.Tensor, list[torch.Tensor]]:
1589
+ if not isinstance(mm_input, (torch.Tensor, list)):
1590
+ raise ValueError(f"Incorrect type of {name}. "
1591
+ f"Got type: {type(mm_input)}")
1592
+ if isinstance(mm_input, torch.Tensor):
1593
+ if mm_input.ndim == 2:
1594
+ return mm_input
1595
+ if mm_input.ndim == 5:
1596
+ return mm_input
1597
+ if mm_input.ndim != 3:
1598
+ raise ValueError(f"{name} should be 2D or batched 3D tensor. "
1599
+ f"Got ndim: {mm_input.ndim} "
1600
+ f"(shape={mm_input.shape})")
1601
+ return torch.concat(list(mm_input))
1602
+ elif is_list_of(mm_input, torch.Tensor):
1603
+ if all(p.dim() == 4 for p in mm_input) or all(p.dim() == 2
1604
+ for p in mm_input):
1605
+ return mm_input
1606
+ return torch.concat(list(mm_input))
1607
+
1608
+ def _parse_and_validate_image_input(
1609
+ self, **kwargs: object) -> Optional[KeyeImageInputs]:
1610
+ pixel_values = kwargs.pop("pixel_values", None)
1611
+ image_embeds = kwargs.pop("image_embeds", None)
1612
+ image_grid_thw = kwargs.pop("image_grid_thw", None)
1613
+
1614
+ if pixel_values is None and image_embeds is None:
1615
+ return None
1616
+
1617
+ if pixel_values is not None:
1618
+ pixel_values = self._validate_and_reshape_mm_tensor(
1619
+ pixel_values, "image pixel values")
1620
+ image_grid_thw = self._validate_and_reshape_mm_tensor(
1621
+ image_grid_thw, "image grid_thw")
1622
+
1623
+ return KeyeImagePixelInputs(
1624
+ type="pixel_values",
1625
+ pixel_values=pixel_values,
1626
+ image_grid_thw=image_grid_thw,
1627
+ )
1628
+
1629
+ if image_embeds is not None:
1630
+ image_embeds = self._validate_and_reshape_mm_tensor(
1631
+ image_embeds, "image embeds")
1632
+ image_grid_thw = self._validate_and_reshape_mm_tensor(
1633
+ image_grid_thw, "image grid_thw")
1634
+
1635
+ return KeyeImageEmbeddingInputs(
1636
+ type="image_embeds",
1637
+ image_embeds=image_embeds,
1638
+ image_grid_thw=image_grid_thw,
1639
+ )
1640
+
1641
+ def _parse_and_validate_video_input(
1642
+ self, **kwargs: object) -> Optional[KeyeVideoInputs]:
1643
+ pixel_values_videos = kwargs.pop("pixel_values_videos", None)
1644
+ video_embeds = kwargs.pop("video_embeds", None)
1645
+ video_grid_thw = kwargs.pop("video_grid_thw", None)
1646
+
1647
+ if pixel_values_videos is None and video_embeds is None:
1648
+ return None
1649
+
1650
+ if pixel_values_videos is not None:
1651
+ pixel_values_videos = self._validate_and_reshape_mm_tensor(
1652
+ pixel_values_videos,
1653
+ "video pixel values",
1654
+ )
1655
+ video_grid_thw = self._validate_and_reshape_mm_tensor(
1656
+ video_grid_thw, "video grid_thw")
1657
+
1658
+ return KeyeVideoPixelInputs(
1659
+ type="pixel_values_videos",
1660
+ pixel_values_videos=pixel_values_videos,
1661
+ video_grid_thw=video_grid_thw,
1662
+ )
1663
+
1664
+ if video_embeds is not None:
1665
+ video_embeds = self._validate_and_reshape_mm_tensor(
1666
+ video_embeds, "video embeds")
1667
+ video_grid_thw = self._validate_and_reshape_mm_tensor(
1668
+ video_grid_thw, "video grid_thw")
1669
+
1670
+ return KeyeVideoEmbeddingInputs(
1671
+ type="video_embeds",
1672
+ video_embeds=video_embeds,
1673
+ video_grid_thw=video_grid_thw,
1674
+ )
1675
+
1676
+ def _process_video_input(
1677
+ self, video_input: KeyeVideoInputs) -> tuple[torch.Tensor, ...]:
1678
+ video_type = video_input["type"]
1679
+ video_grid_thw = video_input["video_grid_thw"]
1680
+ pixel_values_videos = video_input.get("pixel_values_videos", None)
1681
+
1682
+ return tuple(
1683
+ self._process_video_embeds(video_type, video_grid_thw,
1684
+ pixel_values_videos))