vllm-cpu-avx512bf16 0.14.0__cp313-cp313-manylinux_2_28_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.
Files changed (1712) hide show
  1. vllm/_C.abi3.so +0 -0
  2. vllm/__init__.py +225 -0
  3. vllm/_aiter_ops.py +1511 -0
  4. vllm/_bc_linter.py +54 -0
  5. vllm/_custom_ops.py +3206 -0
  6. vllm/_ipex_ops.py +445 -0
  7. vllm/_version.py +34 -0
  8. vllm/assets/__init__.py +0 -0
  9. vllm/assets/audio.py +43 -0
  10. vllm/assets/base.py +40 -0
  11. vllm/assets/image.py +62 -0
  12. vllm/assets/video.py +149 -0
  13. vllm/attention/__init__.py +0 -0
  14. vllm/attention/layer.py +913 -0
  15. vllm/attention/utils/__init__.py +0 -0
  16. vllm/attention/utils/kv_sharing_utils.py +33 -0
  17. vllm/attention/utils/kv_transfer_utils.py +60 -0
  18. vllm/beam_search.py +88 -0
  19. vllm/benchmarks/__init__.py +0 -0
  20. vllm/benchmarks/datasets.py +3277 -0
  21. vllm/benchmarks/latency.py +172 -0
  22. vllm/benchmarks/lib/__init__.py +3 -0
  23. vllm/benchmarks/lib/endpoint_request_func.py +777 -0
  24. vllm/benchmarks/lib/ready_checker.py +72 -0
  25. vllm/benchmarks/lib/utils.py +79 -0
  26. vllm/benchmarks/mm_processor.py +363 -0
  27. vllm/benchmarks/serve.py +1761 -0
  28. vllm/benchmarks/startup.py +321 -0
  29. vllm/benchmarks/sweep/__init__.py +0 -0
  30. vllm/benchmarks/sweep/cli.py +41 -0
  31. vllm/benchmarks/sweep/param_sweep.py +159 -0
  32. vllm/benchmarks/sweep/plot.py +675 -0
  33. vllm/benchmarks/sweep/plot_pareto.py +393 -0
  34. vllm/benchmarks/sweep/serve.py +450 -0
  35. vllm/benchmarks/sweep/serve_sla.py +459 -0
  36. vllm/benchmarks/sweep/server.py +114 -0
  37. vllm/benchmarks/sweep/sla_sweep.py +138 -0
  38. vllm/benchmarks/sweep/utils.py +4 -0
  39. vllm/benchmarks/throughput.py +946 -0
  40. vllm/collect_env.py +857 -0
  41. vllm/compilation/__init__.py +0 -0
  42. vllm/compilation/activation_quant_fusion.py +214 -0
  43. vllm/compilation/backends.py +840 -0
  44. vllm/compilation/base_static_graph.py +57 -0
  45. vllm/compilation/caching.py +196 -0
  46. vllm/compilation/collective_fusion.py +1224 -0
  47. vllm/compilation/compiler_interface.py +639 -0
  48. vllm/compilation/counter.py +50 -0
  49. vllm/compilation/cuda_graph.py +309 -0
  50. vllm/compilation/decorators.py +662 -0
  51. vllm/compilation/fix_functionalization.py +266 -0
  52. vllm/compilation/fusion.py +570 -0
  53. vllm/compilation/fusion_attn.py +363 -0
  54. vllm/compilation/fx_utils.py +92 -0
  55. vllm/compilation/inductor_pass.py +145 -0
  56. vllm/compilation/matcher_utils.py +454 -0
  57. vllm/compilation/monitor.py +62 -0
  58. vllm/compilation/noop_elimination.py +130 -0
  59. vllm/compilation/partition_rules.py +75 -0
  60. vllm/compilation/pass_manager.py +164 -0
  61. vllm/compilation/piecewise_backend.py +191 -0
  62. vllm/compilation/post_cleanup.py +21 -0
  63. vllm/compilation/qk_norm_rope_fusion.py +244 -0
  64. vllm/compilation/rocm_aiter_fusion.py +401 -0
  65. vllm/compilation/sequence_parallelism.py +368 -0
  66. vllm/compilation/torch25_custom_graph_pass.py +44 -0
  67. vllm/compilation/vllm_inductor_pass.py +180 -0
  68. vllm/compilation/wrapper.py +329 -0
  69. vllm/config/__init__.py +112 -0
  70. vllm/config/attention.py +114 -0
  71. vllm/config/cache.py +233 -0
  72. vllm/config/compilation.py +1149 -0
  73. vllm/config/device.py +75 -0
  74. vllm/config/ec_transfer.py +110 -0
  75. vllm/config/kv_events.py +56 -0
  76. vllm/config/kv_transfer.py +119 -0
  77. vllm/config/load.py +124 -0
  78. vllm/config/lora.py +102 -0
  79. vllm/config/model.py +2026 -0
  80. vllm/config/model_arch.py +57 -0
  81. vllm/config/multimodal.py +247 -0
  82. vllm/config/observability.py +157 -0
  83. vllm/config/parallel.py +703 -0
  84. vllm/config/pooler.py +188 -0
  85. vllm/config/profiler.py +199 -0
  86. vllm/config/scheduler.py +298 -0
  87. vllm/config/speculative.py +656 -0
  88. vllm/config/speech_to_text.py +39 -0
  89. vllm/config/structured_outputs.py +78 -0
  90. vllm/config/utils.py +374 -0
  91. vllm/config/vllm.py +1487 -0
  92. vllm/connections.py +189 -0
  93. vllm/device_allocator/__init__.py +0 -0
  94. vllm/device_allocator/cumem.py +301 -0
  95. vllm/distributed/__init__.py +6 -0
  96. vllm/distributed/communication_op.py +43 -0
  97. vllm/distributed/device_communicators/__init__.py +0 -0
  98. vllm/distributed/device_communicators/all2all.py +509 -0
  99. vllm/distributed/device_communicators/all_reduce_utils.py +344 -0
  100. vllm/distributed/device_communicators/base_device_communicator.py +303 -0
  101. vllm/distributed/device_communicators/cpu_communicator.py +209 -0
  102. vllm/distributed/device_communicators/cuda_communicator.py +346 -0
  103. vllm/distributed/device_communicators/cuda_wrapper.py +190 -0
  104. vllm/distributed/device_communicators/custom_all_reduce.py +326 -0
  105. vllm/distributed/device_communicators/mnnvl_compat.py +27 -0
  106. vllm/distributed/device_communicators/pynccl.py +386 -0
  107. vllm/distributed/device_communicators/pynccl_allocator.py +191 -0
  108. vllm/distributed/device_communicators/pynccl_wrapper.py +567 -0
  109. vllm/distributed/device_communicators/quick_all_reduce.py +290 -0
  110. vllm/distributed/device_communicators/ray_communicator.py +259 -0
  111. vllm/distributed/device_communicators/shm_broadcast.py +778 -0
  112. vllm/distributed/device_communicators/shm_object_storage.py +697 -0
  113. vllm/distributed/device_communicators/symm_mem.py +156 -0
  114. vllm/distributed/device_communicators/xpu_communicator.py +98 -0
  115. vllm/distributed/ec_transfer/__init__.py +14 -0
  116. vllm/distributed/ec_transfer/ec_connector/__init__.py +0 -0
  117. vllm/distributed/ec_transfer/ec_connector/base.py +247 -0
  118. vllm/distributed/ec_transfer/ec_connector/example_connector.py +201 -0
  119. vllm/distributed/ec_transfer/ec_connector/factory.py +85 -0
  120. vllm/distributed/ec_transfer/ec_transfer_state.py +42 -0
  121. vllm/distributed/eplb/__init__.py +3 -0
  122. vllm/distributed/eplb/async_worker.py +115 -0
  123. vllm/distributed/eplb/eplb_state.py +1192 -0
  124. vllm/distributed/eplb/policy/__init__.py +19 -0
  125. vllm/distributed/eplb/policy/abstract.py +43 -0
  126. vllm/distributed/eplb/policy/default.py +376 -0
  127. vllm/distributed/eplb/rebalance_execute.py +699 -0
  128. vllm/distributed/kv_events.py +505 -0
  129. vllm/distributed/kv_transfer/README.md +29 -0
  130. vllm/distributed/kv_transfer/__init__.py +20 -0
  131. vllm/distributed/kv_transfer/disagg_prefill_workflow.jpg +0 -0
  132. vllm/distributed/kv_transfer/kv_connector/__init__.py +0 -0
  133. vllm/distributed/kv_transfer/kv_connector/base.py +10 -0
  134. vllm/distributed/kv_transfer/kv_connector/factory.py +203 -0
  135. vllm/distributed/kv_transfer/kv_connector/utils.py +459 -0
  136. vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +19 -0
  137. vllm/distributed/kv_transfer/kv_connector/v1/base.py +607 -0
  138. vllm/distributed/kv_transfer/kv_connector/v1/decode_bench_connector.py +419 -0
  139. vllm/distributed/kv_transfer/kv_connector/v1/example_connector.py +450 -0
  140. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +344 -0
  141. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/__init__.py +18 -0
  142. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/multi_process_adapter.py +395 -0
  143. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/utils.py +211 -0
  144. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/vllm_v1_adapter.py +1431 -0
  145. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_mp_connector.py +941 -0
  146. vllm/distributed/kv_transfer/kv_connector/v1/metrics.py +186 -0
  147. vllm/distributed/kv_transfer/kv_connector/v1/mooncake_connector.py +916 -0
  148. vllm/distributed/kv_transfer/kv_connector/v1/moriio/__init__.py +0 -0
  149. vllm/distributed/kv_transfer/kv_connector/v1/moriio/moriio_common.py +321 -0
  150. vllm/distributed/kv_transfer/kv_connector/v1/moriio/moriio_connector.py +1515 -0
  151. vllm/distributed/kv_transfer/kv_connector/v1/moriio/moriio_engine.py +609 -0
  152. vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +477 -0
  153. vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +2688 -0
  154. vllm/distributed/kv_transfer/kv_connector/v1/offloading_connector.py +557 -0
  155. vllm/distributed/kv_transfer/kv_connector/v1/p2p/__init__.py +0 -0
  156. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_connector.py +531 -0
  157. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py +632 -0
  158. vllm/distributed/kv_transfer/kv_connector/v1/p2p/tensor_memory_pool.py +273 -0
  159. vllm/distributed/kv_transfer/kv_transfer_state.py +78 -0
  160. vllm/distributed/parallel_state.py +1809 -0
  161. vllm/distributed/utils.py +545 -0
  162. vllm/engine/__init__.py +0 -0
  163. vllm/engine/arg_utils.py +2137 -0
  164. vllm/engine/async_llm_engine.py +6 -0
  165. vllm/engine/llm_engine.py +6 -0
  166. vllm/engine/protocol.py +194 -0
  167. vllm/entrypoints/__init__.py +0 -0
  168. vllm/entrypoints/anthropic/__init__.py +0 -0
  169. vllm/entrypoints/anthropic/protocol.py +162 -0
  170. vllm/entrypoints/anthropic/serving_messages.py +468 -0
  171. vllm/entrypoints/api_server.py +186 -0
  172. vllm/entrypoints/chat_utils.py +1912 -0
  173. vllm/entrypoints/cli/__init__.py +19 -0
  174. vllm/entrypoints/cli/benchmark/__init__.py +0 -0
  175. vllm/entrypoints/cli/benchmark/base.py +25 -0
  176. vllm/entrypoints/cli/benchmark/latency.py +21 -0
  177. vllm/entrypoints/cli/benchmark/main.py +57 -0
  178. vllm/entrypoints/cli/benchmark/mm_processor.py +21 -0
  179. vllm/entrypoints/cli/benchmark/serve.py +21 -0
  180. vllm/entrypoints/cli/benchmark/startup.py +21 -0
  181. vllm/entrypoints/cli/benchmark/sweep.py +21 -0
  182. vllm/entrypoints/cli/benchmark/throughput.py +21 -0
  183. vllm/entrypoints/cli/collect_env.py +38 -0
  184. vllm/entrypoints/cli/main.py +79 -0
  185. vllm/entrypoints/cli/openai.py +260 -0
  186. vllm/entrypoints/cli/run_batch.py +68 -0
  187. vllm/entrypoints/cli/serve.py +253 -0
  188. vllm/entrypoints/cli/types.py +29 -0
  189. vllm/entrypoints/constants.py +12 -0
  190. vllm/entrypoints/context.py +898 -0
  191. vllm/entrypoints/grpc_server.py +531 -0
  192. vllm/entrypoints/launcher.py +175 -0
  193. vllm/entrypoints/llm.py +1807 -0
  194. vllm/entrypoints/logger.py +86 -0
  195. vllm/entrypoints/openai/__init__.py +0 -0
  196. vllm/entrypoints/openai/api_server.py +1390 -0
  197. vllm/entrypoints/openai/cli_args.py +320 -0
  198. vllm/entrypoints/openai/orca_metrics.py +120 -0
  199. vllm/entrypoints/openai/parser/__init__.py +0 -0
  200. vllm/entrypoints/openai/parser/harmony_utils.py +820 -0
  201. vllm/entrypoints/openai/parser/responses_parser.py +176 -0
  202. vllm/entrypoints/openai/protocol.py +2566 -0
  203. vllm/entrypoints/openai/run_batch.py +635 -0
  204. vllm/entrypoints/openai/serving_chat.py +1897 -0
  205. vllm/entrypoints/openai/serving_chat_stream_harmony.py +101 -0
  206. vllm/entrypoints/openai/serving_completion.py +740 -0
  207. vllm/entrypoints/openai/serving_engine.py +1612 -0
  208. vllm/entrypoints/openai/serving_models.py +309 -0
  209. vllm/entrypoints/openai/serving_responses.py +2552 -0
  210. vllm/entrypoints/openai/serving_transcription.py +168 -0
  211. vllm/entrypoints/openai/speech_to_text.py +711 -0
  212. vllm/entrypoints/openai/utils.py +49 -0
  213. vllm/entrypoints/pooling/__init__.py +16 -0
  214. vllm/entrypoints/pooling/classify/__init__.py +0 -0
  215. vllm/entrypoints/pooling/classify/api_router.py +48 -0
  216. vllm/entrypoints/pooling/classify/protocol.py +181 -0
  217. vllm/entrypoints/pooling/classify/serving.py +233 -0
  218. vllm/entrypoints/pooling/embed/__init__.py +0 -0
  219. vllm/entrypoints/pooling/embed/api_router.py +65 -0
  220. vllm/entrypoints/pooling/embed/conftest.py +28 -0
  221. vllm/entrypoints/pooling/embed/protocol.py +217 -0
  222. vllm/entrypoints/pooling/embed/serving.py +684 -0
  223. vllm/entrypoints/pooling/pooling/__init__.py +0 -0
  224. vllm/entrypoints/pooling/pooling/api_router.py +62 -0
  225. vllm/entrypoints/pooling/pooling/protocol.py +146 -0
  226. vllm/entrypoints/pooling/pooling/serving.py +354 -0
  227. vllm/entrypoints/pooling/score/__init__.py +0 -0
  228. vllm/entrypoints/pooling/score/api_router.py +147 -0
  229. vllm/entrypoints/pooling/score/protocol.py +146 -0
  230. vllm/entrypoints/pooling/score/serving.py +511 -0
  231. vllm/entrypoints/renderer.py +411 -0
  232. vllm/entrypoints/responses_utils.py +218 -0
  233. vllm/entrypoints/sagemaker/__init__.py +4 -0
  234. vllm/entrypoints/sagemaker/routes.py +118 -0
  235. vllm/entrypoints/score_utils.py +271 -0
  236. vllm/entrypoints/serve/__init__.py +94 -0
  237. vllm/entrypoints/serve/cache/__init__.py +0 -0
  238. vllm/entrypoints/serve/cache/api_router.py +61 -0
  239. vllm/entrypoints/serve/disagg/__init__.py +0 -0
  240. vllm/entrypoints/serve/disagg/api_router.py +109 -0
  241. vllm/entrypoints/serve/disagg/protocol.py +90 -0
  242. vllm/entrypoints/serve/disagg/serving.py +285 -0
  243. vllm/entrypoints/serve/elastic_ep/__init__.py +0 -0
  244. vllm/entrypoints/serve/elastic_ep/api_router.py +96 -0
  245. vllm/entrypoints/serve/elastic_ep/middleware.py +49 -0
  246. vllm/entrypoints/serve/instrumentator/__init__.py +0 -0
  247. vllm/entrypoints/serve/instrumentator/health.py +33 -0
  248. vllm/entrypoints/serve/instrumentator/metrics.py +45 -0
  249. vllm/entrypoints/serve/instrumentator/offline_docs.py +50 -0
  250. vllm/entrypoints/serve/instrumentator/server_info.py +56 -0
  251. vllm/entrypoints/serve/instrumentator/static/swagger-ui-bundle.js +2 -0
  252. vllm/entrypoints/serve/instrumentator/static/swagger-ui.css +3 -0
  253. vllm/entrypoints/serve/lora/__init__.py +0 -0
  254. vllm/entrypoints/serve/lora/api_router.py +70 -0
  255. vllm/entrypoints/serve/profile/__init__.py +0 -0
  256. vllm/entrypoints/serve/profile/api_router.py +46 -0
  257. vllm/entrypoints/serve/rlhf/__init__.py +0 -0
  258. vllm/entrypoints/serve/rlhf/api_router.py +102 -0
  259. vllm/entrypoints/serve/rpc/__init__.py +0 -0
  260. vllm/entrypoints/serve/rpc/api_router.py +61 -0
  261. vllm/entrypoints/serve/sleep/__init__.py +0 -0
  262. vllm/entrypoints/serve/sleep/api_router.py +56 -0
  263. vllm/entrypoints/serve/tokenize/__init__.py +0 -0
  264. vllm/entrypoints/serve/tokenize/api_router.py +112 -0
  265. vllm/entrypoints/serve/tokenize/serving.py +204 -0
  266. vllm/entrypoints/ssl.py +78 -0
  267. vllm/entrypoints/tool.py +187 -0
  268. vllm/entrypoints/tool_server.py +234 -0
  269. vllm/entrypoints/utils.py +336 -0
  270. vllm/env_override.py +402 -0
  271. vllm/envs.py +1791 -0
  272. vllm/exceptions.py +36 -0
  273. vllm/forward_context.py +375 -0
  274. vllm/grpc/__init__.py +17 -0
  275. vllm/grpc/compile_protos.py +94 -0
  276. vllm/grpc/vllm_engine.proto +195 -0
  277. vllm/grpc/vllm_engine_pb2.py +77 -0
  278. vllm/grpc/vllm_engine_pb2.pyi +213 -0
  279. vllm/grpc/vllm_engine_pb2_grpc.py +330 -0
  280. vllm/inputs/__init__.py +44 -0
  281. vllm/inputs/data.py +359 -0
  282. vllm/inputs/parse.py +147 -0
  283. vllm/inputs/preprocess.py +716 -0
  284. vllm/logger.py +303 -0
  285. vllm/logging_utils/__init__.py +13 -0
  286. vllm/logging_utils/dump_input.py +83 -0
  287. vllm/logging_utils/formatter.py +127 -0
  288. vllm/logging_utils/lazy.py +20 -0
  289. vllm/logging_utils/log_time.py +34 -0
  290. vllm/logits_process.py +121 -0
  291. vllm/logprobs.py +206 -0
  292. vllm/lora/__init__.py +0 -0
  293. vllm/lora/layers/__init__.py +43 -0
  294. vllm/lora/layers/base.py +66 -0
  295. vllm/lora/layers/base_linear.py +172 -0
  296. vllm/lora/layers/column_parallel_linear.py +577 -0
  297. vllm/lora/layers/fused_moe.py +739 -0
  298. vllm/lora/layers/logits_processor.py +203 -0
  299. vllm/lora/layers/replicated_linear.py +70 -0
  300. vllm/lora/layers/row_parallel_linear.py +176 -0
  301. vllm/lora/layers/utils.py +115 -0
  302. vllm/lora/layers/vocal_parallel_embedding.py +140 -0
  303. vllm/lora/lora_model.py +221 -0
  304. vllm/lora/lora_weights.py +227 -0
  305. vllm/lora/model_manager.py +858 -0
  306. vllm/lora/ops/__init__.py +0 -0
  307. vllm/lora/ops/ipex_ops/__init__.py +6 -0
  308. vllm/lora/ops/ipex_ops/lora_ops.py +57 -0
  309. vllm/lora/ops/torch_ops/__init__.py +20 -0
  310. vllm/lora/ops/torch_ops/lora_ops.py +128 -0
  311. vllm/lora/ops/triton_ops/README_TUNING.md +60 -0
  312. vllm/lora/ops/triton_ops/__init__.py +21 -0
  313. vllm/lora/ops/triton_ops/fused_moe_lora_op.py +677 -0
  314. vllm/lora/ops/triton_ops/kernel_utils.py +340 -0
  315. vllm/lora/ops/triton_ops/lora_expand_op.py +310 -0
  316. vllm/lora/ops/triton_ops/lora_kernel_metadata.py +154 -0
  317. vllm/lora/ops/triton_ops/lora_shrink_op.py +287 -0
  318. vllm/lora/ops/triton_ops/utils.py +313 -0
  319. vllm/lora/peft_helper.py +128 -0
  320. vllm/lora/punica_wrapper/__init__.py +10 -0
  321. vllm/lora/punica_wrapper/punica_base.py +493 -0
  322. vllm/lora/punica_wrapper/punica_cpu.py +351 -0
  323. vllm/lora/punica_wrapper/punica_gpu.py +413 -0
  324. vllm/lora/punica_wrapper/punica_selector.py +21 -0
  325. vllm/lora/punica_wrapper/punica_xpu.py +276 -0
  326. vllm/lora/punica_wrapper/utils.py +150 -0
  327. vllm/lora/request.py +60 -0
  328. vllm/lora/resolver.py +88 -0
  329. vllm/lora/utils.py +281 -0
  330. vllm/lora/worker_manager.py +278 -0
  331. vllm/model_executor/__init__.py +9 -0
  332. vllm/model_executor/custom_op.py +203 -0
  333. vllm/model_executor/layers/__init__.py +0 -0
  334. vllm/model_executor/layers/activation.py +628 -0
  335. vllm/model_executor/layers/attention/__init__.py +0 -0
  336. vllm/model_executor/layers/attention/chunked_local_attention.py +130 -0
  337. vllm/model_executor/layers/attention/cross_attention.py +182 -0
  338. vllm/model_executor/layers/attention/encoder_only_attention.py +103 -0
  339. vllm/model_executor/layers/attention/mm_encoder_attention.py +234 -0
  340. vllm/model_executor/layers/attention/static_sink_attention.py +254 -0
  341. vllm/model_executor/layers/attention_layer_base.py +34 -0
  342. vllm/model_executor/layers/batch_invariant.py +1063 -0
  343. vllm/model_executor/layers/conv.py +262 -0
  344. vllm/model_executor/layers/fla/__init__.py +8 -0
  345. vllm/model_executor/layers/fla/ops/__init__.py +17 -0
  346. vllm/model_executor/layers/fla/ops/chunk.py +240 -0
  347. vllm/model_executor/layers/fla/ops/chunk_delta_h.py +344 -0
  348. vllm/model_executor/layers/fla/ops/chunk_o.py +183 -0
  349. vllm/model_executor/layers/fla/ops/chunk_scaled_dot_kkt.py +154 -0
  350. vllm/model_executor/layers/fla/ops/cumsum.py +280 -0
  351. vllm/model_executor/layers/fla/ops/fused_recurrent.py +390 -0
  352. vllm/model_executor/layers/fla/ops/index.py +41 -0
  353. vllm/model_executor/layers/fla/ops/kda.py +1351 -0
  354. vllm/model_executor/layers/fla/ops/l2norm.py +146 -0
  355. vllm/model_executor/layers/fla/ops/layernorm_guard.py +396 -0
  356. vllm/model_executor/layers/fla/ops/op.py +60 -0
  357. vllm/model_executor/layers/fla/ops/solve_tril.py +556 -0
  358. vllm/model_executor/layers/fla/ops/utils.py +194 -0
  359. vllm/model_executor/layers/fla/ops/wy_fast.py +158 -0
  360. vllm/model_executor/layers/fused_moe/__init__.py +120 -0
  361. vllm/model_executor/layers/fused_moe/all2all_utils.py +173 -0
  362. vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +411 -0
  363. vllm/model_executor/layers/fused_moe/config.py +1111 -0
  364. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  365. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  366. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  367. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  368. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  369. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  370. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  371. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
  372. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H200,dtype=int8_w8a16.json +146 -0
  373. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  374. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  375. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  376. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  377. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  378. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  379. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  380. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  381. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  382. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H100,dtype=fp8_w8a8.json +123 -0
  383. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  384. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H200.json +146 -0
  385. vllm/model_executor/layers/fused_moe/configs/E=128,N=1856,device_name=NVIDIA_H100_80GB_HBM3.json +147 -0
  386. vllm/model_executor/layers/fused_moe/configs/E=128,N=1856,device_name=NVIDIA_L40S.json +147 -0
  387. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  388. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  389. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  390. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20.json +146 -0
  391. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
  392. vllm/model_executor/layers/fused_moe/configs/E=128,N=352,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +122 -0
  393. 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
  394. 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
  395. 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
  396. 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
  397. 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
  398. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e.json +146 -0
  399. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20.json +146 -0
  400. 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
  401. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
  402. vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  403. vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  404. vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  405. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +146 -0
  406. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +114 -0
  407. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_RTX_PRO_6000_Blackwell_Workstation_Edition,dtype=fp8_w8a8.json +146 -0
  408. 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
  409. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI308X.json +213 -0
  410. 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
  411. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_B200.json +147 -0
  412. 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
  413. 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
  414. 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
  415. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
  416. 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
  417. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
  418. vllm/model_executor/layers/fused_moe/configs/E=128,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=bf16.json +82 -0
  419. vllm/model_executor/layers/fused_moe/configs/E=128,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +82 -0
  420. vllm/model_executor/layers/fused_moe/configs/E=128,N=928,device_name=NVIDIA_H100_80GB_HBM3.json +147 -0
  421. vllm/model_executor/layers/fused_moe/configs/E=128,N=928,device_name=NVIDIA_L40S.json +147 -0
  422. vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
  423. vllm/model_executor/layers/fused_moe/configs/E=129,N=704,device_name=NVIDIA_RTX_PRO_6000_Blackwell_Workstation_Edition,dtype=fp8_w8a8.json +146 -0
  424. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  425. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
  426. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200.json +146 -0
  427. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
  428. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  429. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H200.json +146 -0
  430. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  431. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  432. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  433. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  434. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  435. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  436. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  437. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  438. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  439. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  440. vllm/model_executor/layers/fused_moe/configs/E=16,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  441. vllm/model_executor/layers/fused_moe/configs/E=16,N=2048,device_name=NVIDIA_H200.json +146 -0
  442. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  443. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  444. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  445. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=float8.json +146 -0
  446. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  447. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H200,dtype=int8_w8a16.json +146 -0
  448. vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  449. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  450. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  451. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  452. vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  453. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  454. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  455. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=float8.json +146 -0
  456. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  457. vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  458. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=AMD_Instinct_MI300X.json +201 -0
  459. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=AMD_Instinct_MI350_OAM,dtype=fp8_w8a8.json +164 -0
  460. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  461. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_B300_SXM6_AC,dtype=fp8_w8a8.json +147 -0
  462. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  463. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +147 -0
  464. vllm/model_executor/layers/fused_moe/configs/E=160,N=320,device_name=NVIDIA_H20-3e.json +146 -0
  465. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  466. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI350_OAM,dtype=fp8_w8a8.json +164 -0
  467. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI355_OAM,dtype=fp8_w8a8.json +164 -0
  468. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=NVIDIA_B300_SXM6_AC,dtype=fp8_w8a8.json +147 -0
  469. 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
  470. 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
  471. 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
  472. vllm/model_executor/layers/fused_moe/configs/E=160,N=768,device_name=NVIDIA_B300_SXM6_AC,dtype=fp8_w8a8.json +147 -0
  473. vllm/model_executor/layers/fused_moe/configs/E=20,N=1536,device_name=NVIDIA_RTX_PRO_6000_Blackwell_Server_Edition,dtype=fp8_w8a8.json +147 -0
  474. 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
  475. 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
  476. 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
  477. 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
  478. vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
  479. 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
  480. 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
  481. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  482. 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
  483. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  484. 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
  485. 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
  486. 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
  487. 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
  488. 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
  489. 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
  490. 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
  491. 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
  492. 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
  493. 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
  494. 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
  495. 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
  496. vllm/model_executor/layers/fused_moe/configs/E=256,N=384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  497. 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
  498. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  499. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  500. vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  501. vllm/model_executor/layers/fused_moe/configs/E=32,N=1408,device_name=NVIDIA_B200.json +147 -0
  502. vllm/model_executor/layers/fused_moe/configs/E=32,N=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  503. vllm/model_executor/layers/fused_moe/configs/E=32,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  504. 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
  505. 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
  506. 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
  507. 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
  508. 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
  509. vllm/model_executor/layers/fused_moe/configs/E=40,N=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
  510. 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
  511. 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
  512. 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
  513. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_A100-SXM4-80GB.json +147 -0
  514. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  515. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200.json +146 -0
  516. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +147 -0
  517. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  518. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H20-3e.json +146 -0
  519. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H200.json +146 -0
  520. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  521. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200.json +146 -0
  522. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
  523. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  524. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  525. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H20-3e.json +146 -0
  526. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H200.json +146 -0
  527. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  528. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200.json +146 -0
  529. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
  530. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  531. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H20-3e.json +146 -0
  532. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H200.json +146 -0
  533. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_A100-SXM4-80GB.json +147 -0
  534. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_B200.json +146 -0
  535. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H20-3e.json +146 -0
  536. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H200.json +146 -0
  537. vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
  538. vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
  539. vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
  540. vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
  541. vllm/model_executor/layers/fused_moe/configs/E=62,N=128,device_name=AMD_Instinct_MI300X.json +200 -0
  542. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=AMD_Instinct_MI300X.json +200 -0
  543. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  544. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=AMD_Instinct_MI300X.json +200 -0
  545. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  546. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  547. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  548. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  549. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  550. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  551. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
  552. vllm/model_executor/layers/fused_moe/configs/E=64,N=1408,device_name=NVIDIA_B200.json +147 -0
  553. vllm/model_executor/layers/fused_moe/configs/E=64,N=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  554. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  555. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  556. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
  557. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  558. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20.json +146 -0
  559. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  560. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  561. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  562. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
  563. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  564. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20.json +146 -0
  565. vllm/model_executor/layers/fused_moe/configs/E=64,N=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  566. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  567. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  568. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  569. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  570. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  571. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  572. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
  573. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H100_PCIe,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  574. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  575. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20.json +146 -0
  576. vllm/model_executor/layers/fused_moe/configs/E=64,N=896,device_name=NVIDIA_H20.json +146 -0
  577. vllm/model_executor/layers/fused_moe/configs/E=64,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=bf16.json +82 -0
  578. vllm/model_executor/layers/fused_moe/configs/E=64,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +82 -0
  579. vllm/model_executor/layers/fused_moe/configs/E=72,N=192,device_name=AMD_Instinct_MI300X.json +200 -0
  580. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=AMD_Instinct_MI300X.json +200 -0
  581. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  582. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=AMD_Instinct_MI300X.json +200 -0
  583. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  584. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  585. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
  586. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  587. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
  588. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
  589. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  590. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
  591. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  592. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
  593. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  594. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
  595. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  596. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
  597. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  598. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
  599. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  600. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  601. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  602. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  603. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
  604. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  605. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
  606. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  607. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
  608. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  609. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  610. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  611. 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
  612. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  613. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
  614. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  615. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
  616. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  617. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
  618. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  619. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  620. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  621. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  622. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  623. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  624. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
  625. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
  626. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  627. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
  628. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  629. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
  630. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  631. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  632. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  633. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  634. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
  635. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  636. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
  637. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  638. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
  639. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  640. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  641. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  642. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  643. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
  644. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  645. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
  646. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  647. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
  648. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  649. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  650. vllm/model_executor/layers/fused_moe/configs/README +12 -0
  651. vllm/model_executor/layers/fused_moe/cpu_fused_moe.py +444 -0
  652. vllm/model_executor/layers/fused_moe/cutlass_moe.py +1086 -0
  653. vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +364 -0
  654. vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +427 -0
  655. vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +420 -0
  656. vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +436 -0
  657. vllm/model_executor/layers/fused_moe/fallback.py +127 -0
  658. vllm/model_executor/layers/fused_moe/flashinfer_cutedsl_moe.py +338 -0
  659. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_moe.py +310 -0
  660. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_prepare_finalize.py +371 -0
  661. vllm/model_executor/layers/fused_moe/flashinfer_trtllm_moe.py +192 -0
  662. vllm/model_executor/layers/fused_moe/fused_batched_moe.py +1018 -0
  663. vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +824 -0
  664. vllm/model_executor/layers/fused_moe/fused_moe.py +2638 -0
  665. vllm/model_executor/layers/fused_moe/fused_moe_method_base.py +119 -0
  666. vllm/model_executor/layers/fused_moe/fused_moe_modular_method.py +117 -0
  667. vllm/model_executor/layers/fused_moe/fused_moe_router.py +40 -0
  668. vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py +531 -0
  669. vllm/model_executor/layers/fused_moe/layer.py +2169 -0
  670. vllm/model_executor/layers/fused_moe/modular_kernel.py +1251 -0
  671. vllm/model_executor/layers/fused_moe/moe_align_block_size.py +192 -0
  672. vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +229 -0
  673. vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
  674. vllm/model_executor/layers/fused_moe/oracle/__init__.py +2 -0
  675. vllm/model_executor/layers/fused_moe/oracle/fp8.py +358 -0
  676. vllm/model_executor/layers/fused_moe/oracle/nvfp4.py +280 -0
  677. vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +362 -0
  678. vllm/model_executor/layers/fused_moe/prepare_finalize.py +87 -0
  679. vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +347 -0
  680. vllm/model_executor/layers/fused_moe/routed_experts_capturer.py +324 -0
  681. vllm/model_executor/layers/fused_moe/routing_simulator.py +310 -0
  682. vllm/model_executor/layers/fused_moe/shared_fused_moe.py +96 -0
  683. vllm/model_executor/layers/fused_moe/topk_weight_and_reduce.py +171 -0
  684. vllm/model_executor/layers/fused_moe/triton_cutlass_moe.py +78 -0
  685. vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +75 -0
  686. vllm/model_executor/layers/fused_moe/trtllm_moe.py +144 -0
  687. vllm/model_executor/layers/fused_moe/unquantized_fused_moe_method.py +403 -0
  688. vllm/model_executor/layers/fused_moe/utils.py +382 -0
  689. vllm/model_executor/layers/fused_moe/zero_expert_fused_moe.py +189 -0
  690. vllm/model_executor/layers/kda.py +442 -0
  691. vllm/model_executor/layers/layernorm.py +451 -0
  692. vllm/model_executor/layers/lightning_attn.py +735 -0
  693. vllm/model_executor/layers/linear.py +1478 -0
  694. vllm/model_executor/layers/logits_processor.py +109 -0
  695. vllm/model_executor/layers/mamba/__init__.py +0 -0
  696. vllm/model_executor/layers/mamba/abstract.py +68 -0
  697. vllm/model_executor/layers/mamba/linear_attn.py +410 -0
  698. vllm/model_executor/layers/mamba/mamba_mixer.py +541 -0
  699. vllm/model_executor/layers/mamba/mamba_mixer2.py +936 -0
  700. vllm/model_executor/layers/mamba/mamba_utils.py +225 -0
  701. vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
  702. vllm/model_executor/layers/mamba/ops/causal_conv1d.py +1240 -0
  703. vllm/model_executor/layers/mamba/ops/layernorm_gated.py +172 -0
  704. vllm/model_executor/layers/mamba/ops/mamba_ssm.py +586 -0
  705. vllm/model_executor/layers/mamba/ops/ssd_bmm.py +211 -0
  706. vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +456 -0
  707. vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +700 -0
  708. vllm/model_executor/layers/mamba/ops/ssd_combined.py +230 -0
  709. vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +157 -0
  710. vllm/model_executor/layers/mamba/short_conv.py +254 -0
  711. vllm/model_executor/layers/mla.py +179 -0
  712. vllm/model_executor/layers/pooler/__init__.py +5 -0
  713. vllm/model_executor/layers/pooler/abstract.py +39 -0
  714. vllm/model_executor/layers/pooler/activations.py +162 -0
  715. vllm/model_executor/layers/pooler/common.py +32 -0
  716. vllm/model_executor/layers/pooler/seqwise/__init__.py +45 -0
  717. vllm/model_executor/layers/pooler/seqwise/heads.py +151 -0
  718. vllm/model_executor/layers/pooler/seqwise/methods.py +93 -0
  719. vllm/model_executor/layers/pooler/seqwise/poolers.py +127 -0
  720. vllm/model_executor/layers/pooler/special.py +128 -0
  721. vllm/model_executor/layers/pooler/tokwise/__init__.py +39 -0
  722. vllm/model_executor/layers/pooler/tokwise/heads.py +133 -0
  723. vllm/model_executor/layers/pooler/tokwise/methods.py +122 -0
  724. vllm/model_executor/layers/pooler/tokwise/poolers.py +127 -0
  725. vllm/model_executor/layers/quantization/__init__.py +195 -0
  726. vllm/model_executor/layers/quantization/auto_round.py +454 -0
  727. vllm/model_executor/layers/quantization/awq.py +277 -0
  728. vllm/model_executor/layers/quantization/awq_marlin.py +795 -0
  729. vllm/model_executor/layers/quantization/awq_triton.py +337 -0
  730. vllm/model_executor/layers/quantization/base_config.py +170 -0
  731. vllm/model_executor/layers/quantization/bitblas.py +502 -0
  732. vllm/model_executor/layers/quantization/bitsandbytes.py +631 -0
  733. vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +3 -0
  734. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +982 -0
  735. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +2368 -0
  736. vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +37 -0
  737. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +392 -0
  738. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +55 -0
  739. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +176 -0
  740. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_mxfp4.py +106 -0
  741. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_nvfp4.py +124 -0
  742. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +218 -0
  743. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_fp8.py +176 -0
  744. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_int.py +153 -0
  745. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +138 -0
  746. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +203 -0
  747. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +125 -0
  748. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +230 -0
  749. vllm/model_executor/layers/quantization/compressed_tensors/transform/__init__.py +0 -0
  750. vllm/model_executor/layers/quantization/compressed_tensors/transform/linear.py +260 -0
  751. vllm/model_executor/layers/quantization/compressed_tensors/transform/module.py +173 -0
  752. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/__init__.py +0 -0
  753. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/linear_qutlass_nvfp4.py +64 -0
  754. vllm/model_executor/layers/quantization/compressed_tensors/transform/utils.py +13 -0
  755. vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +224 -0
  756. vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
  757. vllm/model_executor/layers/quantization/cpu_wna16.py +299 -0
  758. vllm/model_executor/layers/quantization/deepspeedfp.py +218 -0
  759. vllm/model_executor/layers/quantization/experts_int8.py +209 -0
  760. vllm/model_executor/layers/quantization/fbgemm_fp8.py +195 -0
  761. vllm/model_executor/layers/quantization/fp8.py +1224 -0
  762. vllm/model_executor/layers/quantization/fp_quant.py +420 -0
  763. vllm/model_executor/layers/quantization/gguf.py +682 -0
  764. vllm/model_executor/layers/quantization/gptq.py +393 -0
  765. vllm/model_executor/layers/quantization/gptq_bitblas.py +482 -0
  766. vllm/model_executor/layers/quantization/gptq_marlin.py +934 -0
  767. vllm/model_executor/layers/quantization/gptq_marlin_24.py +320 -0
  768. vllm/model_executor/layers/quantization/hqq_marlin.py +372 -0
  769. vllm/model_executor/layers/quantization/inc.py +65 -0
  770. vllm/model_executor/layers/quantization/input_quant_fp8.py +212 -0
  771. vllm/model_executor/layers/quantization/ipex_quant.py +403 -0
  772. vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
  773. vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +94 -0
  774. vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +113 -0
  775. vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +115 -0
  776. vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +323 -0
  777. vllm/model_executor/layers/quantization/kernels/mixed_precision/conch.py +98 -0
  778. vllm/model_executor/layers/quantization/kernels/mixed_precision/cpu.py +126 -0
  779. vllm/model_executor/layers/quantization/kernels/mixed_precision/cutlass.py +130 -0
  780. vllm/model_executor/layers/quantization/kernels/mixed_precision/dynamic_4bit.py +111 -0
  781. vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +168 -0
  782. vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +159 -0
  783. vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +200 -0
  784. vllm/model_executor/layers/quantization/kernels/mixed_precision/xpu.py +97 -0
  785. vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +76 -0
  786. vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +77 -0
  787. vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +128 -0
  788. vllm/model_executor/layers/quantization/kernels/scaled_mm/cpu.py +220 -0
  789. vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +147 -0
  790. vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +88 -0
  791. vllm/model_executor/layers/quantization/kv_cache.py +153 -0
  792. vllm/model_executor/layers/quantization/modelopt.py +1665 -0
  793. vllm/model_executor/layers/quantization/moe_wna16.py +518 -0
  794. vllm/model_executor/layers/quantization/mxfp4.py +1145 -0
  795. vllm/model_executor/layers/quantization/petit.py +319 -0
  796. vllm/model_executor/layers/quantization/ptpc_fp8.py +140 -0
  797. vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
  798. vllm/model_executor/layers/quantization/quark/quark.py +570 -0
  799. vllm/model_executor/layers/quantization/quark/quark_moe.py +797 -0
  800. vllm/model_executor/layers/quantization/quark/schemes/__init__.py +9 -0
  801. vllm/model_executor/layers/quantization/quark/schemes/quark_ocp_mx.py +343 -0
  802. vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +55 -0
  803. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +179 -0
  804. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +139 -0
  805. vllm/model_executor/layers/quantization/quark/utils.py +105 -0
  806. vllm/model_executor/layers/quantization/qutlass_utils.py +185 -0
  807. vllm/model_executor/layers/quantization/rtn.py +626 -0
  808. vllm/model_executor/layers/quantization/schema.py +90 -0
  809. vllm/model_executor/layers/quantization/torchao.py +380 -0
  810. vllm/model_executor/layers/quantization/utils/__init__.py +6 -0
  811. vllm/model_executor/layers/quantization/utils/allspark_utils.py +67 -0
  812. vllm/model_executor/layers/quantization/utils/bitblas_utils.py +229 -0
  813. vllm/model_executor/layers/quantization/utils/configs/N=10240,K=5120,device_name=NVIDIA_L40S,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  814. 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
  815. 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
  816. 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
  817. 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
  818. 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
  819. 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
  820. 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
  821. 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
  822. 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
  823. 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
  824. 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
  825. 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
  826. 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
  827. 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
  828. 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
  829. 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
  830. 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
  831. 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
  832. 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
  833. 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
  834. 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
  835. 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
  836. 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
  837. 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
  838. 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
  839. 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
  840. 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
  841. 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
  842. 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
  843. 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
  844. 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
  845. 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
  846. 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
  847. 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
  848. 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
  849. 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
  850. 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
  851. 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
  852. 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
  853. 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
  854. 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
  855. 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
  856. 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
  857. 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
  858. 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
  859. 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
  860. 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
  861. 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
  862. 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
  863. 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
  864. 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
  865. 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
  866. 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
  867. 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
  868. 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
  869. 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
  870. 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
  871. 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
  872. 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
  873. 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
  874. 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
  875. 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
  876. 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
  877. 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
  878. 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
  879. 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
  880. 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
  881. 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
  882. 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
  883. 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
  884. 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
  885. 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
  886. 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
  887. 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
  888. 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
  889. 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
  890. 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
  891. 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
  892. 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
  893. 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
  894. 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
  895. 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
  896. 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
  897. 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
  898. 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
  899. 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
  900. 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
  901. 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
  902. 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
  903. 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
  904. 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
  905. 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
  906. 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
  907. 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
  908. 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
  909. 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
  910. 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
  911. 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
  912. 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
  913. 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
  914. 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
  915. 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
  916. 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
  917. 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
  918. 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
  919. 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
  920. 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
  921. 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
  922. 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
  923. 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
  924. 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
  925. 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
  926. 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
  927. 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
  928. 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
  929. 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
  930. 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
  931. 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
  932. 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
  933. vllm/model_executor/layers/quantization/utils/configs/N=5120,K=25600,device_name=NVIDIA_L40S,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  934. vllm/model_executor/layers/quantization/utils/configs/N=5120,K=8192,device_name=NVIDIA_L40S,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  935. vllm/model_executor/layers/quantization/utils/configs/N=51200,K=5120,device_name=NVIDIA_L40S,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  936. 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
  937. 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
  938. 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
  939. 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
  940. 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
  941. 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
  942. 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
  943. 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
  944. 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
  945. 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
  946. 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
  947. 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
  948. 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
  949. 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
  950. 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
  951. 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
  952. 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
  953. 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
  954. 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
  955. 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
  956. 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
  957. 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
  958. 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
  959. 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
  960. 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
  961. 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
  962. 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
  963. 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
  964. 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
  965. 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
  966. 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
  967. 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
  968. 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
  969. 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
  970. 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
  971. 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
  972. 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
  973. 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
  974. 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
  975. 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
  976. 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
  977. 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
  978. 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
  979. 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
  980. 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
  981. 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
  982. 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
  983. 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
  984. 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
  985. 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
  986. 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
  987. 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
  988. 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
  989. 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
  990. 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
  991. 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
  992. 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
  993. 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
  994. 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
  995. 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
  996. 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
  997. 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
  998. 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
  999. 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
  1000. 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
  1001. 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
  1002. 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
  1003. 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
  1004. 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
  1005. 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
  1006. 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
  1007. 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
  1008. 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
  1009. 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
  1010. 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
  1011. 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
  1012. 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
  1013. 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
  1014. 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
  1015. 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
  1016. 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
  1017. 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
  1018. 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
  1019. 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
  1020. 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
  1021. 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
  1022. 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
  1023. 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
  1024. 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
  1025. 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
  1026. 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
  1027. vllm/model_executor/layers/quantization/utils/configs/README.md +3 -0
  1028. vllm/model_executor/layers/quantization/utils/flashinfer_fp4_moe.py +514 -0
  1029. vllm/model_executor/layers/quantization/utils/flashinfer_utils.py +370 -0
  1030. vllm/model_executor/layers/quantization/utils/fp8_utils.py +1658 -0
  1031. vllm/model_executor/layers/quantization/utils/gptq_utils.py +158 -0
  1032. vllm/model_executor/layers/quantization/utils/int8_utils.py +477 -0
  1033. vllm/model_executor/layers/quantization/utils/layer_utils.py +41 -0
  1034. vllm/model_executor/layers/quantization/utils/machete_utils.py +56 -0
  1035. vllm/model_executor/layers/quantization/utils/marlin_utils.py +720 -0
  1036. vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +565 -0
  1037. vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +378 -0
  1038. vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +219 -0
  1039. vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +467 -0
  1040. vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +189 -0
  1041. vllm/model_executor/layers/quantization/utils/mxfp6_utils.py +142 -0
  1042. vllm/model_executor/layers/quantization/utils/mxfp8_utils.py +24 -0
  1043. vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +142 -0
  1044. vllm/model_executor/layers/quantization/utils/nvfp4_moe_support.py +67 -0
  1045. vllm/model_executor/layers/quantization/utils/ocp_mx_utils.py +51 -0
  1046. vllm/model_executor/layers/quantization/utils/petit_utils.py +124 -0
  1047. vllm/model_executor/layers/quantization/utils/quant_utils.py +767 -0
  1048. vllm/model_executor/layers/quantization/utils/w8a8_utils.py +519 -0
  1049. vllm/model_executor/layers/resampler.py +283 -0
  1050. vllm/model_executor/layers/rotary_embedding/__init__.py +291 -0
  1051. vllm/model_executor/layers/rotary_embedding/base.py +282 -0
  1052. vllm/model_executor/layers/rotary_embedding/common.py +289 -0
  1053. vllm/model_executor/layers/rotary_embedding/deepseek_scaling_rope.py +184 -0
  1054. vllm/model_executor/layers/rotary_embedding/dual_chunk_rope.py +218 -0
  1055. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_alpha_rope.py +43 -0
  1056. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_scaling_rope.py +68 -0
  1057. vllm/model_executor/layers/rotary_embedding/ernie45_vl_rope.py +82 -0
  1058. vllm/model_executor/layers/rotary_embedding/linear_scaling_rope.py +115 -0
  1059. vllm/model_executor/layers/rotary_embedding/llama3_rope.py +54 -0
  1060. vllm/model_executor/layers/rotary_embedding/llama4_vision_rope.py +83 -0
  1061. vllm/model_executor/layers/rotary_embedding/mrope.py +412 -0
  1062. vllm/model_executor/layers/rotary_embedding/ntk_scaling_rope.py +47 -0
  1063. vllm/model_executor/layers/rotary_embedding/phi3_long_rope_scaled_rope.py +159 -0
  1064. vllm/model_executor/layers/rotary_embedding/xdrope.py +160 -0
  1065. vllm/model_executor/layers/rotary_embedding/yarn_scaling_rope.py +84 -0
  1066. vllm/model_executor/layers/utils.py +251 -0
  1067. vllm/model_executor/layers/vocab_parallel_embedding.py +564 -0
  1068. vllm/model_executor/model_loader/__init__.py +150 -0
  1069. vllm/model_executor/model_loader/base_loader.py +71 -0
  1070. vllm/model_executor/model_loader/bitsandbytes_loader.py +821 -0
  1071. vllm/model_executor/model_loader/default_loader.py +304 -0
  1072. vllm/model_executor/model_loader/dummy_loader.py +28 -0
  1073. vllm/model_executor/model_loader/gguf_loader.py +371 -0
  1074. vllm/model_executor/model_loader/online_quantization.py +275 -0
  1075. vllm/model_executor/model_loader/runai_streamer_loader.py +115 -0
  1076. vllm/model_executor/model_loader/sharded_state_loader.py +214 -0
  1077. vllm/model_executor/model_loader/tensorizer.py +793 -0
  1078. vllm/model_executor/model_loader/tensorizer_loader.py +151 -0
  1079. vllm/model_executor/model_loader/utils.py +299 -0
  1080. vllm/model_executor/model_loader/weight_utils.py +1183 -0
  1081. vllm/model_executor/models/__init__.py +44 -0
  1082. vllm/model_executor/models/adapters.py +592 -0
  1083. vllm/model_executor/models/afmoe.py +697 -0
  1084. vllm/model_executor/models/aimv2.py +248 -0
  1085. vllm/model_executor/models/apertus.py +567 -0
  1086. vllm/model_executor/models/arcee.py +428 -0
  1087. vllm/model_executor/models/arctic.py +633 -0
  1088. vllm/model_executor/models/aria.py +663 -0
  1089. vllm/model_executor/models/audioflamingo3.py +639 -0
  1090. vllm/model_executor/models/aya_vision.py +448 -0
  1091. vllm/model_executor/models/bagel.py +591 -0
  1092. vllm/model_executor/models/baichuan.py +493 -0
  1093. vllm/model_executor/models/bailing_moe.py +643 -0
  1094. vllm/model_executor/models/bamba.py +511 -0
  1095. vllm/model_executor/models/bee.py +157 -0
  1096. vllm/model_executor/models/bert.py +911 -0
  1097. vllm/model_executor/models/bert_with_rope.py +729 -0
  1098. vllm/model_executor/models/blip.py +350 -0
  1099. vllm/model_executor/models/blip2.py +736 -0
  1100. vllm/model_executor/models/bloom.py +390 -0
  1101. vllm/model_executor/models/chameleon.py +1095 -0
  1102. vllm/model_executor/models/chatglm.py +502 -0
  1103. vllm/model_executor/models/clip.py +1045 -0
  1104. vllm/model_executor/models/cohere2_vision.py +470 -0
  1105. vllm/model_executor/models/commandr.py +469 -0
  1106. vllm/model_executor/models/config.py +571 -0
  1107. vllm/model_executor/models/dbrx.py +484 -0
  1108. vllm/model_executor/models/deepencoder.py +679 -0
  1109. vllm/model_executor/models/deepseek_eagle.py +253 -0
  1110. vllm/model_executor/models/deepseek_mtp.py +447 -0
  1111. vllm/model_executor/models/deepseek_ocr.py +601 -0
  1112. vllm/model_executor/models/deepseek_v2.py +1727 -0
  1113. vllm/model_executor/models/deepseek_vl2.py +642 -0
  1114. vllm/model_executor/models/dots1.py +566 -0
  1115. vllm/model_executor/models/dots_ocr.py +830 -0
  1116. vllm/model_executor/models/ernie45.py +53 -0
  1117. vllm/model_executor/models/ernie45_moe.py +755 -0
  1118. vllm/model_executor/models/ernie45_vl.py +1702 -0
  1119. vllm/model_executor/models/ernie45_vl_moe.py +801 -0
  1120. vllm/model_executor/models/ernie_mtp.py +278 -0
  1121. vllm/model_executor/models/exaone.py +524 -0
  1122. vllm/model_executor/models/exaone4.py +518 -0
  1123. vllm/model_executor/models/exaone_moe.py +579 -0
  1124. vllm/model_executor/models/exaone_moe_mtp.py +255 -0
  1125. vllm/model_executor/models/fairseq2_llama.py +154 -0
  1126. vllm/model_executor/models/falcon.py +543 -0
  1127. vllm/model_executor/models/falcon_h1.py +675 -0
  1128. vllm/model_executor/models/flex_olmo.py +155 -0
  1129. vllm/model_executor/models/fuyu.py +371 -0
  1130. vllm/model_executor/models/gemma.py +425 -0
  1131. vllm/model_executor/models/gemma2.py +435 -0
  1132. vllm/model_executor/models/gemma3.py +520 -0
  1133. vllm/model_executor/models/gemma3_mm.py +664 -0
  1134. vllm/model_executor/models/gemma3n.py +1166 -0
  1135. vllm/model_executor/models/gemma3n_audio_utils.py +57 -0
  1136. vllm/model_executor/models/gemma3n_mm.py +820 -0
  1137. vllm/model_executor/models/glm.py +24 -0
  1138. vllm/model_executor/models/glm4.py +295 -0
  1139. vllm/model_executor/models/glm4_1v.py +1823 -0
  1140. vllm/model_executor/models/glm4_moe.py +725 -0
  1141. vllm/model_executor/models/glm4_moe_mtp.py +365 -0
  1142. vllm/model_executor/models/glm4v.py +783 -0
  1143. vllm/model_executor/models/glmasr.py +1154 -0
  1144. vllm/model_executor/models/glmasr_utils.py +188 -0
  1145. vllm/model_executor/models/gpt2.py +385 -0
  1146. vllm/model_executor/models/gpt_bigcode.py +339 -0
  1147. vllm/model_executor/models/gpt_j.py +346 -0
  1148. vllm/model_executor/models/gpt_neox.py +340 -0
  1149. vllm/model_executor/models/gpt_oss.py +745 -0
  1150. vllm/model_executor/models/granite.py +475 -0
  1151. vllm/model_executor/models/granite_speech.py +919 -0
  1152. vllm/model_executor/models/granitemoe.py +561 -0
  1153. vllm/model_executor/models/granitemoehybrid.py +703 -0
  1154. vllm/model_executor/models/granitemoeshared.py +328 -0
  1155. vllm/model_executor/models/gritlm.py +242 -0
  1156. vllm/model_executor/models/grok1.py +803 -0
  1157. vllm/model_executor/models/h2ovl.py +554 -0
  1158. vllm/model_executor/models/hunyuan_v1.py +1042 -0
  1159. vllm/model_executor/models/hunyuan_vision.py +1034 -0
  1160. vllm/model_executor/models/hyperclovax_vision.py +1163 -0
  1161. vllm/model_executor/models/idefics2_vision_model.py +427 -0
  1162. vllm/model_executor/models/idefics3.py +734 -0
  1163. vllm/model_executor/models/interfaces.py +1180 -0
  1164. vllm/model_executor/models/interfaces_base.py +252 -0
  1165. vllm/model_executor/models/intern_vit.py +454 -0
  1166. vllm/model_executor/models/internlm2.py +451 -0
  1167. vllm/model_executor/models/internlm2_ve.py +139 -0
  1168. vllm/model_executor/models/interns1.py +828 -0
  1169. vllm/model_executor/models/interns1_vit.py +433 -0
  1170. vllm/model_executor/models/internvl.py +1436 -0
  1171. vllm/model_executor/models/iquest_loopcoder.py +595 -0
  1172. vllm/model_executor/models/isaac.py +1503 -0
  1173. vllm/model_executor/models/jais.py +397 -0
  1174. vllm/model_executor/models/jais2.py +508 -0
  1175. vllm/model_executor/models/jamba.py +599 -0
  1176. vllm/model_executor/models/jina_vl.py +145 -0
  1177. vllm/model_executor/models/kanana_v.py +756 -0
  1178. vllm/model_executor/models/keye.py +1709 -0
  1179. vllm/model_executor/models/keye_vl1_5.py +726 -0
  1180. vllm/model_executor/models/kimi_linear.py +659 -0
  1181. vllm/model_executor/models/kimi_vl.py +577 -0
  1182. vllm/model_executor/models/lfm2.py +515 -0
  1183. vllm/model_executor/models/lfm2_moe.py +746 -0
  1184. vllm/model_executor/models/lfm2_vl.py +732 -0
  1185. vllm/model_executor/models/lightonocr.py +197 -0
  1186. vllm/model_executor/models/llama.py +724 -0
  1187. vllm/model_executor/models/llama4.py +860 -0
  1188. vllm/model_executor/models/llama4_eagle.py +225 -0
  1189. vllm/model_executor/models/llama_eagle.py +213 -0
  1190. vllm/model_executor/models/llama_eagle3.py +375 -0
  1191. vllm/model_executor/models/llava.py +879 -0
  1192. vllm/model_executor/models/llava_next.py +583 -0
  1193. vllm/model_executor/models/llava_next_video.py +467 -0
  1194. vllm/model_executor/models/llava_onevision.py +922 -0
  1195. vllm/model_executor/models/longcat_flash.py +767 -0
  1196. vllm/model_executor/models/longcat_flash_mtp.py +348 -0
  1197. vllm/model_executor/models/mamba.py +276 -0
  1198. vllm/model_executor/models/mamba2.py +288 -0
  1199. vllm/model_executor/models/medusa.py +179 -0
  1200. vllm/model_executor/models/midashenglm.py +826 -0
  1201. vllm/model_executor/models/mimo.py +188 -0
  1202. vllm/model_executor/models/mimo_mtp.py +294 -0
  1203. vllm/model_executor/models/mimo_v2_flash.py +718 -0
  1204. vllm/model_executor/models/minicpm.py +660 -0
  1205. vllm/model_executor/models/minicpm3.py +233 -0
  1206. vllm/model_executor/models/minicpm_eagle.py +386 -0
  1207. vllm/model_executor/models/minicpmo.py +768 -0
  1208. vllm/model_executor/models/minicpmv.py +1742 -0
  1209. vllm/model_executor/models/minimax_m2.py +552 -0
  1210. vllm/model_executor/models/minimax_text_01.py +1008 -0
  1211. vllm/model_executor/models/minimax_vl_01.py +395 -0
  1212. vllm/model_executor/models/mistral3.py +638 -0
  1213. vllm/model_executor/models/mistral_large_3.py +63 -0
  1214. vllm/model_executor/models/mistral_large_3_eagle.py +137 -0
  1215. vllm/model_executor/models/mixtral.py +599 -0
  1216. vllm/model_executor/models/mllama4.py +1170 -0
  1217. vllm/model_executor/models/mlp_speculator.py +235 -0
  1218. vllm/model_executor/models/modernbert.py +458 -0
  1219. vllm/model_executor/models/module_mapping.py +74 -0
  1220. vllm/model_executor/models/molmo.py +1592 -0
  1221. vllm/model_executor/models/moonvit.py +601 -0
  1222. vllm/model_executor/models/mpt.py +335 -0
  1223. vllm/model_executor/models/nano_nemotron_vl.py +1725 -0
  1224. vllm/model_executor/models/nemotron.py +499 -0
  1225. vllm/model_executor/models/nemotron_h.py +902 -0
  1226. vllm/model_executor/models/nemotron_nas.py +474 -0
  1227. vllm/model_executor/models/nemotron_parse.py +958 -0
  1228. vllm/model_executor/models/nemotron_vl.py +651 -0
  1229. vllm/model_executor/models/nvlm_d.py +216 -0
  1230. vllm/model_executor/models/olmo.py +412 -0
  1231. vllm/model_executor/models/olmo2.py +454 -0
  1232. vllm/model_executor/models/olmoe.py +498 -0
  1233. vllm/model_executor/models/opencua.py +262 -0
  1234. vllm/model_executor/models/openpangu.py +1378 -0
  1235. vllm/model_executor/models/openpangu_mtp.py +265 -0
  1236. vllm/model_executor/models/opt.py +426 -0
  1237. vllm/model_executor/models/orion.py +365 -0
  1238. vllm/model_executor/models/ouro.py +507 -0
  1239. vllm/model_executor/models/ovis.py +557 -0
  1240. vllm/model_executor/models/ovis2_5.py +661 -0
  1241. vllm/model_executor/models/paddleocr_vl.py +1261 -0
  1242. vllm/model_executor/models/paligemma.py +429 -0
  1243. vllm/model_executor/models/persimmon.py +373 -0
  1244. vllm/model_executor/models/phi.py +363 -0
  1245. vllm/model_executor/models/phi3.py +18 -0
  1246. vllm/model_executor/models/phi3v.py +729 -0
  1247. vllm/model_executor/models/phi4mm.py +1250 -0
  1248. vllm/model_executor/models/phi4mm_audio.py +1296 -0
  1249. vllm/model_executor/models/phi4mm_utils.py +1907 -0
  1250. vllm/model_executor/models/phimoe.py +671 -0
  1251. vllm/model_executor/models/pixtral.py +1437 -0
  1252. vllm/model_executor/models/plamo2.py +993 -0
  1253. vllm/model_executor/models/plamo3.py +437 -0
  1254. vllm/model_executor/models/qwen.py +377 -0
  1255. vllm/model_executor/models/qwen2.py +600 -0
  1256. vllm/model_executor/models/qwen2_5_omni_thinker.py +1200 -0
  1257. vllm/model_executor/models/qwen2_5_vl.py +1598 -0
  1258. vllm/model_executor/models/qwen2_audio.py +478 -0
  1259. vllm/model_executor/models/qwen2_moe.py +604 -0
  1260. vllm/model_executor/models/qwen2_rm.py +120 -0
  1261. vllm/model_executor/models/qwen2_vl.py +1588 -0
  1262. vllm/model_executor/models/qwen3.py +331 -0
  1263. vllm/model_executor/models/qwen3_moe.py +752 -0
  1264. vllm/model_executor/models/qwen3_next.py +1410 -0
  1265. vllm/model_executor/models/qwen3_next_mtp.py +293 -0
  1266. vllm/model_executor/models/qwen3_omni_moe_thinker.py +1814 -0
  1267. vllm/model_executor/models/qwen3_vl.py +2120 -0
  1268. vllm/model_executor/models/qwen3_vl_moe.py +474 -0
  1269. vllm/model_executor/models/qwen_vl.py +821 -0
  1270. vllm/model_executor/models/radio.py +573 -0
  1271. vllm/model_executor/models/registry.py +1218 -0
  1272. vllm/model_executor/models/roberta.py +239 -0
  1273. vllm/model_executor/models/rvl.py +107 -0
  1274. vllm/model_executor/models/seed_oss.py +492 -0
  1275. vllm/model_executor/models/siglip.py +1259 -0
  1276. vllm/model_executor/models/siglip2.py +495 -0
  1277. vllm/model_executor/models/siglip2navit.py +660 -0
  1278. vllm/model_executor/models/skyworkr1v.py +951 -0
  1279. vllm/model_executor/models/smolvlm.py +38 -0
  1280. vllm/model_executor/models/solar.py +484 -0
  1281. vllm/model_executor/models/stablelm.py +354 -0
  1282. vllm/model_executor/models/starcoder2.py +365 -0
  1283. vllm/model_executor/models/step3_text.py +554 -0
  1284. vllm/model_executor/models/step3_vl.py +1147 -0
  1285. vllm/model_executor/models/swin.py +500 -0
  1286. vllm/model_executor/models/tarsier.py +624 -0
  1287. vllm/model_executor/models/telechat2.py +153 -0
  1288. vllm/model_executor/models/teleflm.py +78 -0
  1289. vllm/model_executor/models/terratorch.py +318 -0
  1290. vllm/model_executor/models/transformers/__init__.py +127 -0
  1291. vllm/model_executor/models/transformers/base.py +523 -0
  1292. vllm/model_executor/models/transformers/causal.py +65 -0
  1293. vllm/model_executor/models/transformers/legacy.py +90 -0
  1294. vllm/model_executor/models/transformers/moe.py +329 -0
  1295. vllm/model_executor/models/transformers/multimodal.py +441 -0
  1296. vllm/model_executor/models/transformers/pooling.py +102 -0
  1297. vllm/model_executor/models/transformers/utils.py +253 -0
  1298. vllm/model_executor/models/ultravox.py +786 -0
  1299. vllm/model_executor/models/utils.py +832 -0
  1300. vllm/model_executor/models/vision.py +546 -0
  1301. vllm/model_executor/models/voxtral.py +867 -0
  1302. vllm/model_executor/models/voxtral_streaming.py +304 -0
  1303. vllm/model_executor/models/whisper.py +993 -0
  1304. vllm/model_executor/models/whisper_utils.py +299 -0
  1305. vllm/model_executor/models/zamba2.py +986 -0
  1306. vllm/model_executor/parameter.py +642 -0
  1307. vllm/model_executor/utils.py +113 -0
  1308. vllm/model_executor/warmup/__init__.py +0 -0
  1309. vllm/model_executor/warmup/deep_gemm_warmup.py +371 -0
  1310. vllm/model_executor/warmup/kernel_warmup.py +97 -0
  1311. vllm/model_inspection.py +136 -0
  1312. vllm/multimodal/__init__.py +38 -0
  1313. vllm/multimodal/audio.py +287 -0
  1314. vllm/multimodal/base.py +60 -0
  1315. vllm/multimodal/cache.py +829 -0
  1316. vllm/multimodal/evs.py +294 -0
  1317. vllm/multimodal/hasher.py +123 -0
  1318. vllm/multimodal/image.py +155 -0
  1319. vllm/multimodal/inputs.py +1027 -0
  1320. vllm/multimodal/parse.py +674 -0
  1321. vllm/multimodal/processing.py +2469 -0
  1322. vllm/multimodal/profiling.py +351 -0
  1323. vllm/multimodal/registry.py +375 -0
  1324. vllm/multimodal/utils.py +550 -0
  1325. vllm/multimodal/video.py +512 -0
  1326. vllm/outputs.py +347 -0
  1327. vllm/platforms/__init__.py +277 -0
  1328. vllm/platforms/cpu.py +423 -0
  1329. vllm/platforms/cuda.py +618 -0
  1330. vllm/platforms/interface.py +707 -0
  1331. vllm/platforms/rocm.py +586 -0
  1332. vllm/platforms/tpu.py +20 -0
  1333. vllm/platforms/xpu.py +262 -0
  1334. vllm/plugins/__init__.py +81 -0
  1335. vllm/plugins/io_processors/__init__.py +68 -0
  1336. vllm/plugins/io_processors/interface.py +77 -0
  1337. vllm/plugins/lora_resolvers/__init__.py +0 -0
  1338. vllm/plugins/lora_resolvers/filesystem_resolver.py +52 -0
  1339. vllm/pooling_params.py +229 -0
  1340. vllm/profiler/__init__.py +0 -0
  1341. vllm/profiler/layerwise_profile.py +392 -0
  1342. vllm/profiler/utils.py +151 -0
  1343. vllm/profiler/wrapper.py +241 -0
  1344. vllm/py.typed +2 -0
  1345. vllm/ray/__init__.py +0 -0
  1346. vllm/ray/lazy_utils.py +30 -0
  1347. vllm/ray/ray_env.py +79 -0
  1348. vllm/reasoning/__init__.py +96 -0
  1349. vllm/reasoning/abs_reasoning_parsers.py +318 -0
  1350. vllm/reasoning/basic_parsers.py +175 -0
  1351. vllm/reasoning/deepseek_r1_reasoning_parser.py +67 -0
  1352. vllm/reasoning/deepseek_v3_reasoning_parser.py +69 -0
  1353. vllm/reasoning/ernie45_reasoning_parser.py +165 -0
  1354. vllm/reasoning/glm4_moe_reasoning_parser.py +13 -0
  1355. vllm/reasoning/gptoss_reasoning_parser.py +173 -0
  1356. vllm/reasoning/granite_reasoning_parser.py +363 -0
  1357. vllm/reasoning/holo2_reasoning_parser.py +89 -0
  1358. vllm/reasoning/hunyuan_a13b_reasoning_parser.py +237 -0
  1359. vllm/reasoning/identity_reasoning_parser.py +63 -0
  1360. vllm/reasoning/minimax_m2_reasoning_parser.py +110 -0
  1361. vllm/reasoning/mistral_reasoning_parser.py +154 -0
  1362. vllm/reasoning/olmo3_reasoning_parser.py +302 -0
  1363. vllm/reasoning/qwen3_reasoning_parser.py +67 -0
  1364. vllm/reasoning/seedoss_reasoning_parser.py +27 -0
  1365. vllm/reasoning/step3_reasoning_parser.py +113 -0
  1366. vllm/sampling_params.py +629 -0
  1367. vllm/scalar_type.py +355 -0
  1368. vllm/scripts.py +17 -0
  1369. vllm/sequence.py +64 -0
  1370. vllm/tasks.py +13 -0
  1371. vllm/third_party/__init__.py +0 -0
  1372. vllm/third_party/pynvml.py +6140 -0
  1373. vllm/tokenizers/__init__.py +18 -0
  1374. vllm/tokenizers/deepseek_v32.py +187 -0
  1375. vllm/tokenizers/deepseek_v32_encoding.py +463 -0
  1376. vllm/tokenizers/detokenizer_utils.py +198 -0
  1377. vllm/tokenizers/grok2.py +443 -0
  1378. vllm/tokenizers/hf.py +119 -0
  1379. vllm/tokenizers/mistral.py +543 -0
  1380. vllm/tokenizers/protocol.py +123 -0
  1381. vllm/tokenizers/registry.py +238 -0
  1382. vllm/tool_parsers/__init__.py +158 -0
  1383. vllm/tool_parsers/abstract_tool_parser.py +274 -0
  1384. vllm/tool_parsers/deepseekv31_tool_parser.py +388 -0
  1385. vllm/tool_parsers/deepseekv32_tool_parser.py +591 -0
  1386. vllm/tool_parsers/deepseekv3_tool_parser.py +390 -0
  1387. vllm/tool_parsers/ernie45_tool_parser.py +210 -0
  1388. vllm/tool_parsers/functiongemma_tool_parser.py +321 -0
  1389. vllm/tool_parsers/gigachat3_tool_parser.py +190 -0
  1390. vllm/tool_parsers/glm47_moe_tool_parser.py +23 -0
  1391. vllm/tool_parsers/glm4_moe_tool_parser.py +215 -0
  1392. vllm/tool_parsers/granite_20b_fc_tool_parser.py +273 -0
  1393. vllm/tool_parsers/granite_tool_parser.py +253 -0
  1394. vllm/tool_parsers/hermes_tool_parser.py +495 -0
  1395. vllm/tool_parsers/hunyuan_a13b_tool_parser.py +420 -0
  1396. vllm/tool_parsers/internlm2_tool_parser.py +227 -0
  1397. vllm/tool_parsers/jamba_tool_parser.py +323 -0
  1398. vllm/tool_parsers/kimi_k2_tool_parser.py +598 -0
  1399. vllm/tool_parsers/llama4_pythonic_tool_parser.py +341 -0
  1400. vllm/tool_parsers/llama_tool_parser.py +324 -0
  1401. vllm/tool_parsers/longcat_tool_parser.py +37 -0
  1402. vllm/tool_parsers/minimax_m2_tool_parser.py +776 -0
  1403. vllm/tool_parsers/minimax_tool_parser.py +849 -0
  1404. vllm/tool_parsers/mistral_tool_parser.py +612 -0
  1405. vllm/tool_parsers/olmo3_tool_parser.py +366 -0
  1406. vllm/tool_parsers/openai_tool_parser.py +111 -0
  1407. vllm/tool_parsers/phi4mini_tool_parser.py +120 -0
  1408. vllm/tool_parsers/pythonic_tool_parser.py +332 -0
  1409. vllm/tool_parsers/qwen3coder_tool_parser.py +781 -0
  1410. vllm/tool_parsers/qwen3xml_tool_parser.py +1316 -0
  1411. vllm/tool_parsers/seed_oss_tool_parser.py +744 -0
  1412. vllm/tool_parsers/step3_tool_parser.py +303 -0
  1413. vllm/tool_parsers/utils.py +229 -0
  1414. vllm/tool_parsers/xlam_tool_parser.py +556 -0
  1415. vllm/tracing.py +135 -0
  1416. vllm/transformers_utils/__init__.py +26 -0
  1417. vllm/transformers_utils/chat_templates/__init__.py +5 -0
  1418. vllm/transformers_utils/chat_templates/registry.py +73 -0
  1419. vllm/transformers_utils/chat_templates/template_basic.jinja +3 -0
  1420. vllm/transformers_utils/chat_templates/template_blip2.jinja +11 -0
  1421. vllm/transformers_utils/chat_templates/template_chatml.jinja +10 -0
  1422. vllm/transformers_utils/chat_templates/template_deepseek_ocr.jinja +14 -0
  1423. vllm/transformers_utils/chat_templates/template_deepseek_vl2.jinja +23 -0
  1424. vllm/transformers_utils/chat_templates/template_fuyu.jinja +3 -0
  1425. vllm/transformers_utils/chat_templates/template_minicpmv45.jinja +93 -0
  1426. vllm/transformers_utils/config.py +1169 -0
  1427. vllm/transformers_utils/config_parser_base.py +20 -0
  1428. vllm/transformers_utils/configs/__init__.py +106 -0
  1429. vllm/transformers_utils/configs/afmoe.py +87 -0
  1430. vllm/transformers_utils/configs/arctic.py +216 -0
  1431. vllm/transformers_utils/configs/bagel.py +53 -0
  1432. vllm/transformers_utils/configs/chatglm.py +75 -0
  1433. vllm/transformers_utils/configs/deepseek_vl2.py +126 -0
  1434. vllm/transformers_utils/configs/dotsocr.py +71 -0
  1435. vllm/transformers_utils/configs/eagle.py +90 -0
  1436. vllm/transformers_utils/configs/falcon.py +89 -0
  1437. vllm/transformers_utils/configs/flex_olmo.py +82 -0
  1438. vllm/transformers_utils/configs/hunyuan_vl.py +322 -0
  1439. vllm/transformers_utils/configs/isaac.py +100 -0
  1440. vllm/transformers_utils/configs/jais.py +243 -0
  1441. vllm/transformers_utils/configs/kimi_linear.py +148 -0
  1442. vllm/transformers_utils/configs/kimi_vl.py +38 -0
  1443. vllm/transformers_utils/configs/lfm2_moe.py +163 -0
  1444. vllm/transformers_utils/configs/medusa.py +65 -0
  1445. vllm/transformers_utils/configs/midashenglm.py +103 -0
  1446. vllm/transformers_utils/configs/mistral.py +263 -0
  1447. vllm/transformers_utils/configs/mlp_speculator.py +69 -0
  1448. vllm/transformers_utils/configs/moonvit.py +33 -0
  1449. vllm/transformers_utils/configs/nemotron.py +220 -0
  1450. vllm/transformers_utils/configs/nemotron_h.py +284 -0
  1451. vllm/transformers_utils/configs/olmo3.py +83 -0
  1452. vllm/transformers_utils/configs/ovis.py +182 -0
  1453. vllm/transformers_utils/configs/qwen3_next.py +277 -0
  1454. vllm/transformers_utils/configs/radio.py +98 -0
  1455. vllm/transformers_utils/configs/speculators/__init__.py +2 -0
  1456. vllm/transformers_utils/configs/speculators/algos.py +38 -0
  1457. vllm/transformers_utils/configs/speculators/base.py +114 -0
  1458. vllm/transformers_utils/configs/step3_vl.py +178 -0
  1459. vllm/transformers_utils/configs/tarsier2.py +24 -0
  1460. vllm/transformers_utils/configs/ultravox.py +120 -0
  1461. vllm/transformers_utils/dynamic_module.py +70 -0
  1462. vllm/transformers_utils/gguf_utils.py +280 -0
  1463. vllm/transformers_utils/model_arch_config_convertor.py +402 -0
  1464. vllm/transformers_utils/processor.py +424 -0
  1465. vllm/transformers_utils/processors/__init__.py +25 -0
  1466. vllm/transformers_utils/processors/bagel.py +78 -0
  1467. vllm/transformers_utils/processors/deepseek_ocr.py +438 -0
  1468. vllm/transformers_utils/processors/deepseek_vl2.py +406 -0
  1469. vllm/transformers_utils/processors/hunyuan_vl.py +233 -0
  1470. vllm/transformers_utils/processors/hunyuan_vl_image.py +477 -0
  1471. vllm/transformers_utils/processors/ovis.py +453 -0
  1472. vllm/transformers_utils/processors/ovis2_5.py +468 -0
  1473. vllm/transformers_utils/repo_utils.py +287 -0
  1474. vllm/transformers_utils/runai_utils.py +102 -0
  1475. vllm/transformers_utils/s3_utils.py +95 -0
  1476. vllm/transformers_utils/tokenizer.py +19 -0
  1477. vllm/transformers_utils/utils.py +112 -0
  1478. vllm/triton_utils/__init__.py +20 -0
  1479. vllm/triton_utils/importing.py +103 -0
  1480. vllm/usage/__init__.py +0 -0
  1481. vllm/usage/usage_lib.py +278 -0
  1482. vllm/utils/__init__.py +36 -0
  1483. vllm/utils/argparse_utils.py +491 -0
  1484. vllm/utils/async_utils.py +310 -0
  1485. vllm/utils/cache.py +214 -0
  1486. vllm/utils/collection_utils.py +112 -0
  1487. vllm/utils/counter.py +45 -0
  1488. vllm/utils/deep_gemm.py +424 -0
  1489. vllm/utils/flashinfer.py +602 -0
  1490. vllm/utils/func_utils.py +236 -0
  1491. vllm/utils/gc_utils.py +151 -0
  1492. vllm/utils/hashing.py +117 -0
  1493. vllm/utils/import_utils.py +438 -0
  1494. vllm/utils/jsontree.py +158 -0
  1495. vllm/utils/math_utils.py +32 -0
  1496. vllm/utils/mem_constants.py +13 -0
  1497. vllm/utils/mem_utils.py +285 -0
  1498. vllm/utils/nccl.py +64 -0
  1499. vllm/utils/network_utils.py +331 -0
  1500. vllm/utils/nvtx_pytorch_hooks.py +286 -0
  1501. vllm/utils/platform_utils.py +59 -0
  1502. vllm/utils/profiling.py +56 -0
  1503. vllm/utils/registry.py +51 -0
  1504. vllm/utils/serial_utils.py +214 -0
  1505. vllm/utils/system_utils.py +296 -0
  1506. vllm/utils/tensor_schema.py +255 -0
  1507. vllm/utils/torch_utils.py +781 -0
  1508. vllm/v1/__init__.py +0 -0
  1509. vllm/v1/attention/__init__.py +0 -0
  1510. vllm/v1/attention/backend.py +736 -0
  1511. vllm/v1/attention/backends/__init__.py +0 -0
  1512. vllm/v1/attention/backends/cpu_attn.py +501 -0
  1513. vllm/v1/attention/backends/fa_utils.py +126 -0
  1514. vllm/v1/attention/backends/flash_attn.py +1092 -0
  1515. vllm/v1/attention/backends/flash_attn_diffkv.py +277 -0
  1516. vllm/v1/attention/backends/flashinfer.py +1713 -0
  1517. vllm/v1/attention/backends/flex_attention.py +1024 -0
  1518. vllm/v1/attention/backends/gdn_attn.py +382 -0
  1519. vllm/v1/attention/backends/linear_attn.py +77 -0
  1520. vllm/v1/attention/backends/mamba1_attn.py +28 -0
  1521. vllm/v1/attention/backends/mamba2_attn.py +256 -0
  1522. vllm/v1/attention/backends/mamba_attn.py +313 -0
  1523. vllm/v1/attention/backends/mla/__init__.py +0 -0
  1524. vllm/v1/attention/backends/mla/aiter_triton_mla.py +66 -0
  1525. vllm/v1/attention/backends/mla/common.py +2156 -0
  1526. vllm/v1/attention/backends/mla/cutlass_mla.py +278 -0
  1527. vllm/v1/attention/backends/mla/flashattn_mla.py +348 -0
  1528. vllm/v1/attention/backends/mla/flashinfer_mla.py +175 -0
  1529. vllm/v1/attention/backends/mla/flashmla.py +321 -0
  1530. vllm/v1/attention/backends/mla/flashmla_sparse.py +1021 -0
  1531. vllm/v1/attention/backends/mla/indexer.py +345 -0
  1532. vllm/v1/attention/backends/mla/rocm_aiter_mla.py +284 -0
  1533. vllm/v1/attention/backends/mla/rocm_aiter_mla_sparse.py +321 -0
  1534. vllm/v1/attention/backends/mla/triton_mla.py +171 -0
  1535. vllm/v1/attention/backends/registry.py +258 -0
  1536. vllm/v1/attention/backends/rocm_aiter_fa.py +1000 -0
  1537. vllm/v1/attention/backends/rocm_aiter_unified_attn.py +206 -0
  1538. vllm/v1/attention/backends/rocm_attn.py +405 -0
  1539. vllm/v1/attention/backends/short_conv_attn.py +26 -0
  1540. vllm/v1/attention/backends/tree_attn.py +430 -0
  1541. vllm/v1/attention/backends/triton_attn.py +578 -0
  1542. vllm/v1/attention/backends/utils.py +978 -0
  1543. vllm/v1/attention/ops/__init__.py +0 -0
  1544. vllm/v1/attention/ops/chunked_prefill_paged_decode.py +459 -0
  1545. vllm/v1/attention/ops/common.py +469 -0
  1546. vllm/v1/attention/ops/flashmla.py +254 -0
  1547. vllm/v1/attention/ops/merge_attn_states.py +47 -0
  1548. vllm/v1/attention/ops/paged_attn.py +51 -0
  1549. vllm/v1/attention/ops/pallas_kv_cache_update.py +130 -0
  1550. vllm/v1/attention/ops/prefix_prefill.py +862 -0
  1551. vllm/v1/attention/ops/rocm_aiter_mla_sparse.py +210 -0
  1552. vllm/v1/attention/ops/triton_decode_attention.py +709 -0
  1553. vllm/v1/attention/ops/triton_merge_attn_states.py +116 -0
  1554. vllm/v1/attention/ops/triton_prefill_attention.py +272 -0
  1555. vllm/v1/attention/ops/triton_reshape_and_cache_flash.py +395 -0
  1556. vllm/v1/attention/ops/triton_unified_attention.py +1088 -0
  1557. vllm/v1/attention/ops/vit_attn_wrappers.py +185 -0
  1558. vllm/v1/attention/selector.py +145 -0
  1559. vllm/v1/core/__init__.py +0 -0
  1560. vllm/v1/core/block_pool.py +489 -0
  1561. vllm/v1/core/encoder_cache_manager.py +402 -0
  1562. vllm/v1/core/kv_cache_coordinator.py +560 -0
  1563. vllm/v1/core/kv_cache_manager.py +485 -0
  1564. vllm/v1/core/kv_cache_metrics.py +96 -0
  1565. vllm/v1/core/kv_cache_utils.py +1642 -0
  1566. vllm/v1/core/sched/__init__.py +0 -0
  1567. vllm/v1/core/sched/async_scheduler.py +66 -0
  1568. vllm/v1/core/sched/interface.py +205 -0
  1569. vllm/v1/core/sched/output.py +261 -0
  1570. vllm/v1/core/sched/request_queue.py +208 -0
  1571. vllm/v1/core/sched/scheduler.py +1936 -0
  1572. vllm/v1/core/sched/utils.py +64 -0
  1573. vllm/v1/core/single_type_kv_cache_manager.py +926 -0
  1574. vllm/v1/cudagraph_dispatcher.py +183 -0
  1575. vllm/v1/engine/__init__.py +224 -0
  1576. vllm/v1/engine/async_llm.py +874 -0
  1577. vllm/v1/engine/coordinator.py +396 -0
  1578. vllm/v1/engine/core.py +1614 -0
  1579. vllm/v1/engine/core_client.py +1422 -0
  1580. vllm/v1/engine/detokenizer.py +351 -0
  1581. vllm/v1/engine/exceptions.py +18 -0
  1582. vllm/v1/engine/input_processor.py +713 -0
  1583. vllm/v1/engine/llm_engine.py +415 -0
  1584. vllm/v1/engine/logprobs.py +245 -0
  1585. vllm/v1/engine/output_processor.py +715 -0
  1586. vllm/v1/engine/parallel_sampling.py +150 -0
  1587. vllm/v1/engine/utils.py +1086 -0
  1588. vllm/v1/executor/__init__.py +6 -0
  1589. vllm/v1/executor/abstract.py +352 -0
  1590. vllm/v1/executor/multiproc_executor.py +888 -0
  1591. vllm/v1/executor/ray_distributed_executor.py +8 -0
  1592. vllm/v1/executor/ray_executor.py +623 -0
  1593. vllm/v1/executor/ray_utils.py +468 -0
  1594. vllm/v1/executor/uniproc_executor.py +186 -0
  1595. vllm/v1/kv_cache_interface.py +485 -0
  1596. vllm/v1/kv_offload/__init__.py +0 -0
  1597. vllm/v1/kv_offload/abstract.py +161 -0
  1598. vllm/v1/kv_offload/arc_manager.py +237 -0
  1599. vllm/v1/kv_offload/backend.py +97 -0
  1600. vllm/v1/kv_offload/backends/__init__.py +0 -0
  1601. vllm/v1/kv_offload/backends/cpu.py +62 -0
  1602. vllm/v1/kv_offload/cpu.py +109 -0
  1603. vllm/v1/kv_offload/factory.py +58 -0
  1604. vllm/v1/kv_offload/lru_manager.py +139 -0
  1605. vllm/v1/kv_offload/mediums.py +39 -0
  1606. vllm/v1/kv_offload/spec.py +70 -0
  1607. vllm/v1/kv_offload/worker/__init__.py +0 -0
  1608. vllm/v1/kv_offload/worker/cpu_gpu.py +287 -0
  1609. vllm/v1/kv_offload/worker/worker.py +163 -0
  1610. vllm/v1/metrics/__init__.py +0 -0
  1611. vllm/v1/metrics/loggers.py +1320 -0
  1612. vllm/v1/metrics/perf.py +1244 -0
  1613. vllm/v1/metrics/prometheus.py +82 -0
  1614. vllm/v1/metrics/ray_wrappers.py +194 -0
  1615. vllm/v1/metrics/reader.py +257 -0
  1616. vllm/v1/metrics/stats.py +440 -0
  1617. vllm/v1/outputs.py +242 -0
  1618. vllm/v1/pool/__init__.py +0 -0
  1619. vllm/v1/pool/metadata.py +124 -0
  1620. vllm/v1/request.py +281 -0
  1621. vllm/v1/sample/__init__.py +0 -0
  1622. vllm/v1/sample/logits_processor/__init__.py +352 -0
  1623. vllm/v1/sample/logits_processor/builtin.py +278 -0
  1624. vllm/v1/sample/logits_processor/interface.py +106 -0
  1625. vllm/v1/sample/logits_processor/state.py +165 -0
  1626. vllm/v1/sample/metadata.py +44 -0
  1627. vllm/v1/sample/ops/__init__.py +0 -0
  1628. vllm/v1/sample/ops/bad_words.py +57 -0
  1629. vllm/v1/sample/ops/logprobs.py +25 -0
  1630. vllm/v1/sample/ops/penalties.py +57 -0
  1631. vllm/v1/sample/ops/topk_topp_sampler.py +388 -0
  1632. vllm/v1/sample/rejection_sampler.py +822 -0
  1633. vllm/v1/sample/sampler.py +319 -0
  1634. vllm/v1/sample/tpu/__init__.py +0 -0
  1635. vllm/v1/sample/tpu/metadata.py +120 -0
  1636. vllm/v1/sample/tpu/sampler.py +215 -0
  1637. vllm/v1/serial_utils.py +514 -0
  1638. vllm/v1/spec_decode/__init__.py +0 -0
  1639. vllm/v1/spec_decode/eagle.py +1346 -0
  1640. vllm/v1/spec_decode/medusa.py +73 -0
  1641. vllm/v1/spec_decode/metadata.py +66 -0
  1642. vllm/v1/spec_decode/metrics.py +225 -0
  1643. vllm/v1/spec_decode/ngram_proposer.py +281 -0
  1644. vllm/v1/spec_decode/suffix_decoding.py +95 -0
  1645. vllm/v1/spec_decode/utils.py +109 -0
  1646. vllm/v1/structured_output/__init__.py +337 -0
  1647. vllm/v1/structured_output/backend_guidance.py +291 -0
  1648. vllm/v1/structured_output/backend_lm_format_enforcer.py +177 -0
  1649. vllm/v1/structured_output/backend_outlines.py +324 -0
  1650. vllm/v1/structured_output/backend_types.py +136 -0
  1651. vllm/v1/structured_output/backend_xgrammar.py +378 -0
  1652. vllm/v1/structured_output/request.py +91 -0
  1653. vllm/v1/structured_output/utils.py +457 -0
  1654. vllm/v1/utils.py +466 -0
  1655. vllm/v1/worker/__init__.py +0 -0
  1656. vllm/v1/worker/block_table.py +343 -0
  1657. vllm/v1/worker/cp_utils.py +42 -0
  1658. vllm/v1/worker/cpu_model_runner.py +122 -0
  1659. vllm/v1/worker/cpu_worker.py +192 -0
  1660. vllm/v1/worker/dp_utils.py +240 -0
  1661. vllm/v1/worker/ec_connector_model_runner_mixin.py +85 -0
  1662. vllm/v1/worker/gpu/README.md +4 -0
  1663. vllm/v1/worker/gpu/__init__.py +0 -0
  1664. vllm/v1/worker/gpu/async_utils.py +98 -0
  1665. vllm/v1/worker/gpu/attn_utils.py +183 -0
  1666. vllm/v1/worker/gpu/block_table.py +222 -0
  1667. vllm/v1/worker/gpu/buffer_utils.py +224 -0
  1668. vllm/v1/worker/gpu/cudagraph_utils.py +264 -0
  1669. vllm/v1/worker/gpu/dp_utils.py +31 -0
  1670. vllm/v1/worker/gpu/input_batch.py +526 -0
  1671. vllm/v1/worker/gpu/metrics/__init__.py +0 -0
  1672. vllm/v1/worker/gpu/metrics/logits.py +42 -0
  1673. vllm/v1/worker/gpu/mm/__init__.py +0 -0
  1674. vllm/v1/worker/gpu/mm/mrope_utils.py +127 -0
  1675. vllm/v1/worker/gpu/model_runner.py +1005 -0
  1676. vllm/v1/worker/gpu/sample/__init__.py +0 -0
  1677. vllm/v1/worker/gpu/sample/gumbel.py +106 -0
  1678. vllm/v1/worker/gpu/sample/logit_bias.py +270 -0
  1679. vllm/v1/worker/gpu/sample/logprob.py +167 -0
  1680. vllm/v1/worker/gpu/sample/metadata.py +79 -0
  1681. vllm/v1/worker/gpu/sample/min_p.py +58 -0
  1682. vllm/v1/worker/gpu/sample/output.py +14 -0
  1683. vllm/v1/worker/gpu/sample/penalties.py +155 -0
  1684. vllm/v1/worker/gpu/sample/sampler.py +88 -0
  1685. vllm/v1/worker/gpu/spec_decode/__init__.py +18 -0
  1686. vllm/v1/worker/gpu/spec_decode/eagle.py +566 -0
  1687. vllm/v1/worker/gpu/spec_decode/eagle_cudagraph.py +115 -0
  1688. vllm/v1/worker/gpu/spec_decode/rejection_sample.py +71 -0
  1689. vllm/v1/worker/gpu/states.py +282 -0
  1690. vllm/v1/worker/gpu/structured_outputs.py +100 -0
  1691. vllm/v1/worker/gpu_input_batch.py +1030 -0
  1692. vllm/v1/worker/gpu_model_runner.py +5761 -0
  1693. vllm/v1/worker/gpu_ubatch_wrapper.py +475 -0
  1694. vllm/v1/worker/gpu_worker.py +968 -0
  1695. vllm/v1/worker/kv_connector_model_runner_mixin.py +300 -0
  1696. vllm/v1/worker/lora_model_runner_mixin.py +225 -0
  1697. vllm/v1/worker/tpu_input_batch.py +574 -0
  1698. vllm/v1/worker/tpu_worker.py +18 -0
  1699. vllm/v1/worker/ubatch_utils.py +112 -0
  1700. vllm/v1/worker/ubatching.py +242 -0
  1701. vllm/v1/worker/utils.py +400 -0
  1702. vllm/v1/worker/worker_base.py +372 -0
  1703. vllm/v1/worker/workspace.py +253 -0
  1704. vllm/v1/worker/xpu_model_runner.py +48 -0
  1705. vllm/v1/worker/xpu_worker.py +174 -0
  1706. vllm/version.py +39 -0
  1707. vllm/vllm_flash_attn/.gitkeep +0 -0
  1708. vllm_cpu_avx512bf16-0.14.0.dist-info/METADATA +348 -0
  1709. vllm_cpu_avx512bf16-0.14.0.dist-info/RECORD +1712 -0
  1710. vllm_cpu_avx512bf16-0.14.0.dist-info/WHEEL +5 -0
  1711. vllm_cpu_avx512bf16-0.14.0.dist-info/entry_points.txt +5 -0
  1712. vllm_cpu_avx512bf16-0.14.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1912 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+
