vllm-cpu 0.11.0.post2__cp312-cp312-manylinux_2_17_x86_64.whl

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