4
+ import asyncio
5
+ import inspect
6
+ import json
7
+ from abc import ABC, abstractmethod
8
+ from collections import Counter, defaultdict, deque
9
+ from collections.abc import Awaitable, Callable, Iterable
10
+ from functools import cached_property, lru_cache, partial
11
+ from pathlib import Path
12
+ from typing import TYPE_CHECKING, Any, Generic, Literal, TypeAlias, TypeVar, cast
13
+
14
+ import jinja2
15
+ import jinja2.ext
16
+ import jinja2.meta
17
+ import jinja2.nodes
18
+ import jinja2.parser
19
+ import jinja2.sandbox
20
+ import transformers.utils.chat_template_utils as hf_chat_utils
21
+ from openai.types.chat import (
22
+ ChatCompletionAssistantMessageParam,
23
+ ChatCompletionContentPartImageParam,
24
+ ChatCompletionContentPartInputAudioParam,
25
+ ChatCompletionContentPartRefusalParam,
26
+ ChatCompletionContentPartTextParam,
27
+ ChatCompletionFunctionToolParam,
28
+ ChatCompletionMessageToolCallParam,
29
+ ChatCompletionToolMessageParam,
30
+ )
31
+ from openai.types.chat import (
32
+ ChatCompletionContentPartParam as OpenAIChatCompletionContentPartParam,
33
+ )
34
+ from openai.types.chat import (
35
+ ChatCompletionMessageParam as OpenAIChatCompletionMessageParam,
36
+ )
37
+ from openai.types.chat.chat_completion_content_part_input_audio_param import InputAudio
38
+ from openai.types.responses import ResponseInputImageParam
39
+ from openai_harmony import Message as OpenAIHarmonyMessage
40
+ from PIL import Image
41
+ from pydantic import BaseModel, ConfigDict, TypeAdapter
42
+ from transformers import PreTrainedTokenizer, PreTrainedTokenizerFast, ProcessorMixin
43
+
44
+ # pydantic needs the TypedDict from typing_extensions
45
+ from typing_extensions import Required, TypedDict
46
+
47
+ from vllm import envs
48
+ from vllm.config import ModelConfig
49
+ from vllm.logger import init_logger
50
+ from vllm.model_executor.models import SupportsMultiModal
51
+ from vllm.multimodal import MULTIMODAL_REGISTRY, MultiModalDataDict, MultiModalUUIDDict
52
+ from vllm.multimodal.utils import MEDIA_CONNECTOR_REGISTRY, MediaConnector
53
+ from vllm.tokenizers import TokenizerLike
54
+ from vllm.transformers_utils.chat_templates import get_chat_template_fallback_path
55
+ from vllm.transformers_utils.processor import cached_get_processor
56
+ from vllm.utils import random_uuid
57
+ from vllm.utils.collection_utils import is_list_of
58
+ from vllm.utils.func_utils import supports_kw
59
+ from vllm.utils.import_utils import LazyLoader
60
+
61
+ if TYPE_CHECKING:
62
+ import torch
63
+
64
+ from vllm.tokenizers.mistral import MistralTokenizer
65
+ else:
66
+ torch = LazyLoader("torch", globals(), "torch")
67
+
68
+ logger = init_logger(__name__)
69
+
70
+
71
+ class ChatTemplateResolutionError(ValueError):
72
+ """Raised when chat template resolution fails.
73
+
74
+ This is a subclass of ValueError for backward compatibility with
75
+ existing exception handlers.
76
+ """
77
+
78
+
79
+ MODALITY_PLACEHOLDERS_MAP = {
80
+ "image": "<##IMAGE##>",
81
+ "audio": "<##AUDIO##>",
82
+ "video": "<##VIDEO##>",
83
+ }
84
+
85
+
86
+ class AudioURL(TypedDict, total=False):
87
+ url: Required[str]
88
+ """
89
+ Either a URL of the audio or a data URL with base64 encoded audio data.
90
+ """
91
+
92
+
93
+ class ChatCompletionContentPartAudioParam(TypedDict, total=False):
94
+ audio_url: Required[AudioURL]
95
+
96
+ type: Required[Literal["audio_url"]]
97
+ """The type of the content part."""
98
+
99
+
100
+ class ChatCompletionContentPartImageEmbedsParam(TypedDict, total=False):
101
+ image_embeds: str | dict[str, str] | None
102
+ """
103
+ The image embeddings. It can be either:
104
+ - A single base64 string.
105
+ - A dictionary where each value is a base64 string.
106
+ """
107
+ type: Required[Literal["image_embeds"]]
108
+ """The type of the content part."""
109
+ uuid: str | None
110
+ """
111
+ User-provided UUID of a media. User must guarantee that it is properly
112
+ generated and unique for different medias.
113
+ """
114
+
115
+
116
+ class ChatCompletionContentPartAudioEmbedsParam(TypedDict, total=False):
117
+ audio_embeds: str | dict[str, str] | None
118
+ """
119
+ The audio embeddings. It can be either:
120
+ - A single base64 string representing a serialized torch tensor.
121
+ - A dictionary where each value is a base64 string.
122
+ """
123
+ type: Required[Literal["audio_embeds"]]
124
+ """The type of the content part."""
125
+ uuid: str | None
126
+ """
127
+ User-provided UUID of a media. User must guarantee that it is properly
128
+ generated and unique for different medias.
129
+ """
130
+
131
+
132
+ class VideoURL(TypedDict, total=False):
133
+ url: Required[str]
134
+ """
135
+ Either a URL of the video or a data URL with base64 encoded video data.
136
+ """
137
+
138
+
139
+ class ChatCompletionContentPartVideoParam(TypedDict, total=False):
140
+ video_url: Required[VideoURL]
141
+
142
+ type: Required[Literal["video_url"]]
143
+ """The type of the content part."""
144
+
145
+
146
+ class PILImage(BaseModel):
147
+ """
148
+ A PIL.Image.Image object.
149
+ """
150
+
151
+ image_pil: Image.Image
152
+ model_config = ConfigDict(arbitrary_types_allowed=True)
153
+
154
+
155
+ class CustomChatCompletionContentPILImageParam(TypedDict, total=False):
156
+ """A simpler version of the param that only accepts a PIL image.
157
+
158
+ Example:
159
+ {
160
+ "image_pil": ImageAsset('cherry_blossom').pil_image
161
+ }
162
+ """
163
+
164
+ image_pil: PILImage | None
165
+ uuid: str | None
166
+ """
167
+ User-provided UUID of a media. User must guarantee that it is properly
168
+ generated and unique for different medias.
169
+ """
170
+
171
+
172
+ class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False):
173
+ """A simpler version of the param that only accepts a plain image_url.
174
+ This is supported by OpenAI API, although it is not documented.
175
+
176
+ Example:
177
+ {
178
+ "image_url": "https://example.com/image.jpg"
179
+ }
180
+ """
181
+
182
+ image_url: str | None
183
+ uuid: str | None
184
+ """
185
+ User-provided UUID of a media. User must guarantee that it is properly
186
+ generated and unique for different medias.
187
+ """
188
+
189
+
190
+ class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False):
191
+ """A simpler version of the param that only accepts a plain audio_url.
192
+
193
+ Example:
194
+ {
195
+ "audio_url": "https://example.com/audio.mp3"
196
+ }
197
+ """
198
+
199
+ audio_url: str | None
200
+
201
+
202
+ class CustomChatCompletionContentSimpleVideoParam(TypedDict, total=False):
203
+ """A simpler version of the param that only accepts a plain audio_url.
204
+
205
+ Example:
206
+ {
207
+ "video_url": "https://example.com/video.mp4"
208
+ }
209
+ """
210
+
211
+ video_url: str | None
212
+ uuid: str | None
213
+ """
214
+ User-provided UUID of a media. User must guarantee that it is properly
215
+ generated and unique for different medias.
216
+ """
217
+
218
+
219
+ class CustomThinkCompletionContentParam(TypedDict, total=False):
220
+ """A Think Completion Content Param that accepts a plain text and a boolean.
221
+
222
+ Example:
223
+ {
224
+ "thinking": "I am thinking about the answer",
225
+ "closed": True,
226
+ "type": "thinking"
227
+ }
228
+ """
229
+
230
+ thinking: Required[str]
231
+ """The thinking content."""
232
+
233
+ closed: bool
234
+ """Whether the thinking is closed."""
235
+
236
+ type: Required[Literal["thinking"]]
237
+ """The thinking type."""
238
+
239
+
240
+ ChatCompletionContentPartParam: TypeAlias = (
241
+ OpenAIChatCompletionContentPartParam
242
+ | ChatCompletionContentPartAudioParam
243
+ | ChatCompletionContentPartInputAudioParam
244
+ | ChatCompletionContentPartVideoParam
245
+ | ChatCompletionContentPartRefusalParam
246
+ | CustomChatCompletionContentPILImageParam
247
+ | CustomChatCompletionContentSimpleImageParam
248
+ | ChatCompletionContentPartImageEmbedsParam
249
+ | ChatCompletionContentPartAudioEmbedsParam
250
+ | CustomChatCompletionContentSimpleAudioParam
251
+ | CustomChatCompletionContentSimpleVideoParam
252
+ | str
253
+ | CustomThinkCompletionContentParam
254
+ )
255
+
256
+
257
+ class CustomChatCompletionMessageParam(TypedDict, total=False):
258
+ """Enables custom roles in the Chat Completion API."""
259
+
260
+ role: Required[str]
261
+ """The role of the message's author."""
262
+
263
+ content: str | list[ChatCompletionContentPartParam]
264
+ """The contents of the message."""
265
+
266
+ name: str
267
+ """An optional name for the participant.
268
+
269
+ Provides the model information to differentiate between participants of the
270
+ same role.
271
+ """
272
+
273
+ tool_call_id: str | None
274
+ """Tool call that this message is responding to."""
275
+
276
+ tool_calls: Iterable[ChatCompletionMessageToolCallParam] | None
277
+ """The tool calls generated by the model, such as function calls."""
278
+
279
+ reasoning: str | None
280
+ """The reasoning content for interleaved thinking."""
281
+
282
+ tools: list[ChatCompletionFunctionToolParam] | None
283
+ """The tools for developer role."""
284
+
285
+
286
+ ChatCompletionMessageParam: TypeAlias = (
287
+ OpenAIChatCompletionMessageParam
288
+ | CustomChatCompletionMessageParam
289
+ | OpenAIHarmonyMessage
290
+ )
291
+
292
+
293
+ # TODO: Make fields ReadOnly once mypy supports it
294
+ class ConversationMessage(TypedDict, total=False):
295
+ role: Required[str]
296
+ """The role of the message's author."""
297
+
298
+ content: str | None | list[dict[str, str]]
299
+ """The contents of the message"""
300
+
301
+ tool_call_id: str | None
302
+ """Tool call that this message is responding to."""
303
+
304
+ name: str | None
305
+ """The name of the function to call"""
306
+
307
+ tool_calls: Iterable[ChatCompletionMessageToolCallParam] | None
308
+ """The tool calls generated by the model, such as function calls."""
309
+
310
+ reasoning: str | None
311
+ """The reasoning content for interleaved thinking."""
312
+
313
+ reasoning_content: str | None
314
+ """Deprecated: The reasoning content for interleaved thinking."""
315
+
316
+ tools: list[ChatCompletionFunctionToolParam] | None
317
+ """The tools for developer role."""
318
+
319
+
320
+ # Passed in by user
321
+ ChatTemplateContentFormatOption = Literal["auto", "string", "openai"]
322
+
323
+ # Used internally
324
+ _ChatTemplateContentFormat = Literal["string", "openai"]
325
+
326
+
327
+ def _is_var_access(node: jinja2.nodes.Node, varname: str) -> bool:
328
+ if isinstance(node, jinja2.nodes.Name):
329
+ return node.ctx == "load" and node.name == varname
330
+
331
+ return False
332
+
333
+
334
+ def _is_attr_access(node: jinja2.nodes.Node, varname: str, key: str) -> bool:
335
+ if isinstance(node, jinja2.nodes.Getitem):
336
+ return (
337
+ _is_var_access(node.node, varname)
338
+ and isinstance(node.arg, jinja2.nodes.Const)
339
+ and node.arg.value == key
340
+ )
341
+
342
+ if isinstance(node, jinja2.nodes.Getattr):
343
+ return _is_var_access(node.node, varname) and node.attr == key
344
+
345
+ return False
346
+
347
+
348
+ def _is_var_or_elems_access(
349
+ node: jinja2.nodes.Node,
350
+ varname: str,
351
+ key: str | None = None,
352
+ ) -> bool:
353
+ if isinstance(node, jinja2.nodes.Filter):
354
+ return node.node is not None and _is_var_or_elems_access(
355
+ node.node, varname, key
356
+ )
357
+ if isinstance(node, jinja2.nodes.Test):
358
+ return _is_var_or_elems_access(node.node, varname, key)
359
+
360
+ if isinstance(node, jinja2.nodes.Getitem) and isinstance(
361
+ node.arg, jinja2.nodes.Slice
362
+ ):
363
+ return _is_var_or_elems_access(node.node, varname, key)
364
+
365
+ return _is_attr_access(node, varname, key) if key else _is_var_access(node, varname)
366
+
367
+
368
+ def _iter_nodes_assign_var_or_elems(root: jinja2.nodes.Node, varname: str):
369
+ # Global variable that is implicitly defined at the root
370
+ yield root, varname
371
+
372
+ # Iterative BFS
373
+ related_varnames = deque([varname])
374
+ while related_varnames:
375
+ related_varname = related_varnames.popleft()
376
+
377
+ for assign_ast in root.find_all(jinja2.nodes.Assign):
378
+ lhs = assign_ast.target
379
+ rhs = assign_ast.node
380
+
381
+ if _is_var_or_elems_access(rhs, related_varname):
382
+ assert isinstance(lhs, jinja2.nodes.Name)
383
+ yield assign_ast, lhs.name
384
+
385
+ # Avoid infinite looping for self-assignment
386
+ if lhs.name != related_varname:
387
+ related_varnames.append(lhs.name)
388
+
389
+
390
+ # NOTE: The proper way to handle this is to build a CFG so that we can handle
391
+ # the scope in which each variable is defined, but that is too complicated
392
+ def _iter_nodes_assign_messages_item(root: jinja2.nodes.Node):
393
+ messages_varnames = [
394
+ varname for _, varname in _iter_nodes_assign_var_or_elems(root, "messages")
395
+ ]
396
+
397
+ # Search for {%- for message in messages -%} loops
398
+ for loop_ast in root.find_all(jinja2.nodes.For):
399
+ loop_iter = loop_ast.iter
400
+ loop_target = loop_ast.target
401
+
402
+ for varname in messages_varnames:
403
+ if _is_var_or_elems_access(loop_iter, varname):
404
+ assert isinstance(loop_target, jinja2.nodes.Name)
405
+ yield loop_ast, loop_target.name
406
+ break
407
+
408
+
409
+ def _iter_nodes_assign_content_item(root: jinja2.nodes.Node):
410
+ message_varnames = [
411
+ varname for _, varname in _iter_nodes_assign_messages_item(root)
412
+ ]
413
+
414
+ # Search for {%- for content in message['content'] -%} loops
415
+ for loop_ast in root.find_all(jinja2.nodes.For):
416
+ loop_iter = loop_ast.iter
417
+ loop_target = loop_ast.target
418
+
419
+ for varname in message_varnames:
420
+ if _is_var_or_elems_access(loop_iter, varname, "content"):
421
+ assert isinstance(loop_target, jinja2.nodes.Name)
422
+ yield loop_ast, loop_target.name
423
+ break
424
+
425
+
426
+ def _try_extract_ast(chat_template: str) -> jinja2.nodes.Template | None:
427
+ try:
428
+ jinja_compiled = hf_chat_utils._compile_jinja_template(chat_template)
429
+ return jinja_compiled.environment.parse(chat_template)
430
+ except Exception:
431
+ logger.exception("Error when compiling Jinja template")
432
+ return None
433
+
434
+
435
+ @lru_cache(maxsize=32)
436
+ def _detect_content_format(
437
+ chat_template: str,
438
+ *,
439
+ default: _ChatTemplateContentFormat,
440
+ ) -> _ChatTemplateContentFormat:
441
+ jinja_ast = _try_extract_ast(chat_template)
442
+ if jinja_ast is None:
443
+ return default
444
+
445
+ try:
446
+ next(_iter_nodes_assign_content_item(jinja_ast))
447
+ except StopIteration:
448
+ return "string"
449
+ except Exception:
450
+ logger.exception("Error when parsing AST of Jinja template")
451
+ return default
452
+ else:
453
+ return "openai"
454
+
455
+
456
+ def resolve_mistral_chat_template(
457
+ chat_template: str | None,
458
+ **kwargs: Any,
459
+ ) -> str | None:
460
+ if chat_template is not None or kwargs.get("chat_template_kwargs") is not None:
461
+ raise ValueError(
462
+ "'chat_template' or 'chat_template_kwargs' cannot be overridden "
463
+ "for mistral tokenizer."
464
+ )
465
+
466
+ return None
467
+
468
+
469
+ _PROCESSOR_CHAT_TEMPLATES = dict[tuple[str, bool], str | None]()
470
+ """
471
+ Used in `_try_get_processor_chat_template` to avoid calling
472
+ `cached_get_processor` again if the processor fails to be loaded.
473
+
474
+ This is needed because `lru_cache` does not cache when an exception happens.
475
+ """
476
+
477
+
478
+ def _try_get_processor_chat_template(
479
+ tokenizer: PreTrainedTokenizer | PreTrainedTokenizerFast,
480
+ model_config: ModelConfig,
481
+ ) -> str | None:
482
+ cache_key = (tokenizer.name_or_path, model_config.trust_remote_code)
483
+ if cache_key in _PROCESSOR_CHAT_TEMPLATES:
484
+ return _PROCESSOR_CHAT_TEMPLATES[cache_key]
485
+
486
+ try:
487
+ processor = cached_get_processor(
488
+ tokenizer.name_or_path,
489
+ processor_cls=(
490
+ PreTrainedTokenizer,
491
+ PreTrainedTokenizerFast,
492
+ ProcessorMixin,
493
+ ),
494
+ trust_remote_code=model_config.trust_remote_code,
495
+ )
496
+ if (
497
+ isinstance(processor, ProcessorMixin)
498
+ and hasattr(processor, "chat_template")
499
+ and (chat_template := processor.chat_template) is not None
500
+ ):
501
+ _PROCESSOR_CHAT_TEMPLATES[cache_key] = chat_template
502
+ return chat_template
503
+ except Exception:
504
+ logger.debug(
505
+ "Failed to load AutoProcessor chat template for %s",
506
+ tokenizer.name_or_path,
507
+ exc_info=True,
508
+ )
509
+
510
+ _PROCESSOR_CHAT_TEMPLATES[cache_key] = None
511
+ return None
512
+
513
+
514
+ def resolve_hf_chat_template(
515
+ tokenizer: PreTrainedTokenizer | PreTrainedTokenizerFast,
516
+ chat_template: str | None,
517
+ tools: list[dict[str, Any]] | None,
518
+ *,
519
+ model_config: ModelConfig,
520
+ ) -> str | None:
521
+ # 1st priority: The given chat template
522
+ if chat_template is not None:
523
+ return chat_template
524
+
525
+ # 2nd priority: AutoProcessor chat template, unless tool calling is enabled
526
+ if tools is None:
527
+ chat_template = _try_get_processor_chat_template(tokenizer, model_config)
528
+ if chat_template is not None:
529
+ return chat_template
530
+
531
+ # 3rd priority: AutoTokenizer chat template
532
+ try:
533
+ return tokenizer.get_chat_template(chat_template, tools=tools)
534
+ except Exception:
535
+ logger.debug(
536
+ "Failed to load AutoTokenizer chat template for %s",
537
+ tokenizer.name_or_path,
538
+ exc_info=True,
539
+ )
540
+
541
+ # 4th priority: Predefined fallbacks
542
+ path = get_chat_template_fallback_path(
543
+ model_type=model_config.hf_config.model_type,
544
+ tokenizer_name_or_path=model_config.tokenizer,
545
+ )
546
+ if path is not None:
547
+ logger.info_once(
548
+ "Loading chat template fallback for %s as there isn't one "
549
+ "defined on HF Hub.",
550
+ tokenizer.name_or_path,
551
+ )
552
+ chat_template = load_chat_template(path)
553
+ else:
554
+ logger.debug_once(
555
+ "There is no chat template fallback for %s", tokenizer.name_or_path
556
+ )
557
+
558
+ return chat_template
559
+
560
+
561
+ def _resolve_chat_template_content_format(
562
+ chat_template: str | None,
563
+ tools: list[dict[str, Any]] | None,
564
+ tokenizer: TokenizerLike | None,
565
+ *,
566
+ model_config: ModelConfig,
567
+ ) -> _ChatTemplateContentFormat:
568
+ if isinstance(tokenizer, (PreTrainedTokenizer, PreTrainedTokenizerFast)):
569
+ hf_chat_template = resolve_hf_chat_template(
570
+ tokenizer,
571
+ chat_template=chat_template,
572
+ tools=tools,
573
+ model_config=model_config,
574
+ )
575
+ else:
576
+ hf_chat_template = None
577
+
578
+ jinja_text = (
579
+ hf_chat_template
580
+ if isinstance(hf_chat_template, str)
581
+ else load_chat_template(chat_template, is_literal=True)
582
+ )
583
+
584
+ detected_format = (
585
+ "string"
586
+ if jinja_text is None
587
+ else _detect_content_format(jinja_text, default="string")
588
+ )
589
+
590
+ return detected_format
591
+
592
+
593
+ @lru_cache
594
+ def _log_chat_template_content_format(
595
+ chat_template: str | None,
596
+ given_format: ChatTemplateContentFormatOption,
597
+ detected_format: ChatTemplateContentFormatOption,
598
+ ):
599
+ logger.info(
600
+ "Detected the chat template content format to be '%s'. "
601
+ "You can set `--chat-template-content-format` to override this.",
602
+ detected_format,
603
+ )
604
+
605
+ if given_format != "auto" and given_format != detected_format:
606
+ logger.warning(
607
+ "You specified `--chat-template-content-format %s` "
608
+ "which is different from the detected format '%s'. "
609
+ "If our automatic detection is incorrect, please consider "
610
+ "opening a GitHub issue so that we can improve it: "
611
+ "https://github.com/vllm-project/vllm/issues/new/choose",
612
+ given_format,
613
+ detected_format,
614
+ )
615
+
616
+
617
+ def resolve_chat_template_content_format(
618
+ chat_template: str | None,
619
+ tools: list[dict[str, Any]] | None,
620
+ given_format: ChatTemplateContentFormatOption,
621
+ tokenizer: TokenizerLike | None,
622
+ *,
623
+ model_config: ModelConfig,
624
+ ) -> _ChatTemplateContentFormat:
625
+ if given_format != "auto":
626
+ return given_format
627
+
628
+ detected_format = _resolve_chat_template_content_format(
629
+ chat_template,
630
+ tools,
631
+ tokenizer,
632
+ model_config=model_config,
633
+ )
634
+
635
+ _log_chat_template_content_format(
636
+ chat_template,
637
+ given_format=given_format,
638
+ detected_format=detected_format,
639
+ )
640
+
641
+ return detected_format
642
+
643
+
644
+ ModalityStr = Literal["image", "audio", "video", "image_embeds", "audio_embeds"]
645
+ _T = TypeVar("_T")
646
+
647
+
648
+ def _extract_embeds(tensors: list[torch.Tensor]):
649
+ if len(tensors) == 0:
650
+ return tensors
651
+
652
+ if len(tensors) == 1:
653
+ tensors[0]._is_single_item = True # type: ignore
654
+ return tensors[0] # To keep backwards compatibility for single item input
655
+
656
+ first_shape = tensors[0].shape
657
+ if all(t.shape == first_shape for t in tensors):
658
+ return torch.stack(tensors)
659
+
660
+ return tensors
661
+
662
+
663
+ def _get_embeds_data(items_by_modality: dict[str, list[Any]], modality: str):
664
+ embeds_key = f"{modality}_embeds"
665
+ embeds = items_by_modality[embeds_key]
666
+
667
+ if len(embeds) == 0:
668
+ return embeds
669
+ if is_list_of(embeds, torch.Tensor):
670
+ return _extract_embeds(embeds)
671
+ if is_list_of(embeds, dict):
672
+ if not embeds:
673
+ return {}
674
+
675
+ first_keys = set(embeds[0].keys())
676
+ if any(set(item.keys()) != first_keys for item in embeds[1:]):
677
+ raise ValueError(
678
+ "All dictionaries in the list of embeddings must have the same keys."
679
+ )
680
+
681
+ return {k: _extract_embeds([item[k] for item in embeds]) for k in first_keys}
682
+
683
+ return embeds
684
+
685
+
686
+ class BaseMultiModalItemTracker(ABC, Generic[_T]):
687
+ """
688
+ Tracks multi-modal items in a given request and ensures that the number
689
+ of multi-modal items in a given request does not exceed the configured
690
+ maximum per prompt.
691
+ """
692
+
693
+ def __init__(self, model_config: ModelConfig):
694
+ super().__init__()
695
+
696
+ self._model_config = model_config
697
+
698
+ self._items_by_modality = defaultdict[str, list[_T | None]](list)
699
+ self._uuids_by_modality = defaultdict[str, list[str | None]](list)
700
+
701
+ @property
702
+ def model_config(self) -> ModelConfig:
703
+ return self._model_config
704
+
705
+ @cached_property
706
+ def model_cls(self) -> type[SupportsMultiModal]:
707
+ from vllm.model_executor.model_loader import get_model_cls
708
+
709
+ model_cls = get_model_cls(self.model_config)
710
+ return cast(type[SupportsMultiModal], model_cls)
711
+
712
+ @property
713
+ def allowed_local_media_path(self):
714
+ return self._model_config.allowed_local_media_path
715
+
716
+ @property
717
+ def allowed_media_domains(self):
718
+ return self._model_config.allowed_media_domains
719
+
720
+ @property
721
+ def mm_registry(self):
722
+ return MULTIMODAL_REGISTRY
723
+
724
+ @cached_property
725
+ def mm_processor(self):
726
+ return self.mm_registry.create_processor(self.model_config)
727
+
728
+ def add(
729
+ self,
730
+ modality: ModalityStr,
731
+ item: _T | None,
732
+ uuid: str | None = None,
733
+ ) -> str | None:
734
+ """
735
+ Add a multi-modal item to the current prompt and returns the
736
+ placeholder string to use, if any.
737
+
738
+ An optional uuid can be added which serves as a unique identifier of the
739
+ media.
740
+ """
741
+ input_modality = modality.replace("_embeds", "")
742
+ num_items = len(self._items_by_modality[modality]) + 1
743
+
744
+ self.mm_processor.validate_num_items(input_modality, num_items)
745
+
746
+ self._items_by_modality[modality].append(item)
747
+ self._uuids_by_modality[modality].append(uuid)
748
+
749
+ return self.model_cls.get_placeholder_str(modality, num_items)
750
+
751
+ def all_mm_uuids(self) -> MultiModalUUIDDict | None:
752
+ if not self._items_by_modality:
753
+ return None
754
+
755
+ uuids_by_modality = dict(self._uuids_by_modality)
756
+ if "image" in uuids_by_modality and "image_embeds" in uuids_by_modality:
757
+ raise ValueError("Mixing raw image and embedding inputs is not allowed")
758
+ if "audio" in uuids_by_modality and "audio_embeds" in uuids_by_modality:
759
+ raise ValueError("Mixing raw audio and embedding inputs is not allowed")
760
+
761
+ mm_uuids = {}
762
+ if "image_embeds" in uuids_by_modality:
763
+ mm_uuids["image"] = uuids_by_modality["image_embeds"]
764
+ if "image" in uuids_by_modality:
765
+ mm_uuids["image"] = uuids_by_modality["image"] # UUIDs of images
766
+ if "audio_embeds" in uuids_by_modality:
767
+ mm_uuids["audio"] = uuids_by_modality["audio_embeds"]
768
+ if "audio" in uuids_by_modality:
769
+ mm_uuids["audio"] = uuids_by_modality["audio"] # UUIDs of audios
770
+ if "video" in uuids_by_modality:
771
+ mm_uuids["video"] = uuids_by_modality["video"] # UUIDs of videos
772
+
773
+ return mm_uuids
774
+
775
+ @abstractmethod
776
+ def create_parser(self) -> "BaseMultiModalContentParser":
777
+ raise NotImplementedError
778
+
779
+
780
+ class MultiModalItemTracker(BaseMultiModalItemTracker[object]):
781
+ def all_mm_data(self) -> MultiModalDataDict | None:
782
+ if not self._items_by_modality:
783
+ return None
784
+
785
+ items_by_modality = dict(self._items_by_modality)
786
+ if "image" in items_by_modality and "image_embeds" in items_by_modality:
787
+ raise ValueError("Mixing raw image and embedding inputs is not allowed")
788
+ if "audio" in items_by_modality and "audio_embeds" in items_by_modality:
789
+ raise ValueError("Mixing raw audio and embedding inputs is not allowed")
790
+
791
+ mm_inputs = {}
792
+ if "image_embeds" in items_by_modality:
793
+ mm_inputs["image"] = _get_embeds_data(items_by_modality, "image")
794
+ if "image" in items_by_modality:
795
+ mm_inputs["image"] = items_by_modality["image"] # A list of images
796
+ if "audio_embeds" in items_by_modality:
797
+ mm_inputs["audio"] = _get_embeds_data(items_by_modality, "audio")
798
+ if "audio" in items_by_modality:
799
+ mm_inputs["audio"] = items_by_modality["audio"] # A list of audios
800
+ if "video" in items_by_modality:
801
+ mm_inputs["video"] = items_by_modality["video"] # A list of videos
802
+
803
+ return mm_inputs
804
+
805
+ def create_parser(self) -> "BaseMultiModalContentParser":
806
+ return MultiModalContentParser(self)
807
+
808
+
809
+ class AsyncMultiModalItemTracker(BaseMultiModalItemTracker[Awaitable[object]]):
810
+ async def all_mm_data(self) -> MultiModalDataDict | None:
811
+ if not self._items_by_modality:
812
+ return None
813
+
814
+ coros_by_modality = {
815
+ modality: [item or asyncio.sleep(0) for item in items]
816
+ for modality, items in self._items_by_modality.items()
817
+ }
818
+ items_by_modality: dict[str, list[object | None]] = {
819
+ modality: await asyncio.gather(*coros)
820
+ for modality, coros in coros_by_modality.items()
821
+ }
822
+ if "image" in items_by_modality and "image_embeds" in items_by_modality:
823
+ raise ValueError("Mixing raw image and embedding inputs is not allowed")
824
+ if "audio" in items_by_modality and "audio_embeds" in items_by_modality:
825
+ raise ValueError("Mixing raw audio and embedding inputs is not allowed")
826
+
827
+ mm_inputs = {}
828
+ if "image_embeds" in items_by_modality:
829
+ mm_inputs["image"] = _get_embeds_data(items_by_modality, "image")
830
+ if "image" in items_by_modality:
831
+ mm_inputs["image"] = items_by_modality["image"] # A list of images
832
+ if "audio_embeds" in items_by_modality:
833
+ mm_inputs["audio"] = _get_embeds_data(items_by_modality, "audio")
834
+ if "audio" in items_by_modality:
835
+ mm_inputs["audio"] = items_by_modality["audio"] # A list of audios
836
+ if "video" in items_by_modality:
837
+ mm_inputs["video"] = items_by_modality["video"] # A list of videos
838
+
839
+ return mm_inputs
840
+
841
+ def create_parser(self) -> "BaseMultiModalContentParser":
842
+ return AsyncMultiModalContentParser(self)
843
+
844
+
845
+ class BaseMultiModalContentParser(ABC):
846
+ def __init__(self) -> None:
847
+ super().__init__()
848
+
849
+ # stores model placeholders list with corresponding
850
+ # general MM placeholder:
851
+ # {
852
+ # "<##IMAGE##>": ["<image>", "<image>", "<image>"],
853
+ # "<##AUDIO##>": ["<audio>", "<audio>"]
854
+ # }
855
+ self._placeholder_storage: dict[str, list] = defaultdict(list)
856
+
857
+ def _add_placeholder(self, modality: ModalityStr, placeholder: str | None):
858
+ mod_placeholder = MODALITY_PLACEHOLDERS_MAP[modality]
859
+ if placeholder:
860
+ self._placeholder_storage[mod_placeholder].append(placeholder)
861
+
862
+ def mm_placeholder_storage(self) -> dict[str, list]:
863
+ return dict(self._placeholder_storage)
864
+
865
+ @abstractmethod
866
+ def parse_image(self, image_url: str | None, uuid: str | None = None) -> None:
867
+ raise NotImplementedError
868
+
869
+ @abstractmethod
870
+ def parse_image_embeds(
871
+ self,
872
+ image_embeds: str | dict[str, str] | None,
873
+ uuid: str | None = None,
874
+ ) -> None:
875
+ raise NotImplementedError
876
+
877
+ @abstractmethod
878
+ def parse_image_pil(
879
+ self, image_pil: Image.Image | None, uuid: str | None = None
880
+ ) -> None:
881
+ raise NotImplementedError
882
+
883
+ @abstractmethod
884
+ def parse_audio(self, audio_url: str | None, uuid: str | None = None) -> None:
885
+ raise NotImplementedError
886
+
887
+ @abstractmethod
888
+ def parse_input_audio(
889
+ self, input_audio: InputAudio | None, uuid: str | None = None
890
+ ) -> None:
891
+ raise NotImplementedError
892
+
893
+ @abstractmethod
894
+ def parse_audio_embeds(
895
+ self,
896
+ audio_embeds: str | dict[str, str] | None,
897
+ uuid: str | None = None,
898
+ ) -> None:
899
+ raise NotImplementedError
900
+
901
+ @abstractmethod
902
+ def parse_video(self, video_url: str | None, uuid: str | None = None) -> None:
903
+ raise NotImplementedError
904
+
905
+
906
+ class MultiModalContentParser(BaseMultiModalContentParser):
907
+ def __init__(self, tracker: MultiModalItemTracker) -> None:
908
+ super().__init__()
909
+
910
+ self._tracker = tracker
911
+ multimodal_config = self._tracker.model_config.multimodal_config
912
+ media_io_kwargs = getattr(multimodal_config, "media_io_kwargs", None)
913
+
914
+ self._connector: MediaConnector = MEDIA_CONNECTOR_REGISTRY.load(
915
+ envs.VLLM_MEDIA_CONNECTOR,
916
+ media_io_kwargs=media_io_kwargs,
917
+ allowed_local_media_path=tracker.allowed_local_media_path,
918
+ allowed_media_domains=tracker.allowed_media_domains,
919
+ )
920
+
921
+ @property
922
+ def model_config(self) -> ModelConfig:
923
+ return self._tracker.model_config
924
+
925
+ def parse_image(self, image_url: str | None, uuid: str | None = None) -> None:
926
+ image = self._connector.fetch_image(image_url) if image_url else None
927
+
928
+ placeholder = self._tracker.add("image", image, uuid)
929
+ self._add_placeholder("image", placeholder)
930
+
931
+ def parse_image_embeds(
932
+ self,
933
+ image_embeds: str | dict[str, str] | None,
934
+ uuid: str | None = None,
935
+ ) -> None:
936
+ mm_config = self.model_config.get_multimodal_config()
937
+ if not mm_config.enable_mm_embeds:
938
+ raise ValueError(
939
+ "You must set `--enable-mm-embeds` to input `image_embeds`"
940
+ )
941
+
942
+ if isinstance(image_embeds, dict):
943
+ embeds = {
944
+ k: self._connector.fetch_image_embedding(v)
945
+ for k, v in image_embeds.items()
946
+ }
947
+ placeholder = self._tracker.add("image_embeds", embeds, uuid)
948
+
949
+ if isinstance(image_embeds, str):
950
+ embedding = self._connector.fetch_image_embedding(image_embeds)
951
+ placeholder = self._tracker.add("image_embeds", embedding, uuid)
952
+
953
+ if image_embeds is None:
954
+ placeholder = self._tracker.add("image_embeds", None, uuid)
955
+
956
+ self._add_placeholder("image", placeholder)
957
+
958
+ def parse_audio_embeds(
959
+ self,
960
+ audio_embeds: str | dict[str, str] | None,
961
+ uuid: str | None = None,
962
+ ) -> None:
963
+ mm_config = self.model_config.get_multimodal_config()
964
+ if not mm_config.enable_mm_embeds:
965
+ raise ValueError(
966
+ "You must set `--enable-mm-embeds` to input `audio_embeds`"
967
+ )
968
+
969
+ if isinstance(audio_embeds, dict):
970
+ embeds = {
971
+ k: self._connector.fetch_audio_embedding(v)
972
+ for k, v in audio_embeds.items()
973
+ }
974
+ placeholder = self._tracker.add("audio_embeds", embeds, uuid)
975
+ elif isinstance(audio_embeds, str):
976
+ embedding = self._connector.fetch_audio_embedding(audio_embeds)
977
+ placeholder = self._tracker.add("audio_embeds", embedding, uuid)
978
+ else:
979
+ placeholder = self._tracker.add("audio_embeds", None, uuid)
980
+
981
+ self._add_placeholder("audio", placeholder)
982
+
983
+ def parse_image_pil(
984
+ self, image_pil: Image.Image | None, uuid: str | None = None
985
+ ) -> None:
986
+ placeholder = self._tracker.add("image", image_pil, uuid)
987
+ self._add_placeholder("image", placeholder)
988
+
989
+ def parse_audio(self, audio_url: str | None, uuid: str | None = None) -> None:
990
+ audio = self._connector.fetch_audio(audio_url) if audio_url else None
991
+
992
+ placeholder = self._tracker.add("audio", audio, uuid)
993
+ self._add_placeholder("audio", placeholder)
994
+
995
+ def parse_input_audio(
996
+ self, input_audio: InputAudio | None, uuid: str | None = None
997
+ ) -> None:
998
+ if input_audio:
999
+ audio_data = input_audio.get("data", "")
1000
+ audio_format = input_audio.get("format", "")
1001
+ if audio_data:
1002
+ audio_url = f"data:audio/{audio_format};base64,{audio_data}"
1003
+ else:
1004
+ # If a UUID is provided, audio data may be empty.
1005
+ audio_url = None
1006
+ else:
1007
+ audio_url = None
1008
+
1009
+ return self.parse_audio(audio_url, uuid)
1010
+
1011
+ def parse_video(self, video_url: str | None, uuid: str | None = None) -> None:
1012
+ video = self._connector.fetch_video(video_url=video_url) if video_url else None
1013
+
1014
+ placeholder = self._tracker.add("video", video, uuid)
1015
+ self._add_placeholder("video", placeholder)
1016
+
1017
+
1018
+ class AsyncMultiModalContentParser(BaseMultiModalContentParser):
1019
+ def __init__(self, tracker: AsyncMultiModalItemTracker) -> None:
1020
+ super().__init__()
1021
+
1022
+ self._tracker = tracker
1023
+ multimodal_config = self._tracker.model_config.multimodal_config
1024
+ media_io_kwargs = getattr(multimodal_config, "media_io_kwargs", None)
1025
+ self._connector: MediaConnector = MEDIA_CONNECTOR_REGISTRY.load(
1026
+ envs.VLLM_MEDIA_CONNECTOR,
1027
+ media_io_kwargs=media_io_kwargs,
1028
+ allowed_local_media_path=tracker.allowed_local_media_path,
1029
+ allowed_media_domains=tracker.allowed_media_domains,
1030
+ )
1031
+
1032
+ @property
1033
+ def model_config(self) -> ModelConfig:
1034
+ return self._tracker.model_config
1035
+
1036
+ def parse_image(self, image_url: str | None, uuid: str | None = None) -> None:
1037
+ image_coro = self._connector.fetch_image_async(image_url) if image_url else None
1038
+
1039
+ placeholder = self._tracker.add("image", image_coro, uuid)
1040
+ self._add_placeholder("image", placeholder)
1041
+
1042
+ def parse_image_embeds(
1043
+ self,
1044
+ image_embeds: str | dict[str, str] | None,
1045
+ uuid: str | None = None,
1046
+ ) -> None:
1047
+ mm_config = self.model_config.get_multimodal_config()
1048
+ if not mm_config.enable_mm_embeds:
1049
+ raise ValueError(
1050
+ "You must set `--enable-mm-embeds` to input `image_embeds`"
1051
+ )
1052
+
1053
+ future: asyncio.Future[str | dict[str, str] | None] = asyncio.Future()
1054
+
1055
+ if isinstance(image_embeds, dict):
1056
+ embeds = {
1057
+ k: self._connector.fetch_image_embedding(v)
1058
+ for k, v in image_embeds.items()
1059
+ }
1060
+ future.set_result(embeds)
1061
+
1062
+ if isinstance(image_embeds, str):
1063
+ embedding = self._connector.fetch_image_embedding(image_embeds)
1064
+ future.set_result(embedding)
1065
+
1066
+ if image_embeds is None:
1067
+ future.set_result(None)
1068
+
1069
+ placeholder = self._tracker.add("image_embeds", future, uuid)
1070
+ self._add_placeholder("image", placeholder)
1071
+
1072
+ def parse_audio_embeds(
1073
+ self,
1074
+ audio_embeds: str | dict[str, str] | None,
1075
+ uuid: str | None = None,
1076
+ ) -> None:
1077
+ mm_config = self.model_config.get_multimodal_config()
1078
+ if not mm_config.enable_mm_embeds:
1079
+ raise ValueError(
1080
+ "You must set `--enable-mm-embeds` to input `audio_embeds`"
1081
+ )
1082
+
1083
+ logger.info(
1084
+ "🎵 Parsing audio_embeds: type=%s, uuid=%s, is_dict=%s, "
1085
+ "is_str=%s, is_none=%s",
1086
+ type(audio_embeds).__name__,
1087
+ uuid,
1088
+ isinstance(audio_embeds, dict),
1089
+ isinstance(audio_embeds, str),
1090
+ audio_embeds is None,
1091
+ )
1092
+
1093
+ future: asyncio.Future[str | dict[str, str] | None] = asyncio.Future()
1094
+
1095
+ if isinstance(audio_embeds, dict):
1096
+ logger.info(
1097
+ "🎵 Processing dict audio_embeds with %d entries",
1098
+ len(audio_embeds),
1099
+ )
1100
+ embeds = {
1101
+ k: self._connector.fetch_audio_embedding(v)
1102
+ for k, v in audio_embeds.items()
1103
+ }
1104
+ future.set_result(embeds)
1105
+ logger.info(
1106
+ "🎵 Successfully loaded %d audio embeddings from dict",
1107
+ len(embeds),
1108
+ )
1109
+
1110
+ if isinstance(audio_embeds, str):
1111
+ base64_size = len(audio_embeds)
1112
+ logger.info(
1113
+ "🎵 Processing base64 audio_embeds: %d chars (%.2f KB)",
1114
+ base64_size,
1115
+ base64_size / 1024,
1116
+ )
1117
+ embedding = self._connector.fetch_audio_embedding(audio_embeds)
1118
+ future.set_result(embedding)
1119
+ logger.info(
1120
+ "🎵 Successfully loaded audio embedding tensor: shape=%s, dtype=%s",
1121
+ embedding.shape,
1122
+ embedding.dtype,
1123
+ )
1124
+
1125
+ if audio_embeds is None:
1126
+ logger.info("🎵 Audio embeds is None (UUID-only reference)")
1127
+ future.set_result(None)
1128
+
1129
+ placeholder = self._tracker.add("audio_embeds", future, uuid)
1130
+ self._add_placeholder("audio", placeholder)
1131
+ logger.info("🎵 Added audio_embeds placeholder with uuid=%s", uuid)
1132
+
1133
+ def parse_image_pil(
1134
+ self, image_pil: Image.Image | None, uuid: str | None = None
1135
+ ) -> None:
1136
+ future: asyncio.Future[Image.Image | None] = asyncio.Future()
1137
+ if image_pil:
1138
+ future.set_result(image_pil)
1139
+ else:
1140
+ future.set_result(None)
1141
+
1142
+ placeholder = self._tracker.add("image", future, uuid)
1143
+ self._add_placeholder("image", placeholder)
1144
+
1145
+ def parse_audio(self, audio_url: str | None, uuid: str | None = None) -> None:
1146
+ audio_coro = self._connector.fetch_audio_async(audio_url) if audio_url else None
1147
+
1148
+ placeholder = self._tracker.add("audio", audio_coro, uuid)
1149
+ self._add_placeholder("audio", placeholder)
1150
+
1151
+ def parse_input_audio(
1152
+ self, input_audio: InputAudio | None, uuid: str | None = None
1153
+ ) -> None:
1154
+ if input_audio:
1155
+ audio_data = input_audio.get("data", "")
1156
+ audio_format = input_audio.get("format", "")
1157
+ if audio_data:
1158
+ audio_url = f"data:audio/{audio_format};base64,{audio_data}"
1159
+ else:
1160
+ # If a UUID is provided, audio data may be empty.
1161
+ audio_url = None
1162
+ else:
1163
+ audio_url = None
1164
+
1165
+ return self.parse_audio(audio_url, uuid)
1166
+
1167
+ def parse_video(self, video_url: str | None, uuid: str | None = None) -> None:
1168
+ video = (
1169
+ self._connector.fetch_video_async(video_url=video_url)
1170
+ if video_url
1171
+ else None
1172
+ )
1173
+
1174
+ placeholder = self._tracker.add("video", video, uuid)
1175
+ self._add_placeholder("video", placeholder)
1176
+
1177
+
1178
+ def validate_chat_template(chat_template: Path | str | None):
1179
+ """Raises if the provided chat template appears invalid."""
1180
+ if chat_template is None:
1181
+ return
1182
+
1183
+ elif isinstance(chat_template, Path) and not chat_template.exists():
1184
+ raise FileNotFoundError("the supplied chat template path doesn't exist")
1185
+
1186
+ elif isinstance(chat_template, str):
1187
+ JINJA_CHARS = "{}\n"
1188
+ if (
1189
+ not any(c in chat_template for c in JINJA_CHARS)
1190
+ and not Path(chat_template).exists()
1191
+ ):
1192
+ # Try to find the template in the built-in templates directory
1193
+ from vllm.transformers_utils.chat_templates.registry import (
1194
+ CHAT_TEMPLATES_DIR,
1195
+ )
1196
+
1197
+ builtin_template_path = CHAT_TEMPLATES_DIR / chat_template
1198
+ if not builtin_template_path.exists():
1199
+ raise ValueError(
1200
+ f"The supplied chat template string ({chat_template}) "
1201
+ f"appears path-like, but doesn't exist! "
1202
+ f"Tried: {chat_template} and {builtin_template_path}"
1203
+ )
1204
+
1205
+ else:
1206
+ raise TypeError(f"{type(chat_template)} is not a valid chat template type")
1207
+
1208
+
1209
+ def _load_chat_template(
1210
+ chat_template: Path | str | None,
1211
+ *,
1212
+ is_literal: bool = False,
1213
+ ) -> str | None:
1214
+ if chat_template is None:
1215
+ return None
1216
+
1217
+ if is_literal:
1218
+ if isinstance(chat_template, Path):
1219
+ raise TypeError(
1220
+ "chat_template is expected to be read directly from its value"
1221
+ )
1222
+
1223
+ return chat_template
1224
+
1225
+ try:
1226
+ with open(chat_template) as f:
1227
+ return f.read()
1228
+ except OSError as e:
1229
+ if isinstance(chat_template, Path):
1230
+ raise
1231
+
1232
+ JINJA_CHARS = "{}\n"
1233
+ if not any(c in chat_template for c in JINJA_CHARS):
1234
+ # Try to load from the built-in templates directory
1235
+ from vllm.transformers_utils.chat_templates.registry import (
1236
+ CHAT_TEMPLATES_DIR,
1237
+ )
1238
+
1239
+ builtin_template_path = CHAT_TEMPLATES_DIR / chat_template
1240
+ try:
1241
+ with open(builtin_template_path) as f:
1242
+ return f.read()
1243
+ except OSError:
1244
+ msg = (
1245
+ f"The supplied chat template ({chat_template}) "
1246
+ f"looks like a file path, but it failed to be opened. "
1247
+ f"Tried: {chat_template} and {builtin_template_path}. "
1248
+ f"Reason: {e}"
1249
+ )
1250
+ raise ValueError(msg) from e
1251
+
1252
+ # If opening a file fails, set chat template to be args to
1253
+ # ensure we decode so our escape are interpreted correctly
1254
+ return _load_chat_template(chat_template, is_literal=True)
1255
+
1256
+
1257
+ _cached_load_chat_template = lru_cache(_load_chat_template)
1258
+
1259
+
1260
+ def load_chat_template(
1261
+ chat_template: Path | str | None,
1262
+ *,
1263
+ is_literal: bool = False,
1264
+ ) -> str | None:
1265
+ return _cached_load_chat_template(chat_template, is_literal=is_literal)
1266
+
1267
+
1268
+ def _get_interleaved_text_prompt(
1269
+ placeholder_storage: dict[str, list], texts: list[str]
1270
+ ) -> str:
1271
+ for idx, elem in enumerate(texts):
1272
+ if elem in placeholder_storage:
1273
+ texts[idx] = placeholder_storage[elem].pop(0)
1274
+
1275
+ return "\n".join(texts)
1276
+
1277
+
1278
+ # TODO: Let user specify how to insert multimodal tokens into prompt
1279
+ # (similar to chat template)
1280
+ def _get_full_multimodal_text_prompt(
1281
+ placeholder_storage: dict[str, list],
1282
+ texts: list[str],
1283
+ interleave_strings: bool,
1284
+ ) -> str:
1285
+ """Combine multimodal prompts for a multimodal language model."""
1286
+
1287
+ # flatten storage to make it looks like
1288
+ # {
1289
+ # "<|image|>": 2,
1290
+ # "<|audio|>": 1
1291
+ # }
1292
+ placeholder_counts = Counter(
1293
+ [v for elem in placeholder_storage.values() for v in elem]
1294
+ )
1295
+
1296
+ if interleave_strings:
1297
+ text_prompt = _get_interleaved_text_prompt(placeholder_storage, texts)
1298
+ else:
1299
+ text_prompt = "\n".join(texts)
1300
+
1301
+ # Pass interleaved text further in case the user used image placeholders
1302
+ # himself, but forgot to disable the 'interleave_strings' flag
1303
+
1304
+ # Look through the text prompt to check for missing placeholders
1305
+ missing_placeholders: list[str] = []
1306
+ for placeholder in placeholder_counts:
1307
+ # For any existing placeholder in the text prompt, we leave it as is
1308
+ placeholder_counts[placeholder] -= text_prompt.count(placeholder)
1309
+
1310
+ if placeholder_counts[placeholder] < 0:
1311
+ logger.error(
1312
+ "Placeholder count is negative! "
1313
+ "Ensure that the 'interleave_strings' flag is disabled "
1314
+ "(current value: %s) "
1315
+ "when manually placing image placeholders.",
1316
+ interleave_strings,
1317
+ )
1318
+ logger.debug("Input prompt: %s", text_prompt)
1319
+ raise ValueError(
1320
+ f"Found more '{placeholder}' placeholders in input prompt than "
1321
+ "actual multimodal data items."
1322
+ )
1323
+
1324
+ missing_placeholders.extend([placeholder] * placeholder_counts[placeholder])
1325
+
1326
+ # NOTE: Default behaviour: we always add missing placeholders
1327
+ # at the front of the prompt, if interleave_strings=False
1328
+ return "\n".join(missing_placeholders + [text_prompt])
1329
+
1330
+
1331
+ # No need to validate using Pydantic again
1332
+ _TextParser = partial(cast, ChatCompletionContentPartTextParam)
1333
+ _ImageEmbedsParser = partial(cast, ChatCompletionContentPartImageEmbedsParam)
1334
+ _AudioEmbedsParser = partial(cast, ChatCompletionContentPartAudioEmbedsParam)
1335
+ _InputAudioParser = partial(cast, ChatCompletionContentPartInputAudioParam)
1336
+ _RefusalParser = partial(cast, ChatCompletionContentPartRefusalParam)
1337
+ _PILImageParser = partial(cast, CustomChatCompletionContentPILImageParam)
1338
+ _ThinkParser = partial(cast, CustomThinkCompletionContentParam)
1339
+ # Need to validate url objects
1340
+ _ImageParser = TypeAdapter(ChatCompletionContentPartImageParam).validate_python
1341
+ _AudioParser = TypeAdapter(ChatCompletionContentPartAudioParam).validate_python
1342
+ _VideoParser = TypeAdapter(ChatCompletionContentPartVideoParam).validate_python
1343
+
1344
+ _ResponsesInputImageParser = TypeAdapter(ResponseInputImageParam).validate_python
1345
+ _ContentPart: TypeAlias = str | dict[str, str] | InputAudio | PILImage
1346
+
1347
+ # Define a mapping from part types to their corresponding parsing functions.
1348
+ MM_PARSER_MAP: dict[
1349
+ str,
1350
+ Callable[[ChatCompletionContentPartParam], _ContentPart],
1351
+ ] = {
1352
+ "text": lambda part: _TextParser(part).get("text", None),
1353
+ "thinking": lambda part: _ThinkParser(part).get("thinking", None),
1354
+ "input_text": lambda part: _TextParser(part).get("text", None),
1355
+ "output_text": lambda part: _TextParser(part).get("text", None),
1356
+ "input_image": lambda part: _ResponsesInputImageParser(part).get("image_url", None),
1357
+ "image_url": lambda part: _ImageParser(part).get("image_url", {}).get("url", None),
1358
+ "image_embeds": lambda part: _ImageEmbedsParser(part).get("image_embeds", None),
1359
+ "audio_embeds": lambda part: _AudioEmbedsParser(part).get("audio_embeds", None),
1360
+ "image_pil": lambda part: _PILImageParser(part).get("image_pil", None),
1361
+ "audio_url": lambda part: _AudioParser(part).get("audio_url", {}).get("url", None),
1362
+ "input_audio": lambda part: _InputAudioParser(part).get("input_audio", None),
1363
+ "refusal": lambda part: _RefusalParser(part).get("refusal", None),
1364
+ "video_url": lambda part: _VideoParser(part).get("video_url", {}).get("url", None),
1365
+ }
1366
+
1367
+
1368
+ def _parse_chat_message_content_mm_part(
1369
+ part: ChatCompletionContentPartParam,
1370
+ ) -> tuple[str, _ContentPart]:
1371
+ """
1372
+ Parses a given multi-modal content part based on its type.
1373
+
1374
+ Args:
1375
+ part: A dict containing the content part, with a potential 'type' field.
1376
+
1377
+ Returns:
1378
+ A tuple (part_type, content) where:
1379
+ - part_type: Type of the part (e.g., 'text', 'image_url').
1380
+ - content: Parsed content (e.g., text, image URL).
1381
+
1382
+ Raises:
1383
+ ValueError: If the 'type' field is missing and no direct URL is found.
1384
+ """
1385
+ assert isinstance(
1386
+ part, dict
1387
+ ) # This is needed to avoid mypy errors: part.get() from str
1388
+ part_type = part.get("type", None)
1389
+ uuid = part.get("uuid", None)
1390
+
1391
+ if isinstance(part_type, str) and part_type in MM_PARSER_MAP and uuid is None: # noqa: E501
1392
+ content = MM_PARSER_MAP[part_type](part)
1393
+
1394
+ # Special case for 'image_url.detail'
1395
+ # We only support 'auto', which is the default
1396
+ if part_type == "image_url" and part.get("detail", "auto") != "auto":
1397
+ logger.warning(
1398
+ "'image_url.detail' is currently not supported and will be ignored."
1399
+ )
1400
+
1401
+ return part_type, content
1402
+
1403
+ # Handle missing 'type' but provided direct URL fields.
1404
+ # 'type' is required field by pydantic
1405
+ if part_type is None or uuid is not None:
1406
+ if "image_url" in part:
1407
+ image_params = cast(CustomChatCompletionContentSimpleImageParam, part)
1408
+ image_url = image_params.get("image_url", None)
1409
+ if isinstance(image_url, dict):
1410
+ # Can potentially happen if user provides a uuid
1411
+ # with url as a dict of {"url": url}
1412
+ image_url = image_url.get("url", None)
1413
+ return "image_url", image_url
1414
+ if "image_pil" in part:
1415
+ # "image_pil" could be None if UUID is provided.
1416
+ image_params = cast( # type: ignore
1417
+ CustomChatCompletionContentPILImageParam, part
1418
+ )
1419
+ image_pil = image_params.get("image_pil", None)
1420
+ return "image_pil", image_pil
1421
+ if "image_embeds" in part:
1422
+ # "image_embeds" could be None if UUID is provided.
1423
+ image_params = cast( # type: ignore
1424
+ ChatCompletionContentPartImageEmbedsParam, part
1425
+ )
1426
+ image_embeds = image_params.get("image_embeds", None)
1427
+ return "image_embeds", image_embeds
1428
+ if "audio_embeds" in part:
1429
+ # "audio_embeds" could be None if UUID is provided.
1430
+ audio_params = cast( # type: ignore[assignment]
1431
+ ChatCompletionContentPartAudioEmbedsParam, part
1432
+ )
1433
+ audio_embeds = audio_params.get("audio_embeds", None)
1434
+ return "audio_embeds", audio_embeds
1435
+ if "audio_url" in part:
1436
+ audio_params = cast( # type: ignore[assignment]
1437
+ CustomChatCompletionContentSimpleAudioParam, part
1438
+ )
1439
+ audio_url = audio_params.get("audio_url", None)
1440
+ if isinstance(audio_url, dict):
1441
+ # Can potentially happen if user provides a uuid
1442
+ # with url as a dict of {"url": url}
1443
+ audio_url = audio_url.get("url", None)
1444
+ return "audio_url", audio_url
1445
+ if part.get("input_audio") is not None:
1446
+ input_audio_params = cast(dict[str, str], part)
1447
+ return "input_audio", input_audio_params
1448
+ if "video_url" in part:
1449
+ video_params = cast(CustomChatCompletionContentSimpleVideoParam, part)
1450
+ video_url = video_params.get("video_url", None)
1451
+ if isinstance(video_url, dict):
1452
+ # Can potentially happen if user provides a uuid
1453
+ # with url as a dict of {"url": url}
1454
+ video_url = video_url.get("url", None)
1455
+ return "video_url", video_url
1456
+ # Raise an error if no 'type' or direct URL is found.
1457
+ raise ValueError("Missing 'type' field in multimodal part.")
1458
+
1459
+ if not isinstance(part_type, str):
1460
+ raise ValueError("Invalid 'type' field in multimodal part.")
1461
+ return part_type, "unknown part_type content"
1462
+
1463
+
1464
+ PART_TYPES_TO_SKIP_NONE_CONTENT = (
1465
+ "text",
1466
+ "refusal",
1467
+ )
1468
+
1469
+
1470
+ def _parse_chat_message_content_parts(
1471
+ role: str,
1472
+ parts: Iterable[ChatCompletionContentPartParam],
1473
+ mm_tracker: BaseMultiModalItemTracker,
1474
+ *,
1475
+ wrap_dicts: bool,
1476
+ interleave_strings: bool,
1477
+ ) -> list[ConversationMessage]:
1478
+ content = list[_ContentPart]()
1479
+
1480
+ mm_parser = mm_tracker.create_parser()
1481
+
1482
+ for part in parts:
1483
+ parse_res = _parse_chat_message_content_part(
1484
+ part,
1485
+ mm_parser,
1486
+ wrap_dicts=wrap_dicts,
1487
+ interleave_strings=interleave_strings,
1488
+ )
1489
+ if parse_res:
1490
+ content.append(parse_res)
1491
+
1492
+ if wrap_dicts:
1493
+ # Parsing wraps images and texts as interleaved dictionaries
1494
+ return [ConversationMessage(role=role, content=content)] # type: ignore
1495
+ texts = cast(list[str], content)
1496
+ mm_placeholder_storage = mm_parser.mm_placeholder_storage()
1497
+ if mm_placeholder_storage:
1498
+ text_prompt = _get_full_multimodal_text_prompt(
1499
+ mm_placeholder_storage, texts, interleave_strings
1500
+ )
1501
+ else:
1502
+ text_prompt = "\n".join(texts)
1503
+
1504
+ return [ConversationMessage(role=role, content=text_prompt)]
1505
+
1506
+
1507
+ def _parse_chat_message_content_part(
1508
+ part: ChatCompletionContentPartParam,
1509
+ mm_parser: BaseMultiModalContentParser,
1510
+ *,
1511
+ wrap_dicts: bool,
1512
+ interleave_strings: bool,
1513
+ ) -> _ContentPart | None:
1514
+ """Parses a single part of a conversation. If wrap_dicts is True,
1515
+ structured dictionary pieces for texts and images will be
1516
+ wrapped in dictionaries, i.e., {"type": "text", "text", ...} and
1517
+ {"type": "image"}, respectively. Otherwise multimodal data will be
1518
+ handled by mm_parser, and texts will be returned as strings to be joined
1519
+ with multimodal placeholders.
1520
+ """
1521
+ if isinstance(part, str): # Handle plain text parts
1522
+ return part
1523
+ # Handle structured dictionary parts
1524
+ part_type, content = _parse_chat_message_content_mm_part(part)
1525
+ # if part_type is text/refusal/image_url/audio_url/video_url/input_audio but
1526
+ # content is None, log a warning and skip
1527
+ if part_type in PART_TYPES_TO_SKIP_NONE_CONTENT and content is None:
1528
+ logger.warning(
1529
+ "Skipping multimodal part '%s' (type: '%s') "
1530
+ "with empty / unparsable content.",
1531
+ part,
1532
+ part_type,
1533
+ )
1534
+ return None
1535
+
1536
+ if part_type in ("text", "input_text", "output_text", "refusal", "thinking"):
1537
+ str_content = cast(str, content)
1538
+ if wrap_dicts:
1539
+ return {"type": "text", "text": str_content}
1540
+ else:
1541
+ return str_content
1542
+
1543
+ # For media items, if a user has provided one, use it. Otherwise, insert
1544
+ # a placeholder empty uuid.
1545
+ uuid = part.get("uuid", None)
1546
+ if uuid is not None:
1547
+ uuid = str(uuid)
1548
+
1549
+ modality = None
1550
+ if part_type == "image_pil":
1551
+ image_content = cast(Image.Image, content) if content is not None else None
1552
+ mm_parser.parse_image_pil(image_content, uuid)
1553
+ modality = "image"
1554
+ elif part_type in ("image_url", "input_image"):
1555
+ str_content = cast(str, content)
1556
+ mm_parser.parse_image(str_content, uuid)
1557
+ modality = "image"
1558
+ elif part_type == "image_embeds":
1559
+ content = cast(str | dict[str, str], content) if content is not None else None
1560
+ mm_parser.parse_image_embeds(content, uuid)
1561
+ modality = "image"
1562
+ elif part_type == "audio_embeds":
1563
+ content = cast(str | dict[str, str], content) if content is not None else None
1564
+ mm_parser.parse_audio_embeds(content, uuid)
1565
+ modality = "audio"
1566
+ elif part_type == "audio_url":
1567
+ str_content = cast(str, content)
1568
+ mm_parser.parse_audio(str_content, uuid)
1569
+ modality = "audio"
1570
+ elif part_type == "input_audio":
1571
+ dict_content = cast(InputAudio, content)
1572
+ mm_parser.parse_input_audio(dict_content, uuid)
1573
+ modality = "audio"
1574
+ elif part_type == "video_url":
1575
+ str_content = cast(str, content)
1576
+ mm_parser.parse_video(str_content, uuid)
1577
+ modality = "video"
1578
+ else:
1579
+ raise NotImplementedError(f"Unknown part type: {part_type}")
1580
+
1581
+ return (
1582
+ {"type": modality}
1583
+ if wrap_dicts
1584
+ else (MODALITY_PLACEHOLDERS_MAP[modality] if interleave_strings else None)
1585
+ )
1586
+
1587
+
1588
+ # No need to validate using Pydantic again
1589
+ _AssistantParser = partial(cast, ChatCompletionAssistantMessageParam)
1590
+ _ToolParser = partial(cast, ChatCompletionToolMessageParam)
1591
+
1592
+
1593
+ def _parse_chat_message_content(
1594
+ message: ChatCompletionMessageParam,
1595
+ mm_tracker: BaseMultiModalItemTracker,
1596
+ content_format: _ChatTemplateContentFormat,
1597
+ interleave_strings: bool,
1598
+ ) -> list[ConversationMessage]:
1599
+ role = message["role"]
1600
+ content = message.get("content")
1601
+ reasoning = message.get("reasoning") or message.get("reasoning_content")
1602
+
1603
+ if content is None:
1604
+ content = []
1605
+ elif isinstance(content, str):
1606
+ content = [ChatCompletionContentPartTextParam(type="text", text=content)]
1607
+ result = _parse_chat_message_content_parts(
1608
+ role,
1609
+ content, # type: ignore
1610
+ mm_tracker,
1611
+ wrap_dicts=(content_format == "openai"),
1612
+ interleave_strings=interleave_strings,
1613
+ )
1614
+
1615
+ for result_msg in result:
1616
+ if role == "assistant":
1617
+ parsed_msg = _AssistantParser(message)
1618
+
1619
+ # The 'tool_calls' is not None check ensures compatibility.
1620
+ # It's needed only if downstream code doesn't strictly
1621
+ # follow the OpenAI spec.
1622
+ if "tool_calls" in parsed_msg and parsed_msg["tool_calls"] is not None:
1623
+ result_msg["tool_calls"] = list(parsed_msg["tool_calls"])
1624
+ # Include reasoning if present for interleaved thinking.
1625
+ if reasoning is not None:
1626
+ result_msg["reasoning"] = cast(str, reasoning)
1627
+ result_msg["reasoning_content"] = cast(
1628
+ str, reasoning
1629
+ ) # keep compatibility
1630
+ elif role == "tool":
1631
+ parsed_msg = _ToolParser(message)
1632
+ if "tool_call_id" in parsed_msg:
1633
+ result_msg["tool_call_id"] = parsed_msg["tool_call_id"]
1634
+
1635
+ if "name" in message and isinstance(message["name"], str):
1636
+ result_msg["name"] = message["name"]
1637
+
1638
+ if role == "developer":
1639
+ result_msg["tools"] = message.get("tools", None)
1640
+ return result
1641
+
1642
+
1643
+ def _postprocess_messages(messages: list[ConversationMessage]) -> None:
1644
+ # per the Transformers docs & maintainers, tool call arguments in
1645
+ # assistant-role messages with tool_calls need to be dicts not JSON str -
1646
+ # this is how tool-use chat templates will expect them moving forwards
1647
+ # so, for messages that have tool_calls, parse the string (which we get
1648
+ # from openAI format) to dict
1649
+ for message in messages:
1650
+ if message["role"] == "assistant" and "tool_calls" in message:
1651
+ tool_calls = message.get("tool_calls")
1652
+ if not isinstance(tool_calls, list):
1653
+ continue
1654
+
1655
+ if len(tool_calls) == 0:
1656
+ # Drop empty tool_calls to keep templates on the normal assistant path.
1657
+ message.pop("tool_calls", None)
1658
+ continue
1659
+
1660
+ for item in tool_calls:
1661
+ # if arguments is None or empty string, set to {}
1662
+ if content := item["function"].get("arguments"):
1663
+ if not isinstance(content, (dict, list)):
1664
+ item["function"]["arguments"] = json.loads(content)
1665
+ else:
1666
+ item["function"]["arguments"] = {}
1667
+
1668
+
1669
+ def parse_chat_messages(
1670
+ messages: list[ChatCompletionMessageParam],
1671
+ model_config: ModelConfig,
1672
+ content_format: _ChatTemplateContentFormat,
1673
+ ) -> tuple[
1674
+ list[ConversationMessage],
1675
+ MultiModalDataDict | None,
1676
+ MultiModalUUIDDict | None,
1677
+ ]:
1678
+ conversation: list[ConversationMessage] = []
1679
+ mm_tracker = MultiModalItemTracker(model_config)
1680
+
1681
+ for msg in messages:
1682
+ sub_messages = _parse_chat_message_content(
1683
+ msg,
1684
+ mm_tracker,
1685
+ content_format,
1686
+ interleave_strings=(
1687
+ content_format == "string"
1688
+ and model_config.multimodal_config is not None
1689
+ and model_config.multimodal_config.interleave_mm_strings
1690
+ ),
1691
+ )
1692
+
1693
+ conversation.extend(sub_messages)
1694
+
1695
+ _postprocess_messages(conversation)
1696
+
1697
+ return conversation, mm_tracker.all_mm_data(), mm_tracker.all_mm_uuids()
1698
+
1699
+
1700
+ def parse_chat_messages_futures(
1701
+ messages: list[ChatCompletionMessageParam],
1702
+ model_config: ModelConfig,
1703
+ content_format: _ChatTemplateContentFormat,
1704
+ ) -> tuple[
1705
+ list[ConversationMessage],
1706
+ Awaitable[MultiModalDataDict | None],
1707
+ MultiModalUUIDDict | None,
1708
+ ]:
1709
+ conversation: list[ConversationMessage] = []
1710
+ mm_tracker = AsyncMultiModalItemTracker(model_config)
1711
+
1712
+ for msg in messages:
1713
+ sub_messages = _parse_chat_message_content(
1714
+ msg,
1715
+ mm_tracker,
1716
+ content_format,
1717
+ interleave_strings=(
1718
+ content_format == "string"
1719
+ and model_config.multimodal_config is not None
1720
+ and model_config.multimodal_config.interleave_mm_strings
1721
+ ),
1722
+ )
1723
+
1724
+ conversation.extend(sub_messages)
1725
+
1726
+ _postprocess_messages(conversation)
1727
+
1728
+ return conversation, mm_tracker.all_mm_data(), mm_tracker.all_mm_uuids()
1729
+
1730
+
1731
+ # adapted from https://github.com/huggingface/transformers/blob/v4.56.2/src/transformers/utils/chat_template_utils.py#L398-L412
1732
+ # only preserve the parse function used to resolve chat template kwargs
1733
+ class AssistantTracker(jinja2.ext.Extension):
1734
+ tags = {"generation"}
1735
+
1736
+ def parse(self, parser: jinja2.parser.Parser) -> jinja2.nodes.CallBlock:
1737
+ lineno = next(parser.stream).lineno
1738
+ body = parser.parse_statements(["name:endgeneration"], drop_needle=True)
1739
+ call = self.call_method("_generation_support")
1740
+ call_block = jinja2.nodes.CallBlock(call, [], [], body)
1741
+ return call_block.set_lineno(lineno)
1742
+
1743
+
1744
+ def _resolve_chat_template_kwargs(
1745
+ chat_template: str,
1746
+ ):
1747
+ env = jinja2.sandbox.ImmutableSandboxedEnvironment(
1748
+ trim_blocks=True,
1749
+ lstrip_blocks=True,
1750
+ extensions=[AssistantTracker, jinja2.ext.loopcontrols],
1751
+ )
1752
+ parsed_content = env.parse(chat_template)
1753
+ template_vars = jinja2.meta.find_undeclared_variables(parsed_content)
1754
+ return template_vars
1755
+
1756
+
1757
+ _cached_resolve_chat_template_kwargs = lru_cache(_resolve_chat_template_kwargs)
1758
+
1759
+
1760
+ @lru_cache
1761
+ def _get_hf_base_chat_template_params() -> frozenset[str]:
1762
+ # Get standard parameters from HuggingFace's base tokenizer class.
1763
+ # This dynamically extracts parameters from PreTrainedTokenizer's
1764
+ # apply_chat_template method, ensuring compatibility with tokenizers
1765
+ # that use **kwargs to receive standard parameters.
1766
+
1767
+ # Read signature from HF's base class - the single source of truth
1768
+ base_sig = inspect.signature(PreTrainedTokenizer.apply_chat_template)
1769
+ # Exclude VAR_KEYWORD (**kwargs) and VAR_POSITIONAL (*args) placeholders
1770
+ return frozenset(
1771
+ p.name
1772
+ for p in base_sig.parameters.values()
1773
+ if p.kind
1774
+ not in (inspect.Parameter.VAR_KEYWORD, inspect.Parameter.VAR_POSITIONAL)
1775
+ )
1776
+
1777
+
1778
+ def resolve_chat_template_kwargs(
1779
+ tokenizer: PreTrainedTokenizer | PreTrainedTokenizerFast,
1780
+ chat_template: str,
1781
+ chat_template_kwargs: dict[str, Any],
1782
+ raise_on_unexpected: bool = True,
1783
+ ) -> dict[str, Any]:
1784
+ # We exclude chat_template from kwargs here, because
1785
+ # chat template has been already resolved at this stage
1786
+ unexpected_vars = {"chat_template", "tokenize"}
1787
+ if raise_on_unexpected and (
1788
+ unexpected_in_kwargs := unexpected_vars & chat_template_kwargs.keys()
1789
+ ):
1790
+ raise ValueError(
1791
+ "Found unexpected chat template kwargs from request: "
1792
+ f"{unexpected_in_kwargs}"
1793
+ )
1794
+
1795
+ fn_kw = {
1796
+ k
1797
+ for k in chat_template_kwargs
1798
+ if supports_kw(tokenizer.apply_chat_template, k, allow_var_kwargs=False)
1799
+ }
1800
+ template_vars = _cached_resolve_chat_template_kwargs(chat_template)
1801
+
1802
+ # Allow standard HF parameters even if tokenizer uses **kwargs to receive them
1803
+ hf_base_params = _get_hf_base_chat_template_params()
1804
+
1805
+ accept_vars = (fn_kw | template_vars | hf_base_params) - unexpected_vars
1806
+ return {k: v for k, v in chat_template_kwargs.items() if k in accept_vars}
1807
+
1808
+
1809
+ def apply_hf_chat_template(
1810
+ tokenizer: PreTrainedTokenizer | PreTrainedTokenizerFast,
1811
+ conversation: list[ConversationMessage],
1812
+ chat_template: str | None,
1813
+ tools: list[dict[str, Any]] | None,
1814
+ *,
1815
+ model_config: ModelConfig,
1816
+ **kwargs: Any,
1817
+ ) -> str:
1818
+ hf_chat_template = resolve_hf_chat_template(
1819
+ tokenizer,
1820
+ chat_template=chat_template,
1821
+ tools=tools,
1822
+ model_config=model_config,
1823
+ )
1824
+
1825
+ if hf_chat_template is None:
1826
+ raise ChatTemplateResolutionError(
1827
+ "As of transformers v4.44, default chat template is no longer "
1828
+ "allowed, so you must provide a chat template if the tokenizer "
1829
+ "does not define one."
1830
+ )
1831
+
1832
+ resolved_kwargs = resolve_chat_template_kwargs(
1833
+ tokenizer=tokenizer,
1834
+ chat_template=hf_chat_template,
1835
+ chat_template_kwargs=kwargs,
1836
+ )
1837
+
1838
+ try:
1839
+ return tokenizer.apply_chat_template(
1840
+ conversation=conversation, # type: ignore[arg-type]
1841
+ tools=tools, # type: ignore[arg-type]
1842
+ chat_template=hf_chat_template,
1843
+ tokenize=False,
1844
+ **resolved_kwargs,
1845
+ )
1846
+
1847
+ # External library exceptions can sometimes occur despite the framework's
1848
+ # internal exception management capabilities.
1849
+ except Exception as e:
1850
+ # Log and report any library-related exceptions for further
1851
+ # investigation.
1852
+ logger.exception(
1853
+ "An error occurred in `transformers` while applying chat template"
1854
+ )
1855
+ raise ValueError(str(e)) from e
1856
+
1857
+
1858
+ def apply_mistral_chat_template(
1859
+ tokenizer: "MistralTokenizer",
1860
+ messages: list[ChatCompletionMessageParam],
1861
+ chat_template: str | None,
1862
+ tools: list[dict[str, Any]] | None,
1863
+ **kwargs: Any,
1864
+ ) -> list[int]:
1865
+ from mistral_common.exceptions import MistralCommonException
1866
+
1867
+ # The return value of resolve_mistral_chat_template is always None,
1868
+ # and we won't use it.
1869
+ resolve_mistral_chat_template(
1870
+ chat_template=chat_template,
1871
+ **kwargs,
1872
+ )
1873
+
1874
+ try:
1875
+ return tokenizer.apply_chat_template(
1876
+ messages=messages,
1877
+ tools=tools,
1878
+ **kwargs,
1879
+ )
1880
+ # mistral-common uses assert statements to stop processing of input
1881
+ # if input does not comply with the expected format.
1882
+ # We convert those assertion errors to ValueErrors so they can be
1883
+ # properly caught in the preprocessing_input step
1884
+ except (AssertionError, MistralCommonException) as e:
1885
+ raise ValueError(str(e)) from e
1886
+
1887
+ # External library exceptions can sometimes occur despite the framework's
1888
+ # internal exception management capabilities.
1889
+ except Exception as e:
1890
+ # Log and report any library-related exceptions for further
1891
+ # investigation.
1892
+ logger.exception(
1893
+ "An error occurred in `mistral_common` while applying chat template"
1894
+ )
1895
+ raise ValueError(str(e)) from e
1896
+
1897
+
1898
+ def get_history_tool_calls_cnt(conversation: list[ConversationMessage]):
1899
+ idx = 0
1900
+ for msg in conversation:
1901
+ if msg["role"] == "assistant":
1902
+ tool_calls = msg.get("tool_calls")
1903
+ idx += len(list(tool_calls)) if tool_calls is not None else 0 # noqa
1904
+ return idx
1905
+
1906
+
1907
+ def make_tool_call_id(id_type: str = "random", func_name=None, idx=None):
1908
+ if id_type == "kimi_k2":
1909
+ return f"functions.{func_name}:{idx}"
1910
+ else:
1911
+ # by default return random
1912
+ return f"chatcmpl-tool-{random_uuid()}"