vllm-cpu-avx512vnni 0.13.0__cp313-cp313-manylinux_2_28_x86_64.whl

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

Potentially problematic release.


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

Files changed (1641) hide show
  1. vllm/_C.abi3.so +0 -0
  2. vllm/__init__.py +225 -0
  3. vllm/_aiter_ops.py +1260 -0
  4. vllm/_bc_linter.py +54 -0
  5. vllm/_custom_ops.py +3080 -0
  6. vllm/_ipex_ops.py +457 -0
  7. vllm/_version.py +34 -0
  8. vllm/assets/__init__.py +0 -0
  9. vllm/assets/audio.py +43 -0
  10. vllm/assets/base.py +40 -0
  11. vllm/assets/image.py +59 -0
  12. vllm/assets/video.py +149 -0
  13. vllm/attention/__init__.py +0 -0
  14. vllm/attention/backends/__init__.py +0 -0
  15. vllm/attention/backends/abstract.py +443 -0
  16. vllm/attention/backends/registry.py +254 -0
  17. vllm/attention/backends/utils.py +33 -0
  18. vllm/attention/layer.py +969 -0
  19. vllm/attention/layers/__init__.py +0 -0
  20. vllm/attention/layers/chunked_local_attention.py +120 -0
  21. vllm/attention/layers/cross_attention.py +178 -0
  22. vllm/attention/layers/encoder_only_attention.py +103 -0
  23. vllm/attention/layers/mm_encoder_attention.py +284 -0
  24. vllm/attention/ops/__init__.py +0 -0
  25. vllm/attention/ops/chunked_prefill_paged_decode.py +401 -0
  26. vllm/attention/ops/common.py +469 -0
  27. vllm/attention/ops/flashmla.py +251 -0
  28. vllm/attention/ops/merge_attn_states.py +47 -0
  29. vllm/attention/ops/paged_attn.py +51 -0
  30. vllm/attention/ops/pallas_kv_cache_update.py +130 -0
  31. vllm/attention/ops/prefix_prefill.py +814 -0
  32. vllm/attention/ops/rocm_aiter_mla_sparse.py +210 -0
  33. vllm/attention/ops/triton_decode_attention.py +712 -0
  34. vllm/attention/ops/triton_merge_attn_states.py +116 -0
  35. vllm/attention/ops/triton_reshape_and_cache_flash.py +184 -0
  36. vllm/attention/ops/triton_unified_attention.py +1047 -0
  37. vllm/attention/ops/vit_attn_wrappers.py +139 -0
  38. vllm/attention/selector.py +145 -0
  39. vllm/attention/utils/__init__.py +0 -0
  40. vllm/attention/utils/fa_utils.py +118 -0
  41. vllm/attention/utils/kv_sharing_utils.py +33 -0
  42. vllm/attention/utils/kv_transfer_utils.py +60 -0
  43. vllm/beam_search.py +88 -0
  44. vllm/benchmarks/__init__.py +0 -0
  45. vllm/benchmarks/datasets.py +3228 -0
  46. vllm/benchmarks/latency.py +170 -0
  47. vllm/benchmarks/lib/__init__.py +3 -0
  48. vllm/benchmarks/lib/endpoint_request_func.py +777 -0
  49. vllm/benchmarks/lib/ready_checker.py +72 -0
  50. vllm/benchmarks/lib/utils.py +79 -0
  51. vllm/benchmarks/serve.py +1538 -0
  52. vllm/benchmarks/startup.py +326 -0
  53. vllm/benchmarks/sweep/__init__.py +0 -0
  54. vllm/benchmarks/sweep/cli.py +41 -0
  55. vllm/benchmarks/sweep/param_sweep.py +158 -0
  56. vllm/benchmarks/sweep/plot.py +675 -0
  57. vllm/benchmarks/sweep/plot_pareto.py +393 -0
  58. vllm/benchmarks/sweep/serve.py +450 -0
  59. vllm/benchmarks/sweep/serve_sla.py +492 -0
  60. vllm/benchmarks/sweep/server.py +114 -0
  61. vllm/benchmarks/sweep/sla_sweep.py +132 -0
  62. vllm/benchmarks/sweep/utils.py +4 -0
  63. vllm/benchmarks/throughput.py +808 -0
  64. vllm/collect_env.py +857 -0
  65. vllm/compilation/__init__.py +0 -0
  66. vllm/compilation/activation_quant_fusion.py +209 -0
  67. vllm/compilation/backends.py +839 -0
  68. vllm/compilation/base_static_graph.py +57 -0
  69. vllm/compilation/caching.py +180 -0
  70. vllm/compilation/collective_fusion.py +1215 -0
  71. vllm/compilation/compiler_interface.py +639 -0
  72. vllm/compilation/counter.py +48 -0
  73. vllm/compilation/cuda_graph.py +302 -0
  74. vllm/compilation/decorators.py +626 -0
  75. vllm/compilation/fix_functionalization.py +266 -0
  76. vllm/compilation/fusion.py +550 -0
  77. vllm/compilation/fusion_attn.py +359 -0
  78. vllm/compilation/fx_utils.py +91 -0
  79. vllm/compilation/inductor_pass.py +138 -0
  80. vllm/compilation/matcher_utils.py +361 -0
  81. vllm/compilation/monitor.py +62 -0
  82. vllm/compilation/noop_elimination.py +130 -0
  83. vllm/compilation/partition_rules.py +72 -0
  84. vllm/compilation/pass_manager.py +155 -0
  85. vllm/compilation/piecewise_backend.py +178 -0
  86. vllm/compilation/post_cleanup.py +21 -0
  87. vllm/compilation/qk_norm_rope_fusion.py +238 -0
  88. vllm/compilation/rocm_aiter_fusion.py +242 -0
  89. vllm/compilation/sequence_parallelism.py +364 -0
  90. vllm/compilation/torch25_custom_graph_pass.py +44 -0
  91. vllm/compilation/vllm_inductor_pass.py +173 -0
  92. vllm/compilation/wrapper.py +319 -0
  93. vllm/config/__init__.py +108 -0
  94. vllm/config/attention.py +114 -0
  95. vllm/config/cache.py +232 -0
  96. vllm/config/compilation.py +1140 -0
  97. vllm/config/device.py +75 -0
  98. vllm/config/ec_transfer.py +110 -0
  99. vllm/config/kv_events.py +56 -0
  100. vllm/config/kv_transfer.py +119 -0
  101. vllm/config/load.py +124 -0
  102. vllm/config/lora.py +96 -0
  103. vllm/config/model.py +2190 -0
  104. vllm/config/multimodal.py +247 -0
  105. vllm/config/observability.py +140 -0
  106. vllm/config/parallel.py +660 -0
  107. vllm/config/pooler.py +126 -0
  108. vllm/config/profiler.py +199 -0
  109. vllm/config/scheduler.py +299 -0
  110. vllm/config/speculative.py +644 -0
  111. vllm/config/speech_to_text.py +38 -0
  112. vllm/config/structured_outputs.py +78 -0
  113. vllm/config/utils.py +370 -0
  114. vllm/config/vllm.py +1434 -0
  115. vllm/connections.py +189 -0
  116. vllm/device_allocator/__init__.py +0 -0
  117. vllm/device_allocator/cumem.py +327 -0
  118. vllm/distributed/__init__.py +6 -0
  119. vllm/distributed/communication_op.py +43 -0
  120. vllm/distributed/device_communicators/__init__.py +0 -0
  121. vllm/distributed/device_communicators/all2all.py +490 -0
  122. vllm/distributed/device_communicators/all_reduce_utils.py +344 -0
  123. vllm/distributed/device_communicators/base_device_communicator.py +297 -0
  124. vllm/distributed/device_communicators/cpu_communicator.py +209 -0
  125. vllm/distributed/device_communicators/cuda_communicator.py +340 -0
  126. vllm/distributed/device_communicators/cuda_wrapper.py +216 -0
  127. vllm/distributed/device_communicators/custom_all_reduce.py +326 -0
  128. vllm/distributed/device_communicators/mnnvl_compat.py +27 -0
  129. vllm/distributed/device_communicators/pynccl.py +386 -0
  130. vllm/distributed/device_communicators/pynccl_allocator.py +191 -0
  131. vllm/distributed/device_communicators/pynccl_wrapper.py +564 -0
  132. vllm/distributed/device_communicators/quick_all_reduce.py +290 -0
  133. vllm/distributed/device_communicators/ray_communicator.py +259 -0
  134. vllm/distributed/device_communicators/shm_broadcast.py +778 -0
  135. vllm/distributed/device_communicators/shm_object_storage.py +697 -0
  136. vllm/distributed/device_communicators/symm_mem.py +156 -0
  137. vllm/distributed/device_communicators/tpu_communicator.py +99 -0
  138. vllm/distributed/device_communicators/xpu_communicator.py +95 -0
  139. vllm/distributed/ec_transfer/__init__.py +14 -0
  140. vllm/distributed/ec_transfer/ec_connector/__init__.py +0 -0
  141. vllm/distributed/ec_transfer/ec_connector/base.py +247 -0
  142. vllm/distributed/ec_transfer/ec_connector/example_connector.py +201 -0
  143. vllm/distributed/ec_transfer/ec_connector/factory.py +85 -0
  144. vllm/distributed/ec_transfer/ec_transfer_state.py +42 -0
  145. vllm/distributed/eplb/__init__.py +3 -0
  146. vllm/distributed/eplb/async_worker.py +115 -0
  147. vllm/distributed/eplb/eplb_state.py +1164 -0
  148. vllm/distributed/eplb/policy/__init__.py +19 -0
  149. vllm/distributed/eplb/policy/abstract.py +40 -0
  150. vllm/distributed/eplb/policy/default.py +267 -0
  151. vllm/distributed/eplb/rebalance_execute.py +529 -0
  152. vllm/distributed/kv_events.py +499 -0
  153. vllm/distributed/kv_transfer/README.md +29 -0
  154. vllm/distributed/kv_transfer/__init__.py +20 -0
  155. vllm/distributed/kv_transfer/disagg_prefill_workflow.jpg +0 -0
  156. vllm/distributed/kv_transfer/kv_connector/__init__.py +0 -0
  157. vllm/distributed/kv_transfer/kv_connector/base.py +10 -0
  158. vllm/distributed/kv_transfer/kv_connector/factory.py +197 -0
  159. vllm/distributed/kv_transfer/kv_connector/utils.py +322 -0
  160. vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +19 -0
  161. vllm/distributed/kv_transfer/kv_connector/v1/base.py +597 -0
  162. vllm/distributed/kv_transfer/kv_connector/v1/decode_bench_connector.py +419 -0
  163. vllm/distributed/kv_transfer/kv_connector/v1/example_connector.py +450 -0
  164. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +327 -0
  165. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/__init__.py +18 -0
  166. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/multi_process_adapter.py +378 -0
  167. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/utils.py +221 -0
  168. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/vllm_v1_adapter.py +1418 -0
  169. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_mp_connector.py +895 -0
  170. vllm/distributed/kv_transfer/kv_connector/v1/metrics.py +186 -0
  171. vllm/distributed/kv_transfer/kv_connector/v1/mooncake_connector.py +914 -0
  172. vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +464 -0
  173. vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +2526 -0
  174. vllm/distributed/kv_transfer/kv_connector/v1/offloading_connector.py +538 -0
  175. vllm/distributed/kv_transfer/kv_connector/v1/p2p/__init__.py +0 -0
  176. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_connector.py +531 -0
  177. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py +632 -0
  178. vllm/distributed/kv_transfer/kv_connector/v1/p2p/tensor_memory_pool.py +273 -0
  179. vllm/distributed/kv_transfer/kv_transfer_state.py +78 -0
  180. vllm/distributed/parallel_state.py +1795 -0
  181. vllm/distributed/tpu_distributed_utils.py +188 -0
  182. vllm/distributed/utils.py +545 -0
  183. vllm/engine/__init__.py +0 -0
  184. vllm/engine/arg_utils.py +2068 -0
  185. vllm/engine/async_llm_engine.py +6 -0
  186. vllm/engine/llm_engine.py +6 -0
  187. vllm/engine/protocol.py +190 -0
  188. vllm/entrypoints/__init__.py +0 -0
  189. vllm/entrypoints/anthropic/__init__.py +0 -0
  190. vllm/entrypoints/anthropic/protocol.py +162 -0
  191. vllm/entrypoints/anthropic/serving_messages.py +468 -0
  192. vllm/entrypoints/api_server.py +185 -0
  193. vllm/entrypoints/chat_utils.py +1903 -0
  194. vllm/entrypoints/cli/__init__.py +15 -0
  195. vllm/entrypoints/cli/benchmark/__init__.py +0 -0
  196. vllm/entrypoints/cli/benchmark/base.py +25 -0
  197. vllm/entrypoints/cli/benchmark/latency.py +21 -0
  198. vllm/entrypoints/cli/benchmark/main.py +56 -0
  199. vllm/entrypoints/cli/benchmark/serve.py +21 -0
  200. vllm/entrypoints/cli/benchmark/startup.py +21 -0
  201. vllm/entrypoints/cli/benchmark/sweep.py +21 -0
  202. vllm/entrypoints/cli/benchmark/throughput.py +21 -0
  203. vllm/entrypoints/cli/collect_env.py +38 -0
  204. vllm/entrypoints/cli/main.py +79 -0
  205. vllm/entrypoints/cli/openai.py +260 -0
  206. vllm/entrypoints/cli/run_batch.py +68 -0
  207. vllm/entrypoints/cli/serve.py +249 -0
  208. vllm/entrypoints/cli/types.py +29 -0
  209. vllm/entrypoints/constants.py +12 -0
  210. vllm/entrypoints/context.py +835 -0
  211. vllm/entrypoints/launcher.py +175 -0
  212. vllm/entrypoints/llm.py +1790 -0
  213. vllm/entrypoints/logger.py +84 -0
  214. vllm/entrypoints/openai/__init__.py +0 -0
  215. vllm/entrypoints/openai/api_server.py +1469 -0
  216. vllm/entrypoints/openai/cli_args.py +302 -0
  217. vllm/entrypoints/openai/orca_metrics.py +120 -0
  218. vllm/entrypoints/openai/parser/__init__.py +0 -0
  219. vllm/entrypoints/openai/parser/harmony_utils.py +825 -0
  220. vllm/entrypoints/openai/parser/responses_parser.py +135 -0
  221. vllm/entrypoints/openai/protocol.py +2496 -0
  222. vllm/entrypoints/openai/run_batch.py +631 -0
  223. vllm/entrypoints/openai/serving_chat.py +1822 -0
  224. vllm/entrypoints/openai/serving_completion.py +729 -0
  225. vllm/entrypoints/openai/serving_engine.py +1542 -0
  226. vllm/entrypoints/openai/serving_models.py +304 -0
  227. vllm/entrypoints/openai/serving_responses.py +2080 -0
  228. vllm/entrypoints/openai/serving_transcription.py +168 -0
  229. vllm/entrypoints/openai/speech_to_text.py +559 -0
  230. vllm/entrypoints/openai/tool_parsers/__init__.py +33 -0
  231. vllm/entrypoints/openai/utils.py +49 -0
  232. vllm/entrypoints/pooling/__init__.py +16 -0
  233. vllm/entrypoints/pooling/classify/__init__.py +0 -0
  234. vllm/entrypoints/pooling/classify/api_router.py +50 -0
  235. vllm/entrypoints/pooling/classify/protocol.py +181 -0
  236. vllm/entrypoints/pooling/classify/serving.py +233 -0
  237. vllm/entrypoints/pooling/embed/__init__.py +0 -0
  238. vllm/entrypoints/pooling/embed/api_router.py +67 -0
  239. vllm/entrypoints/pooling/embed/protocol.py +208 -0
  240. vllm/entrypoints/pooling/embed/serving.py +684 -0
  241. vllm/entrypoints/pooling/pooling/__init__.py +0 -0
  242. vllm/entrypoints/pooling/pooling/api_router.py +63 -0
  243. vllm/entrypoints/pooling/pooling/protocol.py +148 -0
  244. vllm/entrypoints/pooling/pooling/serving.py +354 -0
  245. vllm/entrypoints/pooling/score/__init__.py +0 -0
  246. vllm/entrypoints/pooling/score/api_router.py +149 -0
  247. vllm/entrypoints/pooling/score/protocol.py +146 -0
  248. vllm/entrypoints/pooling/score/serving.py +508 -0
  249. vllm/entrypoints/renderer.py +410 -0
  250. vllm/entrypoints/responses_utils.py +249 -0
  251. vllm/entrypoints/sagemaker/__init__.py +4 -0
  252. vllm/entrypoints/sagemaker/routes.py +118 -0
  253. vllm/entrypoints/score_utils.py +237 -0
  254. vllm/entrypoints/serve/__init__.py +60 -0
  255. vllm/entrypoints/serve/disagg/__init__.py +0 -0
  256. vllm/entrypoints/serve/disagg/api_router.py +110 -0
  257. vllm/entrypoints/serve/disagg/protocol.py +90 -0
  258. vllm/entrypoints/serve/disagg/serving.py +285 -0
  259. vllm/entrypoints/serve/elastic_ep/__init__.py +0 -0
  260. vllm/entrypoints/serve/elastic_ep/api_router.py +96 -0
  261. vllm/entrypoints/serve/elastic_ep/middleware.py +49 -0
  262. vllm/entrypoints/serve/instrumentator/__init__.py +0 -0
  263. vllm/entrypoints/serve/instrumentator/health.py +33 -0
  264. vllm/entrypoints/serve/instrumentator/metrics.py +45 -0
  265. vllm/entrypoints/serve/lora/__init__.py +0 -0
  266. vllm/entrypoints/serve/lora/api_router.py +70 -0
  267. vllm/entrypoints/serve/profile/__init__.py +0 -0
  268. vllm/entrypoints/serve/profile/api_router.py +46 -0
  269. vllm/entrypoints/serve/rlhf/__init__.py +0 -0
  270. vllm/entrypoints/serve/rlhf/api_router.py +102 -0
  271. vllm/entrypoints/serve/sleep/__init__.py +0 -0
  272. vllm/entrypoints/serve/sleep/api_router.py +60 -0
  273. vllm/entrypoints/serve/tokenize/__init__.py +0 -0
  274. vllm/entrypoints/serve/tokenize/api_router.py +118 -0
  275. vllm/entrypoints/serve/tokenize/serving.py +204 -0
  276. vllm/entrypoints/ssl.py +78 -0
  277. vllm/entrypoints/tool.py +187 -0
  278. vllm/entrypoints/tool_server.py +234 -0
  279. vllm/entrypoints/utils.py +319 -0
  280. vllm/env_override.py +378 -0
  281. vllm/envs.py +1744 -0
  282. vllm/forward_context.py +358 -0
  283. vllm/inputs/__init__.py +44 -0
  284. vllm/inputs/data.py +359 -0
  285. vllm/inputs/parse.py +146 -0
  286. vllm/inputs/preprocess.py +717 -0
  287. vllm/logger.py +303 -0
  288. vllm/logging_utils/__init__.py +13 -0
  289. vllm/logging_utils/dump_input.py +83 -0
  290. vllm/logging_utils/formatter.py +127 -0
  291. vllm/logging_utils/lazy.py +20 -0
  292. vllm/logging_utils/log_time.py +34 -0
  293. vllm/logits_process.py +121 -0
  294. vllm/logprobs.py +206 -0
  295. vllm/lora/__init__.py +0 -0
  296. vllm/lora/layers/__init__.py +42 -0
  297. vllm/lora/layers/base.py +66 -0
  298. vllm/lora/layers/base_linear.py +165 -0
  299. vllm/lora/layers/column_parallel_linear.py +577 -0
  300. vllm/lora/layers/fused_moe.py +747 -0
  301. vllm/lora/layers/logits_processor.py +203 -0
  302. vllm/lora/layers/replicated_linear.py +70 -0
  303. vllm/lora/layers/row_parallel_linear.py +176 -0
  304. vllm/lora/layers/utils.py +74 -0
  305. vllm/lora/layers/vocal_parallel_embedding.py +140 -0
  306. vllm/lora/lora_model.py +246 -0
  307. vllm/lora/lora_weights.py +227 -0
  308. vllm/lora/model_manager.py +690 -0
  309. vllm/lora/ops/__init__.py +0 -0
  310. vllm/lora/ops/ipex_ops/__init__.py +6 -0
  311. vllm/lora/ops/ipex_ops/lora_ops.py +57 -0
  312. vllm/lora/ops/torch_ops/__init__.py +20 -0
  313. vllm/lora/ops/torch_ops/lora_ops.py +128 -0
  314. vllm/lora/ops/triton_ops/README_TUNING.md +60 -0
  315. vllm/lora/ops/triton_ops/__init__.py +21 -0
  316. vllm/lora/ops/triton_ops/fused_moe_lora_op.py +665 -0
  317. vllm/lora/ops/triton_ops/kernel_utils.py +340 -0
  318. vllm/lora/ops/triton_ops/lora_expand_op.py +310 -0
  319. vllm/lora/ops/triton_ops/lora_kernel_metadata.py +154 -0
  320. vllm/lora/ops/triton_ops/lora_shrink_op.py +287 -0
  321. vllm/lora/ops/triton_ops/utils.py +295 -0
  322. vllm/lora/ops/xla_ops/__init__.py +6 -0
  323. vllm/lora/ops/xla_ops/lora_ops.py +141 -0
  324. vllm/lora/peft_helper.py +128 -0
  325. vllm/lora/punica_wrapper/__init__.py +10 -0
  326. vllm/lora/punica_wrapper/punica_base.py +493 -0
  327. vllm/lora/punica_wrapper/punica_cpu.py +351 -0
  328. vllm/lora/punica_wrapper/punica_gpu.py +412 -0
  329. vllm/lora/punica_wrapper/punica_selector.py +21 -0
  330. vllm/lora/punica_wrapper/punica_tpu.py +358 -0
  331. vllm/lora/punica_wrapper/punica_xpu.py +276 -0
  332. vllm/lora/punica_wrapper/utils.py +150 -0
  333. vllm/lora/request.py +100 -0
  334. vllm/lora/resolver.py +88 -0
  335. vllm/lora/utils.py +315 -0
  336. vllm/lora/worker_manager.py +268 -0
  337. vllm/model_executor/__init__.py +11 -0
  338. vllm/model_executor/custom_op.py +199 -0
  339. vllm/model_executor/layers/__init__.py +0 -0
  340. vllm/model_executor/layers/activation.py +595 -0
  341. vllm/model_executor/layers/attention_layer_base.py +32 -0
  342. vllm/model_executor/layers/batch_invariant.py +1067 -0
  343. vllm/model_executor/layers/conv.py +256 -0
  344. vllm/model_executor/layers/fla/__init__.py +8 -0
  345. vllm/model_executor/layers/fla/ops/__init__.py +17 -0
  346. vllm/model_executor/layers/fla/ops/chunk.py +240 -0
  347. vllm/model_executor/layers/fla/ops/chunk_delta_h.py +344 -0
  348. vllm/model_executor/layers/fla/ops/chunk_o.py +183 -0
  349. vllm/model_executor/layers/fla/ops/chunk_scaled_dot_kkt.py +154 -0
  350. vllm/model_executor/layers/fla/ops/cumsum.py +280 -0
  351. vllm/model_executor/layers/fla/ops/fused_recurrent.py +390 -0
  352. vllm/model_executor/layers/fla/ops/index.py +41 -0
  353. vllm/model_executor/layers/fla/ops/kda.py +1351 -0
  354. vllm/model_executor/layers/fla/ops/l2norm.py +146 -0
  355. vllm/model_executor/layers/fla/ops/layernorm_guard.py +396 -0
  356. vllm/model_executor/layers/fla/ops/op.py +60 -0
  357. vllm/model_executor/layers/fla/ops/solve_tril.py +556 -0
  358. vllm/model_executor/layers/fla/ops/utils.py +194 -0
  359. vllm/model_executor/layers/fla/ops/wy_fast.py +158 -0
  360. vllm/model_executor/layers/fused_moe/__init__.py +114 -0
  361. vllm/model_executor/layers/fused_moe/all2all_utils.py +171 -0
  362. vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +409 -0
  363. vllm/model_executor/layers/fused_moe/config.py +1043 -0
  364. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  365. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  366. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  367. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  368. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  369. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  370. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  371. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
  372. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H200,dtype=int8_w8a16.json +146 -0
  373. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  374. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  375. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  376. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  377. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  378. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  379. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  380. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  381. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  382. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H100,dtype=fp8_w8a8.json +123 -0
  383. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  384. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H200.json +146 -0
  385. vllm/model_executor/layers/fused_moe/configs/E=128,N=1856,device_name=NVIDIA_H100_80GB_HBM3.json +147 -0
  386. vllm/model_executor/layers/fused_moe/configs/E=128,N=1856,device_name=NVIDIA_L40S.json +147 -0
  387. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  388. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  389. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  390. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20.json +146 -0
  391. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
  392. vllm/model_executor/layers/fused_moe/configs/E=128,N=352,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +122 -0
  393. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  394. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  395. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  396. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  397. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  398. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e.json +146 -0
  399. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20.json +146 -0
  400. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  401. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
  402. vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  403. vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  404. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +146 -0
  405. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +114 -0
  406. 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
  407. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI308X.json +213 -0
  408. 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
  409. 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
  410. 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
  411. 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
  412. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
  413. 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
  414. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
  415. vllm/model_executor/layers/fused_moe/configs/E=128,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=bf16.json +82 -0
  416. vllm/model_executor/layers/fused_moe/configs/E=128,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +82 -0
  417. vllm/model_executor/layers/fused_moe/configs/E=128,N=928,device_name=NVIDIA_H100_80GB_HBM3.json +147 -0
  418. vllm/model_executor/layers/fused_moe/configs/E=128,N=928,device_name=NVIDIA_L40S.json +147 -0
  419. vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
  420. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  421. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
  422. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200.json +146 -0
  423. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
  424. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  425. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H200.json +146 -0
  426. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  427. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  428. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  429. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  430. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  431. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  432. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  433. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  434. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  435. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  436. vllm/model_executor/layers/fused_moe/configs/E=16,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  437. vllm/model_executor/layers/fused_moe/configs/E=16,N=2048,device_name=NVIDIA_H200.json +146 -0
  438. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  439. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  440. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  441. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=float8.json +146 -0
  442. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  443. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H200,dtype=int8_w8a16.json +146 -0
  444. vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  445. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  446. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  447. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  448. vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  449. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  450. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  451. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=float8.json +146 -0
  452. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  453. vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  454. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=AMD_Instinct_MI300X.json +201 -0
  455. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=AMD_Instinct_MI350_OAM,dtype=fp8_w8a8.json +164 -0
  456. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  457. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  458. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +147 -0
  459. vllm/model_executor/layers/fused_moe/configs/E=160,N=320,device_name=NVIDIA_H20-3e.json +146 -0
  460. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  461. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI350_OAM,dtype=fp8_w8a8.json +164 -0
  462. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI355_OAM,dtype=fp8_w8a8.json +164 -0
  463. 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
  464. 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
  465. 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
  466. vllm/model_executor/layers/fused_moe/configs/E=20,N=1536,device_name=NVIDIA_RTX_PRO_6000_Blackwell_Server_Edition,dtype=fp8_w8a8.json +147 -0
  467. 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
  468. 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
  469. 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
  470. 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
  471. vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
  472. 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
  473. 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
  474. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  475. 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
  476. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  477. 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
  478. 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
  479. 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
  480. 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
  481. 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
  482. 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
  483. 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
  484. 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
  485. 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
  486. 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
  487. 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
  488. 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
  489. vllm/model_executor/layers/fused_moe/configs/E=256,N=384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  490. 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
  491. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  492. vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  493. vllm/model_executor/layers/fused_moe/configs/E=32,N=1408,device_name=NVIDIA_B200.json +147 -0
  494. vllm/model_executor/layers/fused_moe/configs/E=32,N=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  495. vllm/model_executor/layers/fused_moe/configs/E=32,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  496. 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
  497. 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
  498. 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
  499. 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
  500. 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
  501. vllm/model_executor/layers/fused_moe/configs/E=40,N=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
  502. 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
  503. 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
  504. 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
  505. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_A100-SXM4-80GB.json +147 -0
  506. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200.json +146 -0
  507. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +147 -0
  508. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  509. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H20-3e.json +146 -0
  510. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H200.json +146 -0
  511. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200.json +146 -0
  512. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
  513. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  514. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  515. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H20-3e.json +146 -0
  516. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H200.json +146 -0
  517. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200.json +146 -0
  518. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
  519. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  520. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H20-3e.json +146 -0
  521. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H200.json +146 -0
  522. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_A100-SXM4-80GB.json +147 -0
  523. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_B200.json +146 -0
  524. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H20-3e.json +146 -0
  525. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H200.json +146 -0
  526. vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
  527. vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
  528. vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
  529. vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
  530. vllm/model_executor/layers/fused_moe/configs/E=62,N=128,device_name=AMD_Instinct_MI300X.json +200 -0
  531. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=AMD_Instinct_MI300X.json +200 -0
  532. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  533. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=AMD_Instinct_MI300X.json +200 -0
  534. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  535. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  536. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  537. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  538. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  539. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  540. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
  541. vllm/model_executor/layers/fused_moe/configs/E=64,N=1408,device_name=NVIDIA_B200.json +147 -0
  542. vllm/model_executor/layers/fused_moe/configs/E=64,N=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  543. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  544. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  545. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
  546. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  547. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20.json +146 -0
  548. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  549. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  550. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  551. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
  552. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  553. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20.json +146 -0
  554. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  555. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  556. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  557. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  558. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  559. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  560. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
  561. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H100_PCIe,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
  562. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  563. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20.json +146 -0
  564. vllm/model_executor/layers/fused_moe/configs/E=64,N=896,device_name=NVIDIA_H20.json +146 -0
  565. vllm/model_executor/layers/fused_moe/configs/E=64,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=bf16.json +82 -0
  566. vllm/model_executor/layers/fused_moe/configs/E=64,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +82 -0
  567. vllm/model_executor/layers/fused_moe/configs/E=72,N=192,device_name=AMD_Instinct_MI300X.json +200 -0
  568. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=AMD_Instinct_MI300X.json +200 -0
  569. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  570. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=AMD_Instinct_MI300X.json +200 -0
  571. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  572. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  573. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
  574. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  575. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
  576. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
  577. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  578. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
  579. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  580. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
  581. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  582. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
  583. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  584. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
  585. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  586. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
  587. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  588. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  589. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  590. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  591. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
  592. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  593. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
  594. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  595. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
  596. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  597. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  598. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  599. 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
  600. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  601. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
  602. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  603. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
  604. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  605. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
  606. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  607. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  608. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  609. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  610. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  611. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  612. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
  613. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
  614. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  615. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
  616. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  617. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
  618. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  619. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  620. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  621. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  622. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
  623. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  624. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
  625. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  626. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
  627. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  628. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  629. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  630. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  631. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
  632. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  633. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
  634. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  635. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
  636. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  637. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  638. vllm/model_executor/layers/fused_moe/configs/README +12 -0
  639. vllm/model_executor/layers/fused_moe/cpu_fused_moe.py +292 -0
  640. vllm/model_executor/layers/fused_moe/cutlass_moe.py +1453 -0
  641. vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +358 -0
  642. vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +427 -0
  643. vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +420 -0
  644. vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +434 -0
  645. vllm/model_executor/layers/fused_moe/flashinfer_cutedsl_moe.py +376 -0
  646. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_moe.py +307 -0
  647. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_prepare_finalize.py +362 -0
  648. vllm/model_executor/layers/fused_moe/flashinfer_trtllm_moe.py +192 -0
  649. vllm/model_executor/layers/fused_moe/fused_batched_moe.py +1012 -0
  650. vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +825 -0
  651. vllm/model_executor/layers/fused_moe/fused_moe.py +2223 -0
  652. vllm/model_executor/layers/fused_moe/fused_moe_method_base.py +103 -0
  653. vllm/model_executor/layers/fused_moe/fused_moe_modular_method.py +119 -0
  654. vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py +524 -0
  655. vllm/model_executor/layers/fused_moe/layer.py +2133 -0
  656. vllm/model_executor/layers/fused_moe/modular_kernel.py +1302 -0
  657. vllm/model_executor/layers/fused_moe/moe_align_block_size.py +192 -0
  658. vllm/model_executor/layers/fused_moe/moe_pallas.py +83 -0
  659. vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +229 -0
  660. vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
  661. vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +362 -0
  662. vllm/model_executor/layers/fused_moe/prepare_finalize.py +78 -0
  663. vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +265 -0
  664. vllm/model_executor/layers/fused_moe/routing_simulator.py +310 -0
  665. vllm/model_executor/layers/fused_moe/shared_fused_moe.py +96 -0
  666. vllm/model_executor/layers/fused_moe/topk_weight_and_reduce.py +171 -0
  667. vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +163 -0
  668. vllm/model_executor/layers/fused_moe/trtllm_moe.py +143 -0
  669. vllm/model_executor/layers/fused_moe/unquantized_fused_moe_method.py +455 -0
  670. vllm/model_executor/layers/fused_moe/utils.py +332 -0
  671. vllm/model_executor/layers/kda.py +442 -0
  672. vllm/model_executor/layers/layernorm.py +442 -0
  673. vllm/model_executor/layers/lightning_attn.py +735 -0
  674. vllm/model_executor/layers/linear.py +1424 -0
  675. vllm/model_executor/layers/logits_processor.py +106 -0
  676. vllm/model_executor/layers/mamba/__init__.py +0 -0
  677. vllm/model_executor/layers/mamba/abstract.py +68 -0
  678. vllm/model_executor/layers/mamba/linear_attn.py +388 -0
  679. vllm/model_executor/layers/mamba/mamba_mixer.py +526 -0
  680. vllm/model_executor/layers/mamba/mamba_mixer2.py +930 -0
  681. vllm/model_executor/layers/mamba/mamba_utils.py +225 -0
  682. vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
  683. vllm/model_executor/layers/mamba/ops/causal_conv1d.py +1240 -0
  684. vllm/model_executor/layers/mamba/ops/layernorm_gated.py +172 -0
  685. vllm/model_executor/layers/mamba/ops/mamba_ssm.py +586 -0
  686. vllm/model_executor/layers/mamba/ops/ssd_bmm.py +211 -0
  687. vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +456 -0
  688. vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +700 -0
  689. vllm/model_executor/layers/mamba/ops/ssd_combined.py +230 -0
  690. vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +157 -0
  691. vllm/model_executor/layers/mamba/short_conv.py +255 -0
  692. vllm/model_executor/layers/mla.py +176 -0
  693. vllm/model_executor/layers/pooler.py +830 -0
  694. vllm/model_executor/layers/quantization/__init__.py +179 -0
  695. vllm/model_executor/layers/quantization/auto_round.py +454 -0
  696. vllm/model_executor/layers/quantization/awq.py +277 -0
  697. vllm/model_executor/layers/quantization/awq_marlin.py +793 -0
  698. vllm/model_executor/layers/quantization/awq_triton.py +337 -0
  699. vllm/model_executor/layers/quantization/base_config.py +170 -0
  700. vllm/model_executor/layers/quantization/bitblas.py +502 -0
  701. vllm/model_executor/layers/quantization/bitsandbytes.py +626 -0
  702. vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +3 -0
  703. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +986 -0
  704. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +2645 -0
  705. vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +35 -0
  706. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +392 -0
  707. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +55 -0
  708. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +176 -0
  709. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_nvfp4.py +124 -0
  710. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +218 -0
  711. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_fp8.py +176 -0
  712. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_int.py +153 -0
  713. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +138 -0
  714. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +200 -0
  715. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +125 -0
  716. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +230 -0
  717. vllm/model_executor/layers/quantization/compressed_tensors/transform/__init__.py +0 -0
  718. vllm/model_executor/layers/quantization/compressed_tensors/transform/linear.py +260 -0
  719. vllm/model_executor/layers/quantization/compressed_tensors/transform/module.py +173 -0
  720. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/__init__.py +0 -0
  721. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/linear_qutlass_nvfp4.py +64 -0
  722. vllm/model_executor/layers/quantization/compressed_tensors/transform/utils.py +13 -0
  723. vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +224 -0
  724. vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
  725. vllm/model_executor/layers/quantization/cpu_wna16.py +625 -0
  726. vllm/model_executor/layers/quantization/deepspeedfp.py +218 -0
  727. vllm/model_executor/layers/quantization/experts_int8.py +207 -0
  728. vllm/model_executor/layers/quantization/fbgemm_fp8.py +195 -0
  729. vllm/model_executor/layers/quantization/fp8.py +1461 -0
  730. vllm/model_executor/layers/quantization/fp_quant.py +420 -0
  731. vllm/model_executor/layers/quantization/gguf.py +677 -0
  732. vllm/model_executor/layers/quantization/gptq.py +393 -0
  733. vllm/model_executor/layers/quantization/gptq_bitblas.py +482 -0
  734. vllm/model_executor/layers/quantization/gptq_marlin.py +932 -0
  735. vllm/model_executor/layers/quantization/gptq_marlin_24.py +320 -0
  736. vllm/model_executor/layers/quantization/hqq_marlin.py +372 -0
  737. vllm/model_executor/layers/quantization/inc.py +65 -0
  738. vllm/model_executor/layers/quantization/input_quant_fp8.py +202 -0
  739. vllm/model_executor/layers/quantization/ipex_quant.py +487 -0
  740. vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
  741. vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +94 -0
  742. vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +109 -0
  743. vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +115 -0
  744. vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +323 -0
  745. vllm/model_executor/layers/quantization/kernels/mixed_precision/conch.py +98 -0
  746. vllm/model_executor/layers/quantization/kernels/mixed_precision/cutlass.py +130 -0
  747. vllm/model_executor/layers/quantization/kernels/mixed_precision/dynamic_4bit.py +111 -0
  748. vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +161 -0
  749. vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +159 -0
  750. vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +200 -0
  751. vllm/model_executor/layers/quantization/kernels/mixed_precision/xpu.py +97 -0
  752. vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +76 -0
  753. vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +81 -0
  754. vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +128 -0
  755. vllm/model_executor/layers/quantization/kernels/scaled_mm/cpu.py +220 -0
  756. vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +147 -0
  757. vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +71 -0
  758. vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +106 -0
  759. vllm/model_executor/layers/quantization/kv_cache.py +153 -0
  760. vllm/model_executor/layers/quantization/modelopt.py +1684 -0
  761. vllm/model_executor/layers/quantization/moe_wna16.py +516 -0
  762. vllm/model_executor/layers/quantization/mxfp4.py +1140 -0
  763. vllm/model_executor/layers/quantization/petit.py +319 -0
  764. vllm/model_executor/layers/quantization/ptpc_fp8.py +136 -0
  765. vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
  766. vllm/model_executor/layers/quantization/quark/quark.py +527 -0
  767. vllm/model_executor/layers/quantization/quark/quark_moe.py +622 -0
  768. vllm/model_executor/layers/quantization/quark/schemes/__init__.py +9 -0
  769. vllm/model_executor/layers/quantization/quark/schemes/quark_ocp_mx.py +343 -0
  770. vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +55 -0
  771. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +179 -0
  772. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +139 -0
  773. vllm/model_executor/layers/quantization/quark/utils.py +105 -0
  774. vllm/model_executor/layers/quantization/qutlass_utils.py +185 -0
  775. vllm/model_executor/layers/quantization/rtn.py +621 -0
  776. vllm/model_executor/layers/quantization/schema.py +90 -0
  777. vllm/model_executor/layers/quantization/torchao.py +380 -0
  778. vllm/model_executor/layers/quantization/tpu_int8.py +139 -0
  779. vllm/model_executor/layers/quantization/utils/__init__.py +6 -0
  780. vllm/model_executor/layers/quantization/utils/allspark_utils.py +67 -0
  781. vllm/model_executor/layers/quantization/utils/bitblas_utils.py +229 -0
  782. vllm/model_executor/layers/quantization/utils/configs/N=10240,K=5120,device_name=NVIDIA_L40S,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  783. 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
  784. 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
  785. 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
  786. 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
  787. 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
  788. 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
  789. 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
  790. 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
  791. 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
  792. 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
  793. 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
  794. 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
  795. 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
  796. 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
  797. 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
  798. 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
  799. 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
  800. 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
  801. 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
  802. 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
  803. 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
  804. 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
  805. 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
  806. 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
  807. 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
  808. 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
  809. 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
  810. 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
  811. 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
  812. 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
  813. 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
  814. 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
  815. 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
  816. 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
  817. 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
  818. 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
  819. 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
  820. 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
  821. 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
  822. 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
  823. 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
  824. 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
  825. 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
  826. 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
  827. 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
  828. 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
  829. 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
  830. 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
  831. 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
  832. 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
  833. 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
  834. 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
  835. 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
  836. 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
  837. 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
  838. 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
  839. 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
  840. 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
  841. 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
  842. 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
  843. 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
  844. 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
  845. 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
  846. 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
  847. 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
  848. 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
  849. 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
  850. 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
  851. 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
  852. 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
  853. 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
  854. 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
  855. 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
  856. 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
  857. 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
  858. 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
  859. 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
  860. 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
  861. 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
  862. 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
  863. 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
  864. 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
  865. 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
  866. 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
  867. 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
  868. 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
  869. 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
  870. 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
  871. 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
  872. 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
  873. 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
  874. 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
  875. 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
  876. 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
  877. 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
  878. 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
  879. 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
  880. 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
  881. 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
  882. 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
  883. 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
  884. 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
  885. 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
  886. 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
  887. 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
  888. 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
  889. 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
  890. 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
  891. 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
  892. 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
  893. 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
  894. 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
  895. 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
  896. 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
  897. 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
  898. 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
  899. 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
  900. 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
  901. 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
  902. vllm/model_executor/layers/quantization/utils/configs/N=5120,K=25600,device_name=NVIDIA_L40S,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  903. vllm/model_executor/layers/quantization/utils/configs/N=5120,K=8192,device_name=NVIDIA_L40S,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  904. vllm/model_executor/layers/quantization/utils/configs/N=51200,K=5120,device_name=NVIDIA_L40S,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  905. 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
  906. 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
  907. 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
  908. 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
  909. 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
  910. 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
  911. 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
  912. 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
  913. 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
  914. 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
  915. 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
  916. 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
  917. 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
  918. 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
  919. 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
  920. 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
  921. 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
  922. 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
  923. 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
  924. 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
  925. 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
  926. 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
  927. 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
  928. 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
  929. 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
  930. 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
  931. 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
  932. 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
  933. 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
  934. 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
  935. 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
  936. 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
  937. 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
  938. 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
  939. 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
  940. 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
  941. 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
  942. 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
  943. 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
  944. 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
  945. 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
  946. 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
  947. 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
  948. 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
  949. 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
  950. 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
  951. 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
  952. 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
  953. 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
  954. 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
  955. 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
  956. 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
  957. 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
  958. 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
  959. 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
  960. 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
  961. 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
  962. 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
  963. 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
  964. 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
  965. 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
  966. 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
  967. 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
  968. 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
  969. 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
  970. 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
  971. 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
  972. 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
  973. 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
  974. 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
  975. 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
  976. 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
  977. 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
  978. 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
  979. 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
  980. 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
  981. 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
  982. 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
  983. 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
  984. 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
  985. 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
  986. 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
  987. 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
  988. 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
  989. 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
  990. 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
  991. 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
  992. 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
  993. 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
  994. 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
  995. 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
  996. vllm/model_executor/layers/quantization/utils/configs/README.md +3 -0
  997. vllm/model_executor/layers/quantization/utils/flashinfer_fp4_moe.py +412 -0
  998. vllm/model_executor/layers/quantization/utils/flashinfer_utils.py +312 -0
  999. vllm/model_executor/layers/quantization/utils/fp8_utils.py +1453 -0
  1000. vllm/model_executor/layers/quantization/utils/gptq_utils.py +158 -0
  1001. vllm/model_executor/layers/quantization/utils/int8_utils.py +474 -0
  1002. vllm/model_executor/layers/quantization/utils/layer_utils.py +41 -0
  1003. vllm/model_executor/layers/quantization/utils/machete_utils.py +56 -0
  1004. vllm/model_executor/layers/quantization/utils/marlin_utils.py +678 -0
  1005. vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +452 -0
  1006. vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +381 -0
  1007. vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +219 -0
  1008. vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +467 -0
  1009. vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +189 -0
  1010. vllm/model_executor/layers/quantization/utils/mxfp6_utils.py +142 -0
  1011. vllm/model_executor/layers/quantization/utils/mxfp8_utils.py +24 -0
  1012. vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +142 -0
  1013. vllm/model_executor/layers/quantization/utils/nvfp4_moe_support.py +67 -0
  1014. vllm/model_executor/layers/quantization/utils/ocp_mx_utils.py +51 -0
  1015. vllm/model_executor/layers/quantization/utils/petit_utils.py +124 -0
  1016. vllm/model_executor/layers/quantization/utils/quant_utils.py +741 -0
  1017. vllm/model_executor/layers/quantization/utils/w8a8_utils.py +519 -0
  1018. vllm/model_executor/layers/resampler.py +283 -0
  1019. vllm/model_executor/layers/rotary_embedding/__init__.py +289 -0
  1020. vllm/model_executor/layers/rotary_embedding/base.py +254 -0
  1021. vllm/model_executor/layers/rotary_embedding/common.py +279 -0
  1022. vllm/model_executor/layers/rotary_embedding/deepseek_scaling_rope.py +165 -0
  1023. vllm/model_executor/layers/rotary_embedding/dual_chunk_rope.py +215 -0
  1024. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_alpha_rope.py +43 -0
  1025. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_scaling_rope.py +68 -0
  1026. vllm/model_executor/layers/rotary_embedding/ernie45_vl_rope.py +82 -0
  1027. vllm/model_executor/layers/rotary_embedding/linear_scaling_rope.py +115 -0
  1028. vllm/model_executor/layers/rotary_embedding/llama3_rope.py +54 -0
  1029. vllm/model_executor/layers/rotary_embedding/llama4_vision_rope.py +80 -0
  1030. vllm/model_executor/layers/rotary_embedding/mrope.py +412 -0
  1031. vllm/model_executor/layers/rotary_embedding/ntk_scaling_rope.py +47 -0
  1032. vllm/model_executor/layers/rotary_embedding/phi3_long_rope_scaled_rope.py +159 -0
  1033. vllm/model_executor/layers/rotary_embedding/xdrope.py +160 -0
  1034. vllm/model_executor/layers/rotary_embedding/yarn_scaling_rope.py +84 -0
  1035. vllm/model_executor/layers/utils.py +251 -0
  1036. vllm/model_executor/layers/vocab_parallel_embedding.py +558 -0
  1037. vllm/model_executor/model_loader/__init__.py +150 -0
  1038. vllm/model_executor/model_loader/base_loader.py +57 -0
  1039. vllm/model_executor/model_loader/bitsandbytes_loader.py +822 -0
  1040. vllm/model_executor/model_loader/default_loader.py +321 -0
  1041. vllm/model_executor/model_loader/dummy_loader.py +28 -0
  1042. vllm/model_executor/model_loader/gguf_loader.py +371 -0
  1043. vllm/model_executor/model_loader/online_quantization.py +275 -0
  1044. vllm/model_executor/model_loader/runai_streamer_loader.py +116 -0
  1045. vllm/model_executor/model_loader/sharded_state_loader.py +214 -0
  1046. vllm/model_executor/model_loader/tensorizer.py +790 -0
  1047. vllm/model_executor/model_loader/tensorizer_loader.py +151 -0
  1048. vllm/model_executor/model_loader/tpu.py +118 -0
  1049. vllm/model_executor/model_loader/utils.py +292 -0
  1050. vllm/model_executor/model_loader/weight_utils.py +1157 -0
  1051. vllm/model_executor/models/__init__.py +44 -0
  1052. vllm/model_executor/models/adapters.py +522 -0
  1053. vllm/model_executor/models/afmoe.py +696 -0
  1054. vllm/model_executor/models/aimv2.py +248 -0
  1055. vllm/model_executor/models/apertus.py +565 -0
  1056. vllm/model_executor/models/arcee.py +428 -0
  1057. vllm/model_executor/models/arctic.py +633 -0
  1058. vllm/model_executor/models/aria.py +653 -0
  1059. vllm/model_executor/models/audioflamingo3.py +639 -0
  1060. vllm/model_executor/models/aya_vision.py +448 -0
  1061. vllm/model_executor/models/bagel.py +584 -0
  1062. vllm/model_executor/models/baichuan.py +493 -0
  1063. vllm/model_executor/models/bailing_moe.py +642 -0
  1064. vllm/model_executor/models/bamba.py +511 -0
  1065. vllm/model_executor/models/bee.py +157 -0
  1066. vllm/model_executor/models/bert.py +925 -0
  1067. vllm/model_executor/models/bert_with_rope.py +732 -0
  1068. vllm/model_executor/models/blip.py +350 -0
  1069. vllm/model_executor/models/blip2.py +693 -0
  1070. vllm/model_executor/models/bloom.py +390 -0
  1071. vllm/model_executor/models/chameleon.py +1095 -0
  1072. vllm/model_executor/models/chatglm.py +502 -0
  1073. vllm/model_executor/models/clip.py +1004 -0
  1074. vllm/model_executor/models/cohere2_vision.py +470 -0
  1075. vllm/model_executor/models/commandr.py +469 -0
  1076. vllm/model_executor/models/config.py +531 -0
  1077. vllm/model_executor/models/dbrx.py +484 -0
  1078. vllm/model_executor/models/deepencoder.py +676 -0
  1079. vllm/model_executor/models/deepseek_eagle.py +252 -0
  1080. vllm/model_executor/models/deepseek_mtp.py +446 -0
  1081. vllm/model_executor/models/deepseek_ocr.py +591 -0
  1082. vllm/model_executor/models/deepseek_v2.py +1710 -0
  1083. vllm/model_executor/models/deepseek_vl2.py +642 -0
  1084. vllm/model_executor/models/dots1.py +565 -0
  1085. vllm/model_executor/models/dots_ocr.py +821 -0
  1086. vllm/model_executor/models/ernie45.py +53 -0
  1087. vllm/model_executor/models/ernie45_moe.py +754 -0
  1088. vllm/model_executor/models/ernie45_vl.py +1621 -0
  1089. vllm/model_executor/models/ernie45_vl_moe.py +800 -0
  1090. vllm/model_executor/models/ernie_mtp.py +279 -0
  1091. vllm/model_executor/models/exaone.py +524 -0
  1092. vllm/model_executor/models/exaone4.py +516 -0
  1093. vllm/model_executor/models/fairseq2_llama.py +154 -0
  1094. vllm/model_executor/models/falcon.py +543 -0
  1095. vllm/model_executor/models/falcon_h1.py +675 -0
  1096. vllm/model_executor/models/flex_olmo.py +155 -0
  1097. vllm/model_executor/models/fuyu.py +371 -0
  1098. vllm/model_executor/models/gemma.py +425 -0
  1099. vllm/model_executor/models/gemma2.py +435 -0
  1100. vllm/model_executor/models/gemma3.py +507 -0
  1101. vllm/model_executor/models/gemma3_mm.py +664 -0
  1102. vllm/model_executor/models/gemma3n.py +1166 -0
  1103. vllm/model_executor/models/gemma3n_mm.py +810 -0
  1104. vllm/model_executor/models/glm.py +24 -0
  1105. vllm/model_executor/models/glm4.py +295 -0
  1106. vllm/model_executor/models/glm4_1v.py +1808 -0
  1107. vllm/model_executor/models/glm4_moe.py +736 -0
  1108. vllm/model_executor/models/glm4_moe_mtp.py +359 -0
  1109. vllm/model_executor/models/glm4v.py +783 -0
  1110. vllm/model_executor/models/gpt2.py +397 -0
  1111. vllm/model_executor/models/gpt_bigcode.py +339 -0
  1112. vllm/model_executor/models/gpt_j.py +346 -0
  1113. vllm/model_executor/models/gpt_neox.py +340 -0
  1114. vllm/model_executor/models/gpt_oss.py +744 -0
  1115. vllm/model_executor/models/granite.py +475 -0
  1116. vllm/model_executor/models/granite_speech.py +912 -0
  1117. vllm/model_executor/models/granitemoe.py +560 -0
  1118. vllm/model_executor/models/granitemoehybrid.py +703 -0
  1119. vllm/model_executor/models/granitemoeshared.py +328 -0
  1120. vllm/model_executor/models/gritlm.py +243 -0
  1121. vllm/model_executor/models/grok1.py +554 -0
  1122. vllm/model_executor/models/h2ovl.py +554 -0
  1123. vllm/model_executor/models/hunyuan_v1.py +1040 -0
  1124. vllm/model_executor/models/hunyuan_vision.py +1034 -0
  1125. vllm/model_executor/models/hyperclovax_vision.py +1164 -0
  1126. vllm/model_executor/models/idefics2_vision_model.py +427 -0
  1127. vllm/model_executor/models/idefics3.py +716 -0
  1128. vllm/model_executor/models/interfaces.py +1179 -0
  1129. vllm/model_executor/models/interfaces_base.py +228 -0
  1130. vllm/model_executor/models/intern_vit.py +454 -0
  1131. vllm/model_executor/models/internlm2.py +453 -0
  1132. vllm/model_executor/models/internlm2_ve.py +139 -0
  1133. vllm/model_executor/models/interns1.py +828 -0
  1134. vllm/model_executor/models/interns1_vit.py +433 -0
  1135. vllm/model_executor/models/internvl.py +1450 -0
  1136. vllm/model_executor/models/jais.py +397 -0
  1137. vllm/model_executor/models/jais2.py +529 -0
  1138. vllm/model_executor/models/jamba.py +609 -0
  1139. vllm/model_executor/models/jina_vl.py +147 -0
  1140. vllm/model_executor/models/keye.py +1706 -0
  1141. vllm/model_executor/models/keye_vl1_5.py +726 -0
  1142. vllm/model_executor/models/kimi_linear.py +658 -0
  1143. vllm/model_executor/models/kimi_vl.py +576 -0
  1144. vllm/model_executor/models/lfm2.py +515 -0
  1145. vllm/model_executor/models/lfm2_moe.py +745 -0
  1146. vllm/model_executor/models/lightonocr.py +195 -0
  1147. vllm/model_executor/models/llama.py +700 -0
  1148. vllm/model_executor/models/llama4.py +856 -0
  1149. vllm/model_executor/models/llama4_eagle.py +225 -0
  1150. vllm/model_executor/models/llama_eagle.py +213 -0
  1151. vllm/model_executor/models/llama_eagle3.py +375 -0
  1152. vllm/model_executor/models/llava.py +840 -0
  1153. vllm/model_executor/models/llava_next.py +581 -0
  1154. vllm/model_executor/models/llava_next_video.py +465 -0
  1155. vllm/model_executor/models/llava_onevision.py +921 -0
  1156. vllm/model_executor/models/longcat_flash.py +743 -0
  1157. vllm/model_executor/models/longcat_flash_mtp.py +349 -0
  1158. vllm/model_executor/models/mamba.py +276 -0
  1159. vllm/model_executor/models/mamba2.py +288 -0
  1160. vllm/model_executor/models/medusa.py +179 -0
  1161. vllm/model_executor/models/midashenglm.py +826 -0
  1162. vllm/model_executor/models/mimo.py +188 -0
  1163. vllm/model_executor/models/mimo_mtp.py +294 -0
  1164. vllm/model_executor/models/minicpm.py +656 -0
  1165. vllm/model_executor/models/minicpm3.py +233 -0
  1166. vllm/model_executor/models/minicpm_eagle.py +385 -0
  1167. vllm/model_executor/models/minicpmo.py +768 -0
  1168. vllm/model_executor/models/minicpmv.py +1742 -0
  1169. vllm/model_executor/models/minimax_m2.py +550 -0
  1170. vllm/model_executor/models/minimax_text_01.py +1007 -0
  1171. vllm/model_executor/models/minimax_vl_01.py +394 -0
  1172. vllm/model_executor/models/mistral3.py +635 -0
  1173. vllm/model_executor/models/mistral_large_3.py +63 -0
  1174. vllm/model_executor/models/mistral_large_3_eagle.py +136 -0
  1175. vllm/model_executor/models/mixtral.py +598 -0
  1176. vllm/model_executor/models/mllama4.py +1149 -0
  1177. vllm/model_executor/models/mlp_speculator.py +235 -0
  1178. vllm/model_executor/models/modernbert.py +451 -0
  1179. vllm/model_executor/models/module_mapping.py +74 -0
  1180. vllm/model_executor/models/molmo.py +1550 -0
  1181. vllm/model_executor/models/moonvit.py +686 -0
  1182. vllm/model_executor/models/mpt.py +335 -0
  1183. vllm/model_executor/models/nano_nemotron_vl.py +1730 -0
  1184. vllm/model_executor/models/nemotron.py +499 -0
  1185. vllm/model_executor/models/nemotron_h.py +900 -0
  1186. vllm/model_executor/models/nemotron_nas.py +471 -0
  1187. vllm/model_executor/models/nemotron_vl.py +651 -0
  1188. vllm/model_executor/models/nvlm_d.py +216 -0
  1189. vllm/model_executor/models/olmo.py +412 -0
  1190. vllm/model_executor/models/olmo2.py +454 -0
  1191. vllm/model_executor/models/olmoe.py +493 -0
  1192. vllm/model_executor/models/opencua.py +262 -0
  1193. vllm/model_executor/models/openpangu.py +1049 -0
  1194. vllm/model_executor/models/openpangu_mtp.py +265 -0
  1195. vllm/model_executor/models/opt.py +426 -0
  1196. vllm/model_executor/models/orion.py +365 -0
  1197. vllm/model_executor/models/ouro.py +507 -0
  1198. vllm/model_executor/models/ovis.py +557 -0
  1199. vllm/model_executor/models/ovis2_5.py +661 -0
  1200. vllm/model_executor/models/paddleocr_vl.py +1300 -0
  1201. vllm/model_executor/models/paligemma.py +408 -0
  1202. vllm/model_executor/models/persimmon.py +373 -0
  1203. vllm/model_executor/models/phi.py +363 -0
  1204. vllm/model_executor/models/phi3.py +18 -0
  1205. vllm/model_executor/models/phi3v.py +729 -0
  1206. vllm/model_executor/models/phi4mm.py +1251 -0
  1207. vllm/model_executor/models/phi4mm_audio.py +1296 -0
  1208. vllm/model_executor/models/phi4mm_utils.py +1907 -0
  1209. vllm/model_executor/models/phimoe.py +669 -0
  1210. vllm/model_executor/models/pixtral.py +1379 -0
  1211. vllm/model_executor/models/plamo2.py +965 -0
  1212. vllm/model_executor/models/plamo3.py +440 -0
  1213. vllm/model_executor/models/qwen.py +365 -0
  1214. vllm/model_executor/models/qwen2.py +600 -0
  1215. vllm/model_executor/models/qwen2_5_omni_thinker.py +1219 -0
  1216. vllm/model_executor/models/qwen2_5_vl.py +1569 -0
  1217. vllm/model_executor/models/qwen2_audio.py +471 -0
  1218. vllm/model_executor/models/qwen2_moe.py +597 -0
  1219. vllm/model_executor/models/qwen2_rm.py +123 -0
  1220. vllm/model_executor/models/qwen2_vl.py +1568 -0
  1221. vllm/model_executor/models/qwen3.py +331 -0
  1222. vllm/model_executor/models/qwen3_moe.py +751 -0
  1223. vllm/model_executor/models/qwen3_next.py +1395 -0
  1224. vllm/model_executor/models/qwen3_next_mtp.py +296 -0
  1225. vllm/model_executor/models/qwen3_omni_moe_thinker.py +1793 -0
  1226. vllm/model_executor/models/qwen3_vl.py +2092 -0
  1227. vllm/model_executor/models/qwen3_vl_moe.py +474 -0
  1228. vllm/model_executor/models/qwen_vl.py +801 -0
  1229. vllm/model_executor/models/radio.py +555 -0
  1230. vllm/model_executor/models/registry.py +1189 -0
  1231. vllm/model_executor/models/roberta.py +259 -0
  1232. vllm/model_executor/models/rvl.py +107 -0
  1233. vllm/model_executor/models/seed_oss.py +492 -0
  1234. vllm/model_executor/models/siglip.py +1244 -0
  1235. vllm/model_executor/models/siglip2navit.py +658 -0
  1236. vllm/model_executor/models/skyworkr1v.py +951 -0
  1237. vllm/model_executor/models/smolvlm.py +38 -0
  1238. vllm/model_executor/models/solar.py +484 -0
  1239. vllm/model_executor/models/stablelm.py +354 -0
  1240. vllm/model_executor/models/starcoder2.py +365 -0
  1241. vllm/model_executor/models/step3_text.py +554 -0
  1242. vllm/model_executor/models/step3_vl.py +1147 -0
  1243. vllm/model_executor/models/swin.py +514 -0
  1244. vllm/model_executor/models/tarsier.py +617 -0
  1245. vllm/model_executor/models/telechat2.py +153 -0
  1246. vllm/model_executor/models/teleflm.py +78 -0
  1247. vllm/model_executor/models/terratorch.py +318 -0
  1248. vllm/model_executor/models/transformers/__init__.py +127 -0
  1249. vllm/model_executor/models/transformers/base.py +518 -0
  1250. vllm/model_executor/models/transformers/causal.py +65 -0
  1251. vllm/model_executor/models/transformers/legacy.py +90 -0
  1252. vllm/model_executor/models/transformers/moe.py +325 -0
  1253. vllm/model_executor/models/transformers/multimodal.py +411 -0
  1254. vllm/model_executor/models/transformers/pooling.py +119 -0
  1255. vllm/model_executor/models/transformers/utils.py +213 -0
  1256. vllm/model_executor/models/ultravox.py +766 -0
  1257. vllm/model_executor/models/utils.py +832 -0
  1258. vllm/model_executor/models/vision.py +546 -0
  1259. vllm/model_executor/models/voxtral.py +841 -0
  1260. vllm/model_executor/models/whisper.py +971 -0
  1261. vllm/model_executor/models/zamba2.py +979 -0
  1262. vllm/model_executor/parameter.py +642 -0
  1263. vllm/model_executor/utils.py +119 -0
  1264. vllm/model_executor/warmup/__init__.py +0 -0
  1265. vllm/model_executor/warmup/deep_gemm_warmup.py +314 -0
  1266. vllm/model_executor/warmup/kernel_warmup.py +98 -0
  1267. vllm/multimodal/__init__.py +40 -0
  1268. vllm/multimodal/audio.py +147 -0
  1269. vllm/multimodal/base.py +56 -0
  1270. vllm/multimodal/cache.py +823 -0
  1271. vllm/multimodal/evs.py +294 -0
  1272. vllm/multimodal/hasher.py +120 -0
  1273. vllm/multimodal/image.py +142 -0
  1274. vllm/multimodal/inputs.py +1089 -0
  1275. vllm/multimodal/parse.py +565 -0
  1276. vllm/multimodal/processing.py +2240 -0
  1277. vllm/multimodal/profiling.py +351 -0
  1278. vllm/multimodal/registry.py +357 -0
  1279. vllm/multimodal/utils.py +513 -0
  1280. vllm/multimodal/video.py +340 -0
  1281. vllm/outputs.py +345 -0
  1282. vllm/platforms/__init__.py +277 -0
  1283. vllm/platforms/cpu.py +421 -0
  1284. vllm/platforms/cuda.py +618 -0
  1285. vllm/platforms/interface.py +695 -0
  1286. vllm/platforms/rocm.py +564 -0
  1287. vllm/platforms/tpu.py +295 -0
  1288. vllm/platforms/xpu.py +277 -0
  1289. vllm/plugins/__init__.py +81 -0
  1290. vllm/plugins/io_processors/__init__.py +68 -0
  1291. vllm/plugins/io_processors/interface.py +77 -0
  1292. vllm/plugins/lora_resolvers/__init__.py +0 -0
  1293. vllm/plugins/lora_resolvers/filesystem_resolver.py +52 -0
  1294. vllm/pooling_params.py +230 -0
  1295. vllm/profiler/__init__.py +0 -0
  1296. vllm/profiler/layerwise_profile.py +392 -0
  1297. vllm/profiler/utils.py +151 -0
  1298. vllm/profiler/wrapper.py +241 -0
  1299. vllm/py.typed +2 -0
  1300. vllm/ray/__init__.py +0 -0
  1301. vllm/ray/lazy_utils.py +30 -0
  1302. vllm/ray/ray_env.py +79 -0
  1303. vllm/reasoning/__init__.py +96 -0
  1304. vllm/reasoning/abs_reasoning_parsers.py +318 -0
  1305. vllm/reasoning/basic_parsers.py +175 -0
  1306. vllm/reasoning/deepseek_r1_reasoning_parser.py +67 -0
  1307. vllm/reasoning/deepseek_v3_reasoning_parser.py +67 -0
  1308. vllm/reasoning/ernie45_reasoning_parser.py +165 -0
  1309. vllm/reasoning/glm4_moe_reasoning_parser.py +171 -0
  1310. vllm/reasoning/gptoss_reasoning_parser.py +173 -0
  1311. vllm/reasoning/granite_reasoning_parser.py +363 -0
  1312. vllm/reasoning/holo2_reasoning_parser.py +88 -0
  1313. vllm/reasoning/hunyuan_a13b_reasoning_parser.py +237 -0
  1314. vllm/reasoning/identity_reasoning_parser.py +63 -0
  1315. vllm/reasoning/minimax_m2_reasoning_parser.py +110 -0
  1316. vllm/reasoning/mistral_reasoning_parser.py +154 -0
  1317. vllm/reasoning/olmo3_reasoning_parser.py +302 -0
  1318. vllm/reasoning/qwen3_reasoning_parser.py +67 -0
  1319. vllm/reasoning/seedoss_reasoning_parser.py +27 -0
  1320. vllm/reasoning/step3_reasoning_parser.py +107 -0
  1321. vllm/sampling_params.py +597 -0
  1322. vllm/scalar_type.py +355 -0
  1323. vllm/scripts.py +17 -0
  1324. vllm/sequence.py +98 -0
  1325. vllm/tasks.py +13 -0
  1326. vllm/third_party/__init__.py +0 -0
  1327. vllm/third_party/pynvml.py +6140 -0
  1328. vllm/tokenizers/__init__.py +20 -0
  1329. vllm/tokenizers/deepseek_v32.py +175 -0
  1330. vllm/tokenizers/deepseek_v32_encoding.py +459 -0
  1331. vllm/tokenizers/detokenizer_utils.py +198 -0
  1332. vllm/tokenizers/hf.py +119 -0
  1333. vllm/tokenizers/mistral.py +567 -0
  1334. vllm/tokenizers/protocol.py +114 -0
  1335. vllm/tokenizers/registry.py +233 -0
  1336. vllm/tool_parsers/__init__.py +150 -0
  1337. vllm/tool_parsers/abstract_tool_parser.py +273 -0
  1338. vllm/tool_parsers/deepseekv31_tool_parser.py +388 -0
  1339. vllm/tool_parsers/deepseekv32_tool_parser.py +591 -0
  1340. vllm/tool_parsers/deepseekv3_tool_parser.py +390 -0
  1341. vllm/tool_parsers/ernie45_tool_parser.py +210 -0
  1342. vllm/tool_parsers/gigachat3_tool_parser.py +190 -0
  1343. vllm/tool_parsers/glm4_moe_tool_parser.py +200 -0
  1344. vllm/tool_parsers/granite_20b_fc_tool_parser.py +273 -0
  1345. vllm/tool_parsers/granite_tool_parser.py +253 -0
  1346. vllm/tool_parsers/hermes_tool_parser.py +495 -0
  1347. vllm/tool_parsers/hunyuan_a13b_tool_parser.py +420 -0
  1348. vllm/tool_parsers/internlm2_tool_parser.py +227 -0
  1349. vllm/tool_parsers/jamba_tool_parser.py +323 -0
  1350. vllm/tool_parsers/kimi_k2_tool_parser.py +590 -0
  1351. vllm/tool_parsers/llama4_pythonic_tool_parser.py +341 -0
  1352. vllm/tool_parsers/llama_tool_parser.py +324 -0
  1353. vllm/tool_parsers/longcat_tool_parser.py +37 -0
  1354. vllm/tool_parsers/minimax_m2_tool_parser.py +643 -0
  1355. vllm/tool_parsers/minimax_tool_parser.py +849 -0
  1356. vllm/tool_parsers/mistral_tool_parser.py +585 -0
  1357. vllm/tool_parsers/olmo3_tool_parser.py +366 -0
  1358. vllm/tool_parsers/openai_tool_parser.py +102 -0
  1359. vllm/tool_parsers/phi4mini_tool_parser.py +120 -0
  1360. vllm/tool_parsers/pythonic_tool_parser.py +332 -0
  1361. vllm/tool_parsers/qwen3coder_tool_parser.py +781 -0
  1362. vllm/tool_parsers/qwen3xml_tool_parser.py +1316 -0
  1363. vllm/tool_parsers/seed_oss_tool_parser.py +744 -0
  1364. vllm/tool_parsers/step3_tool_parser.py +303 -0
  1365. vllm/tool_parsers/utils.py +229 -0
  1366. vllm/tool_parsers/xlam_tool_parser.py +556 -0
  1367. vllm/tracing.py +135 -0
  1368. vllm/transformers_utils/__init__.py +26 -0
  1369. vllm/transformers_utils/chat_templates/__init__.py +5 -0
  1370. vllm/transformers_utils/chat_templates/registry.py +73 -0
  1371. vllm/transformers_utils/chat_templates/template_basic.jinja +3 -0
  1372. vllm/transformers_utils/chat_templates/template_blip2.jinja +11 -0
  1373. vllm/transformers_utils/chat_templates/template_chatml.jinja +10 -0
  1374. vllm/transformers_utils/chat_templates/template_deepseek_ocr.jinja +14 -0
  1375. vllm/transformers_utils/chat_templates/template_deepseek_vl2.jinja +23 -0
  1376. vllm/transformers_utils/chat_templates/template_fuyu.jinja +3 -0
  1377. vllm/transformers_utils/chat_templates/template_minicpmv45.jinja +93 -0
  1378. vllm/transformers_utils/config.py +1144 -0
  1379. vllm/transformers_utils/config_parser_base.py +20 -0
  1380. vllm/transformers_utils/configs/__init__.py +102 -0
  1381. vllm/transformers_utils/configs/afmoe.py +87 -0
  1382. vllm/transformers_utils/configs/arctic.py +216 -0
  1383. vllm/transformers_utils/configs/bagel.py +53 -0
  1384. vllm/transformers_utils/configs/chatglm.py +75 -0
  1385. vllm/transformers_utils/configs/deepseek_vl2.py +126 -0
  1386. vllm/transformers_utils/configs/dotsocr.py +71 -0
  1387. vllm/transformers_utils/configs/eagle.py +90 -0
  1388. vllm/transformers_utils/configs/falcon.py +89 -0
  1389. vllm/transformers_utils/configs/flex_olmo.py +82 -0
  1390. vllm/transformers_utils/configs/hunyuan_vl.py +322 -0
  1391. vllm/transformers_utils/configs/jais.py +243 -0
  1392. vllm/transformers_utils/configs/kimi_linear.py +148 -0
  1393. vllm/transformers_utils/configs/kimi_vl.py +38 -0
  1394. vllm/transformers_utils/configs/lfm2_moe.py +163 -0
  1395. vllm/transformers_utils/configs/medusa.py +65 -0
  1396. vllm/transformers_utils/configs/midashenglm.py +103 -0
  1397. vllm/transformers_utils/configs/mistral.py +235 -0
  1398. vllm/transformers_utils/configs/mlp_speculator.py +69 -0
  1399. vllm/transformers_utils/configs/moonvit.py +33 -0
  1400. vllm/transformers_utils/configs/nemotron.py +220 -0
  1401. vllm/transformers_utils/configs/nemotron_h.py +284 -0
  1402. vllm/transformers_utils/configs/olmo3.py +83 -0
  1403. vllm/transformers_utils/configs/ovis.py +182 -0
  1404. vllm/transformers_utils/configs/qwen3_next.py +277 -0
  1405. vllm/transformers_utils/configs/radio.py +89 -0
  1406. vllm/transformers_utils/configs/speculators/__init__.py +2 -0
  1407. vllm/transformers_utils/configs/speculators/algos.py +38 -0
  1408. vllm/transformers_utils/configs/speculators/base.py +114 -0
  1409. vllm/transformers_utils/configs/step3_vl.py +178 -0
  1410. vllm/transformers_utils/configs/tarsier2.py +24 -0
  1411. vllm/transformers_utils/configs/ultravox.py +120 -0
  1412. vllm/transformers_utils/dynamic_module.py +59 -0
  1413. vllm/transformers_utils/gguf_utils.py +280 -0
  1414. vllm/transformers_utils/processor.py +424 -0
  1415. vllm/transformers_utils/processors/__init__.py +25 -0
  1416. vllm/transformers_utils/processors/bagel.py +73 -0
  1417. vllm/transformers_utils/processors/deepseek_ocr.py +438 -0
  1418. vllm/transformers_utils/processors/deepseek_vl2.py +406 -0
  1419. vllm/transformers_utils/processors/hunyuan_vl.py +233 -0
  1420. vllm/transformers_utils/processors/hunyuan_vl_image.py +477 -0
  1421. vllm/transformers_utils/processors/ovis.py +453 -0
  1422. vllm/transformers_utils/processors/ovis2_5.py +468 -0
  1423. vllm/transformers_utils/repo_utils.py +287 -0
  1424. vllm/transformers_utils/runai_utils.py +102 -0
  1425. vllm/transformers_utils/s3_utils.py +95 -0
  1426. vllm/transformers_utils/tokenizer.py +127 -0
  1427. vllm/transformers_utils/tokenizer_base.py +33 -0
  1428. vllm/transformers_utils/utils.py +112 -0
  1429. vllm/triton_utils/__init__.py +20 -0
  1430. vllm/triton_utils/importing.py +103 -0
  1431. vllm/usage/__init__.py +0 -0
  1432. vllm/usage/usage_lib.py +294 -0
  1433. vllm/utils/__init__.py +66 -0
  1434. vllm/utils/argparse_utils.py +492 -0
  1435. vllm/utils/async_utils.py +310 -0
  1436. vllm/utils/cache.py +214 -0
  1437. vllm/utils/collection_utils.py +112 -0
  1438. vllm/utils/counter.py +45 -0
  1439. vllm/utils/deep_gemm.py +400 -0
  1440. vllm/utils/flashinfer.py +528 -0
  1441. vllm/utils/func_utils.py +236 -0
  1442. vllm/utils/gc_utils.py +151 -0
  1443. vllm/utils/hashing.py +117 -0
  1444. vllm/utils/import_utils.py +449 -0
  1445. vllm/utils/jsontree.py +158 -0
  1446. vllm/utils/math_utils.py +32 -0
  1447. vllm/utils/mem_constants.py +13 -0
  1448. vllm/utils/mem_utils.py +232 -0
  1449. vllm/utils/nccl.py +64 -0
  1450. vllm/utils/network_utils.py +331 -0
  1451. vllm/utils/nvtx_pytorch_hooks.py +286 -0
  1452. vllm/utils/platform_utils.py +59 -0
  1453. vllm/utils/profiling.py +56 -0
  1454. vllm/utils/registry.py +51 -0
  1455. vllm/utils/serial_utils.py +214 -0
  1456. vllm/utils/system_utils.py +269 -0
  1457. vllm/utils/tensor_schema.py +255 -0
  1458. vllm/utils/torch_utils.py +648 -0
  1459. vllm/v1/__init__.py +0 -0
  1460. vllm/v1/attention/__init__.py +0 -0
  1461. vllm/v1/attention/backends/__init__.py +0 -0
  1462. vllm/v1/attention/backends/cpu_attn.py +497 -0
  1463. vllm/v1/attention/backends/flash_attn.py +1051 -0
  1464. vllm/v1/attention/backends/flashinfer.py +1575 -0
  1465. vllm/v1/attention/backends/flex_attention.py +1028 -0
  1466. vllm/v1/attention/backends/gdn_attn.py +375 -0
  1467. vllm/v1/attention/backends/linear_attn.py +77 -0
  1468. vllm/v1/attention/backends/mamba1_attn.py +159 -0
  1469. vllm/v1/attention/backends/mamba2_attn.py +348 -0
  1470. vllm/v1/attention/backends/mamba_attn.py +117 -0
  1471. vllm/v1/attention/backends/mla/__init__.py +0 -0
  1472. vllm/v1/attention/backends/mla/aiter_triton_mla.py +74 -0
  1473. vllm/v1/attention/backends/mla/common.py +2114 -0
  1474. vllm/v1/attention/backends/mla/cutlass_mla.py +278 -0
  1475. vllm/v1/attention/backends/mla/flashattn_mla.py +342 -0
  1476. vllm/v1/attention/backends/mla/flashinfer_mla.py +174 -0
  1477. vllm/v1/attention/backends/mla/flashmla.py +317 -0
  1478. vllm/v1/attention/backends/mla/flashmla_sparse.py +1020 -0
  1479. vllm/v1/attention/backends/mla/indexer.py +345 -0
  1480. vllm/v1/attention/backends/mla/rocm_aiter_mla.py +275 -0
  1481. vllm/v1/attention/backends/mla/rocm_aiter_mla_sparse.py +325 -0
  1482. vllm/v1/attention/backends/mla/triton_mla.py +171 -0
  1483. vllm/v1/attention/backends/pallas.py +436 -0
  1484. vllm/v1/attention/backends/rocm_aiter_fa.py +1000 -0
  1485. vllm/v1/attention/backends/rocm_aiter_unified_attn.py +206 -0
  1486. vllm/v1/attention/backends/rocm_attn.py +359 -0
  1487. vllm/v1/attention/backends/short_conv_attn.py +104 -0
  1488. vllm/v1/attention/backends/tree_attn.py +428 -0
  1489. vllm/v1/attention/backends/triton_attn.py +497 -0
  1490. vllm/v1/attention/backends/utils.py +1212 -0
  1491. vllm/v1/core/__init__.py +0 -0
  1492. vllm/v1/core/block_pool.py +485 -0
  1493. vllm/v1/core/encoder_cache_manager.py +402 -0
  1494. vllm/v1/core/kv_cache_coordinator.py +570 -0
  1495. vllm/v1/core/kv_cache_manager.py +419 -0
  1496. vllm/v1/core/kv_cache_metrics.py +96 -0
  1497. vllm/v1/core/kv_cache_utils.py +1476 -0
  1498. vllm/v1/core/sched/__init__.py +0 -0
  1499. vllm/v1/core/sched/async_scheduler.py +68 -0
  1500. vllm/v1/core/sched/interface.py +189 -0
  1501. vllm/v1/core/sched/output.py +230 -0
  1502. vllm/v1/core/sched/request_queue.py +217 -0
  1503. vllm/v1/core/sched/scheduler.py +1826 -0
  1504. vllm/v1/core/sched/utils.py +64 -0
  1505. vllm/v1/core/single_type_kv_cache_manager.py +801 -0
  1506. vllm/v1/cudagraph_dispatcher.py +183 -0
  1507. vllm/v1/engine/__init__.py +217 -0
  1508. vllm/v1/engine/async_llm.py +866 -0
  1509. vllm/v1/engine/coordinator.py +377 -0
  1510. vllm/v1/engine/core.py +1455 -0
  1511. vllm/v1/engine/core_client.py +1416 -0
  1512. vllm/v1/engine/detokenizer.py +351 -0
  1513. vllm/v1/engine/exceptions.py +18 -0
  1514. vllm/v1/engine/input_processor.py +643 -0
  1515. vllm/v1/engine/llm_engine.py +414 -0
  1516. vllm/v1/engine/logprobs.py +189 -0
  1517. vllm/v1/engine/output_processor.py +659 -0
  1518. vllm/v1/engine/parallel_sampling.py +145 -0
  1519. vllm/v1/engine/processor.py +20 -0
  1520. vllm/v1/engine/utils.py +1068 -0
  1521. vllm/v1/executor/__init__.py +6 -0
  1522. vllm/v1/executor/abstract.py +352 -0
  1523. vllm/v1/executor/multiproc_executor.py +890 -0
  1524. vllm/v1/executor/ray_distributed_executor.py +8 -0
  1525. vllm/v1/executor/ray_executor.py +626 -0
  1526. vllm/v1/executor/ray_utils.py +465 -0
  1527. vllm/v1/executor/uniproc_executor.py +186 -0
  1528. vllm/v1/kv_cache_interface.py +404 -0
  1529. vllm/v1/kv_offload/__init__.py +0 -0
  1530. vllm/v1/kv_offload/abstract.py +161 -0
  1531. vllm/v1/kv_offload/arc_manager.py +237 -0
  1532. vllm/v1/kv_offload/backend.py +97 -0
  1533. vllm/v1/kv_offload/backends/__init__.py +0 -0
  1534. vllm/v1/kv_offload/backends/cpu.py +62 -0
  1535. vllm/v1/kv_offload/cpu.py +86 -0
  1536. vllm/v1/kv_offload/factory.py +56 -0
  1537. vllm/v1/kv_offload/lru_manager.py +139 -0
  1538. vllm/v1/kv_offload/mediums.py +39 -0
  1539. vllm/v1/kv_offload/spec.py +66 -0
  1540. vllm/v1/kv_offload/worker/__init__.py +0 -0
  1541. vllm/v1/kv_offload/worker/cpu_gpu.py +280 -0
  1542. vllm/v1/kv_offload/worker/worker.py +144 -0
  1543. vllm/v1/metrics/__init__.py +0 -0
  1544. vllm/v1/metrics/loggers.py +1305 -0
  1545. vllm/v1/metrics/prometheus.py +82 -0
  1546. vllm/v1/metrics/ray_wrappers.py +194 -0
  1547. vllm/v1/metrics/reader.py +257 -0
  1548. vllm/v1/metrics/stats.py +437 -0
  1549. vllm/v1/outputs.py +245 -0
  1550. vllm/v1/pool/__init__.py +0 -0
  1551. vllm/v1/pool/metadata.py +126 -0
  1552. vllm/v1/request.py +282 -0
  1553. vllm/v1/sample/__init__.py +0 -0
  1554. vllm/v1/sample/logits_processor/__init__.py +352 -0
  1555. vllm/v1/sample/logits_processor/builtin.py +278 -0
  1556. vllm/v1/sample/logits_processor/interface.py +106 -0
  1557. vllm/v1/sample/logits_processor/state.py +165 -0
  1558. vllm/v1/sample/metadata.py +44 -0
  1559. vllm/v1/sample/ops/__init__.py +0 -0
  1560. vllm/v1/sample/ops/bad_words.py +52 -0
  1561. vllm/v1/sample/ops/logprobs.py +25 -0
  1562. vllm/v1/sample/ops/penalties.py +57 -0
  1563. vllm/v1/sample/ops/topk_topp_sampler.py +384 -0
  1564. vllm/v1/sample/rejection_sampler.py +805 -0
  1565. vllm/v1/sample/sampler.py +319 -0
  1566. vllm/v1/sample/tpu/__init__.py +0 -0
  1567. vllm/v1/sample/tpu/metadata.py +120 -0
  1568. vllm/v1/sample/tpu/sampler.py +215 -0
  1569. vllm/v1/serial_utils.py +514 -0
  1570. vllm/v1/spec_decode/__init__.py +0 -0
  1571. vllm/v1/spec_decode/eagle.py +1331 -0
  1572. vllm/v1/spec_decode/medusa.py +73 -0
  1573. vllm/v1/spec_decode/metadata.py +66 -0
  1574. vllm/v1/spec_decode/metrics.py +225 -0
  1575. vllm/v1/spec_decode/ngram_proposer.py +291 -0
  1576. vllm/v1/spec_decode/suffix_decoding.py +101 -0
  1577. vllm/v1/spec_decode/utils.py +121 -0
  1578. vllm/v1/structured_output/__init__.py +353 -0
  1579. vllm/v1/structured_output/backend_guidance.py +265 -0
  1580. vllm/v1/structured_output/backend_lm_format_enforcer.py +177 -0
  1581. vllm/v1/structured_output/backend_outlines.py +324 -0
  1582. vllm/v1/structured_output/backend_types.py +136 -0
  1583. vllm/v1/structured_output/backend_xgrammar.py +378 -0
  1584. vllm/v1/structured_output/request.py +94 -0
  1585. vllm/v1/structured_output/utils.py +469 -0
  1586. vllm/v1/utils.py +414 -0
  1587. vllm/v1/worker/__init__.py +0 -0
  1588. vllm/v1/worker/block_table.py +343 -0
  1589. vllm/v1/worker/cp_utils.py +42 -0
  1590. vllm/v1/worker/cpu_model_runner.py +122 -0
  1591. vllm/v1/worker/cpu_worker.py +192 -0
  1592. vllm/v1/worker/dp_utils.py +240 -0
  1593. vllm/v1/worker/ec_connector_model_runner_mixin.py +87 -0
  1594. vllm/v1/worker/gpu/README.md +4 -0
  1595. vllm/v1/worker/gpu/__init__.py +0 -0
  1596. vllm/v1/worker/gpu/async_utils.py +98 -0
  1597. vllm/v1/worker/gpu/attn_utils.py +189 -0
  1598. vllm/v1/worker/gpu/block_table.py +314 -0
  1599. vllm/v1/worker/gpu/cudagraph_utils.py +259 -0
  1600. vllm/v1/worker/gpu/dp_utils.py +31 -0
  1601. vllm/v1/worker/gpu/input_batch.py +479 -0
  1602. vllm/v1/worker/gpu/metrics/__init__.py +0 -0
  1603. vllm/v1/worker/gpu/metrics/logits.py +42 -0
  1604. vllm/v1/worker/gpu/model_runner.py +1006 -0
  1605. vllm/v1/worker/gpu/sample/__init__.py +0 -0
  1606. vllm/v1/worker/gpu/sample/gumbel.py +101 -0
  1607. vllm/v1/worker/gpu/sample/logprob.py +167 -0
  1608. vllm/v1/worker/gpu/sample/metadata.py +192 -0
  1609. vllm/v1/worker/gpu/sample/min_p.py +51 -0
  1610. vllm/v1/worker/gpu/sample/output.py +14 -0
  1611. vllm/v1/worker/gpu/sample/penalties.py +155 -0
  1612. vllm/v1/worker/gpu/sample/sampler.py +87 -0
  1613. vllm/v1/worker/gpu/spec_decode/__init__.py +18 -0
  1614. vllm/v1/worker/gpu/spec_decode/eagle.py +565 -0
  1615. vllm/v1/worker/gpu/spec_decode/eagle_cudagraph.py +115 -0
  1616. vllm/v1/worker/gpu/spec_decode/rejection_sample.py +71 -0
  1617. vllm/v1/worker/gpu/states.py +316 -0
  1618. vllm/v1/worker/gpu/structured_outputs.py +76 -0
  1619. vllm/v1/worker/gpu_input_batch.py +990 -0
  1620. vllm/v1/worker/gpu_model_runner.py +5470 -0
  1621. vllm/v1/worker/gpu_ubatch_wrapper.py +472 -0
  1622. vllm/v1/worker/gpu_worker.py +955 -0
  1623. vllm/v1/worker/kv_connector_model_runner_mixin.py +302 -0
  1624. vllm/v1/worker/lora_model_runner_mixin.py +212 -0
  1625. vllm/v1/worker/tpu_input_batch.py +583 -0
  1626. vllm/v1/worker/tpu_model_runner.py +2191 -0
  1627. vllm/v1/worker/tpu_worker.py +352 -0
  1628. vllm/v1/worker/ubatch_utils.py +109 -0
  1629. vllm/v1/worker/ubatching.py +231 -0
  1630. vllm/v1/worker/utils.py +375 -0
  1631. vllm/v1/worker/worker_base.py +377 -0
  1632. vllm/v1/worker/workspace.py +253 -0
  1633. vllm/v1/worker/xpu_model_runner.py +48 -0
  1634. vllm/v1/worker/xpu_worker.py +174 -0
  1635. vllm/version.py +39 -0
  1636. vllm/vllm_flash_attn/.gitkeep +0 -0
  1637. vllm_cpu_avx512vnni-0.13.0.dist-info/METADATA +339 -0
  1638. vllm_cpu_avx512vnni-0.13.0.dist-info/RECORD +1641 -0
  1639. vllm_cpu_avx512vnni-0.13.0.dist-info/WHEEL +5 -0
  1640. vllm_cpu_avx512vnni-0.13.0.dist-info/entry_points.txt +5 -0
  1641. vllm_cpu_avx512vnni-0.13.0.dist-info/top_level.txt +1 -0
vllm/config/model.py ADDED
@@ -0,0 +1,2190 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+
4
+ import warnings
5
+ from collections.abc import Callable
6
+ from dataclasses import InitVar, field
7
+ from functools import cached_property
8
+ from typing import TYPE_CHECKING, Any, Literal, cast, get_args
9
+
10
+ import torch
11
+ from pydantic import ConfigDict, Field, field_validator, model_validator
12
+ from pydantic.dataclasses import dataclass
13
+ from safetensors.torch import _TYPES as _SAFETENSORS_TO_TORCH_DTYPE
14
+ from transformers.configuration_utils import ALLOWED_LAYER_TYPES
15
+
16
+ import vllm.envs as envs
17
+ from vllm.attention.backends.registry import AttentionBackendEnum
18
+ from vllm.config.multimodal import MMCacheType, MMEncoderTPMode, MultiModalConfig
19
+ from vllm.config.pooler import PoolerConfig
20
+ from vllm.config.scheduler import RunnerType
21
+ from vllm.config.utils import config, getattr_iter
22
+ from vllm.logger import init_logger
23
+ from vllm.platforms import current_platform
24
+ from vllm.transformers_utils.config import (
25
+ ConfigFormat,
26
+ get_config,
27
+ get_hf_image_processor_config,
28
+ get_hf_text_config,
29
+ get_pooling_config,
30
+ get_sentence_transformer_tokenizer_config,
31
+ is_encoder_decoder,
32
+ try_get_dense_modules,
33
+ try_get_generation_config,
34
+ try_get_safetensors_metadata,
35
+ try_get_tokenizer_config,
36
+ uses_mrope,
37
+ uses_xdrope_dim,
38
+ )
39
+ from vllm.transformers_utils.gguf_utils import (
40
+ is_gguf,
41
+ is_remote_gguf,
42
+ maybe_patch_hf_config_from_gguf,
43
+ split_remote_gguf,
44
+ )
45
+ from vllm.transformers_utils.runai_utils import ObjectStorageModel, is_runai_obj_uri
46
+ from vllm.transformers_utils.utils import maybe_model_redirect
47
+ from vllm.utils.import_utils import LazyLoader
48
+ from vllm.utils.torch_utils import common_broadcastable_dtype
49
+
50
+ if TYPE_CHECKING:
51
+ from transformers import PretrainedConfig
52
+
53
+ import vllm.model_executor.layers.quantization as me_quant
54
+ import vllm.model_executor.models as me_models
55
+ from vllm.config.load import LoadConfig
56
+ from vllm.config.parallel import ParallelConfig
57
+ from vllm.model_executor.layers.quantization import QuantizationMethods
58
+ from vllm.v1.sample.logits_processor import LogitsProcessor
59
+ else:
60
+ PretrainedConfig = Any
61
+
62
+ me_quant = LazyLoader(
63
+ "model_executor", globals(), "vllm.model_executor.layers.quantization"
64
+ )
65
+ me_models = LazyLoader("model_executor", globals(), "vllm.model_executor.models")
66
+ LoadConfig = Any
67
+ ParallelConfig = Any
68
+ QuantizationMethods = Any
69
+ LogitsProcessor = Any
70
+
71
+ logger = init_logger(__name__)
72
+
73
+ RunnerOption = Literal["auto", RunnerType]
74
+ ConvertType = Literal["none", "embed", "classify", "reward"]
75
+ ConvertOption = Literal["auto", ConvertType]
76
+ TokenizerMode = Literal["auto", "hf", "slow", "mistral", "deepseek_v32"]
77
+ ModelDType = Literal["auto", "half", "float16", "bfloat16", "float", "float32"]
78
+ LogprobsMode = Literal[
79
+ "raw_logits", "raw_logprobs", "processed_logits", "processed_logprobs"
80
+ ]
81
+ HfOverrides = dict[str, Any] | Callable[[PretrainedConfig], PretrainedConfig]
82
+ ModelImpl = Literal["auto", "vllm", "transformers", "terratorch"]
83
+ LayerBlockType = Literal["attention", "linear_attention", "mamba"]
84
+
85
+ _RUNNER_CONVERTS: dict[RunnerType, list[ConvertType]] = {
86
+ "generate": [],
87
+ "pooling": ["embed", "classify", "reward"],
88
+ "draft": [],
89
+ }
90
+
91
+ AttnTypeStr = Literal[
92
+ "decoder", "encoder", "encoder_only", "encoder_decoder", "attention_free", "hybrid"
93
+ ]
94
+
95
+
96
+ @config
97
+ @dataclass(config=ConfigDict(arbitrary_types_allowed=True))
98
+ class ModelConfig:
99
+ """Configuration for the model."""
100
+
101
+ model: str = "Qwen/Qwen3-0.6B"
102
+ """Name or path of the Hugging Face model to use. It is also used as the
103
+ content for `model_name` tag in metrics output when `served_model_name` is
104
+ not specified."""
105
+ runner: RunnerOption = "auto"
106
+ """The type of model runner to use. Each vLLM instance only supports one
107
+ model runner, even if the same model can be used for multiple types."""
108
+ convert: ConvertOption = "auto"
109
+ """Convert the model using adapters defined in
110
+ [vllm.model_executor.models.adapters][]. The most common use case is to
111
+ adapt a text generation model to be used for pooling tasks."""
112
+ tokenizer: str = Field(default=None)
113
+ """Name or path of the Hugging Face tokenizer to use. If unspecified, model
114
+ name or path will be used."""
115
+ tokenizer_mode: TokenizerMode | str = "auto"
116
+ """Tokenizer mode:\n
117
+ - "auto" will use the tokenizer from `mistral_common` for Mistral models
118
+ if available, otherwise it will use the "hf" tokenizer.\n
119
+ - "hf" will use the fast tokenizer if available.\n
120
+ - "slow" will always use the slow tokenizer.\n
121
+ - "mistral" will always use the tokenizer from `mistral_common`.\n
122
+ - "deepseek_v32" will always use the tokenizer from `deepseek_v32`.\n
123
+ - Other custom values can be supported via plugins."""
124
+ trust_remote_code: bool = False
125
+ """Trust remote code (e.g., from HuggingFace) when downloading the model
126
+ and tokenizer."""
127
+ dtype: ModelDType | torch.dtype = "auto"
128
+ """Data type for model weights and activations:\n
129
+ - "auto" will use FP16 precision for FP32 and FP16 models, and BF16
130
+ precision for BF16 models.\n
131
+ - "half" for FP16. Recommended for AWQ quantization.\n
132
+ - "float16" is the same as "half".\n
133
+ - "bfloat16" for a balance between precision and range.\n
134
+ - "float" is shorthand for FP32 precision.\n
135
+ - "float32" for FP32 precision."""
136
+ seed: int = 0
137
+ """Random seed for reproducibility.
138
+
139
+ We must set the global seed because otherwise,
140
+ different tensor parallel workers would sample different tokens,
141
+ leading to inconsistent results."""
142
+ hf_config: PretrainedConfig = field(init=False)
143
+ """The Hugging Face config of the model."""
144
+ hf_text_config: PretrainedConfig = field(init=False)
145
+ """The Hugging Face config of the text model (same as hf_config for text models)."""
146
+ hf_config_path: str | None = None
147
+ """Name or path of the Hugging Face config to use. If unspecified, model
148
+ name or path will be used."""
149
+ allowed_local_media_path: str = ""
150
+ """Allowing API requests to read local images or videos from directories
151
+ specified by the server file system. This is a security risk. Should only
152
+ be enabled in trusted environments."""
153
+ allowed_media_domains: list[str] | None = None
154
+ """If set, only media URLs that belong to this domain can be used for
155
+ multi-modal inputs. """
156
+ revision: str | None = None
157
+ """The specific model version to use. It can be a branch name, a tag name,
158
+ or a commit id. If unspecified, will use the default version."""
159
+ code_revision: str | None = None
160
+ """The specific revision to use for the model code on the Hugging Face Hub.
161
+ It can be a branch name, a tag name, or a commit id. If unspecified, will
162
+ use the default version."""
163
+ tokenizer_revision: str | None = None
164
+ """The specific revision to use for the tokenizer on the Hugging Face Hub.
165
+ It can be a branch name, a tag name, or a commit id. If unspecified, will
166
+ use the default version."""
167
+ max_model_len: int = Field(default=None, gt=0)
168
+ """Model context length (prompt and output). If unspecified, will be
169
+ automatically derived from the model config.
170
+
171
+ When passing via `--max-model-len`, supports k/m/g/K/M/G in human-readable
172
+ format. Examples:\n
173
+ - 1k -> 1000\n
174
+ - 1K -> 1024\n
175
+ - 25.6k -> 25,600"""
176
+ spec_target_max_model_len: int | None = None
177
+ """Specify the maximum length for spec decoding draft models."""
178
+ quantization: QuantizationMethods | str | None = None
179
+ """Method used to quantize the weights. If `None`, we first check the
180
+ `quantization_config` attribute in the model config file. If that is
181
+ `None`, we assume the model weights are not quantized and use `dtype` to
182
+ determine the data type of the weights."""
183
+ enforce_eager: bool = False
184
+ """Whether to always use eager-mode PyTorch. If True, we will disable CUDA
185
+ graph and always execute the model in eager mode. If False, we will use
186
+ CUDA graph and eager execution in hybrid for maximal performance and
187
+ flexibility."""
188
+ max_logprobs: int = 20
189
+ """Maximum number of log probabilities to return when `logprobs` is
190
+ specified in `SamplingParams`. The default value comes the default for the
191
+ OpenAI Chat Completions API. -1 means no cap, i.e. all (output_length *
192
+ vocab_size) logprobs are allowed to be returned and it may cause OOM."""
193
+ logprobs_mode: LogprobsMode = "raw_logprobs"
194
+ """Indicates the content returned in the logprobs and prompt_logprobs.
195
+ Supported mode:
196
+ 1) raw_logprobs, 2) processed_logprobs, 3) raw_logits, 4) processed_logits.
197
+ Raw means the values before applying any logit processors, like bad words.
198
+ Processed means the values after applying all processors, including
199
+ temperature and top_k/top_p.
200
+ """
201
+ disable_sliding_window: bool = False
202
+ """Whether to disable sliding window. If True, we will disable the sliding
203
+ window functionality of the model, capping to sliding window size. If the
204
+ model does not support sliding window, this argument is ignored."""
205
+ disable_cascade_attn: bool = False
206
+ """Disable cascade attention for V1. While cascade attention does not
207
+ change the mathematical correctness, disabling it could be useful for
208
+ preventing potential numerical issues. Note that even if this is set to
209
+ False, cascade attention will be only used when the heuristic tells that
210
+ it's beneficial."""
211
+ skip_tokenizer_init: bool = False
212
+ """Skip initialization of tokenizer and detokenizer. Expects valid
213
+ `prompt_token_ids` and `None` for prompt from the input. The generated
214
+ output will contain token ids."""
215
+ enable_prompt_embeds: bool = False
216
+ """If `True`, enables passing text embeddings as inputs via the
217
+ `prompt_embeds` key.
218
+
219
+ WARNING: The vLLM engine may crash if incorrect shape of embeddings is passed.
220
+ Only enable this flag for trusted users!"""
221
+ served_model_name: str | list[str] | None = None
222
+ """The model name(s) used in the API. If multiple names are provided, the
223
+ server will respond to any of the provided names. The model name in the
224
+ model field of a response will be the first name in this list. If not
225
+ specified, the model name will be the same as the `--model` argument. Noted
226
+ that this name(s) will also be used in `model_name` tag content of
227
+ prometheus metrics, if multiple names provided, metrics tag will take the
228
+ first one."""
229
+ config_format: str | ConfigFormat = "auto"
230
+ """The format of the model config to load:\n
231
+ - "auto" will try to load the config in hf format if available after trying
232
+ to load in mistral format.\n
233
+ - "hf" will load the config in hf format.\n
234
+ - "mistral" will load the config in mistral format."""
235
+ hf_token: bool | str | None = None
236
+ """The token to use as HTTP bearer authorization for remote files . If
237
+ `True`, will use the token generated when running `huggingface-cli login`
238
+ (stored in `~/.huggingface`)."""
239
+ hf_overrides: HfOverrides = field(default_factory=dict)
240
+ """If a dictionary, contains arguments to be forwarded to the Hugging Face
241
+ config. If a callable, it is called to update the HuggingFace config."""
242
+ logits_processor_pattern: str | None = None
243
+ """Optional regex pattern specifying valid logits processor qualified names
244
+ that can be passed with the `logits_processors` extra completion argument.
245
+ Defaults to `None`, which allows no processors."""
246
+ generation_config: str = "auto"
247
+ """The folder path to the generation config. Defaults to `"auto"`, the
248
+ generation config will be loaded from model path. If set to `"vllm"`, no
249
+ generation config is loaded, vLLM defaults will be used. If set to a folder
250
+ path, the generation config will be loaded from the specified folder path.
251
+ If `max_new_tokens` is specified in generation config, then it sets a
252
+ server-wide limit on the number of output tokens for all requests."""
253
+ override_generation_config: dict[str, Any] = field(default_factory=dict)
254
+ """Overrides or sets generation config. e.g. `{"temperature": 0.5}`. If
255
+ used with `--generation-config auto`, the override parameters will be
256
+ merged with the default config from the model. If used with
257
+ `--generation-config vllm`, only the override parameters are used."""
258
+ enable_sleep_mode: bool = False
259
+ """Enable sleep mode for the engine (only cuda and
260
+ hip platforms are supported)."""
261
+ model_impl: str | ModelImpl = "auto"
262
+ """Which implementation of the model to use:\n
263
+ - "auto" will try to use the vLLM implementation, if it exists, and fall
264
+ back to the Transformers implementation if no vLLM implementation is
265
+ available.\n
266
+ - "vllm" will use the vLLM model implementation.\n
267
+ - "transformers" will use the Transformers model implementation.\n
268
+ - "terratorch" will use the TerraTorch model implementation.
269
+ """
270
+ override_attention_dtype: str | None = None
271
+ """Override dtype for attention"""
272
+ logits_processors: list[str | type[LogitsProcessor]] | None = None
273
+ """One or more logits processors' fully-qualified class names or class
274
+ definitions"""
275
+ io_processor_plugin: str | None = None
276
+ """IOProcessor plugin name to load at model startup"""
277
+
278
+ # Pooler config
279
+ pooler_config: PoolerConfig | None = None
280
+ """Pooler config which controls the behaviour of output pooling in pooling
281
+ models."""
282
+
283
+ # Multimodal config and init vars
284
+ multimodal_config: MultiModalConfig | None = None
285
+ """Configuration for multimodal model. If `None`, this will be inferred
286
+ from the architecture of `self.model`."""
287
+ limit_mm_per_prompt: InitVar[dict[str, int | dict[str, int]] | None] = None
288
+ enable_mm_embeds: InitVar[bool | None] = None
289
+ media_io_kwargs: InitVar[dict[str, dict[str, Any]] | None] = None
290
+ mm_processor_kwargs: InitVar[dict[str, Any] | None] = None
291
+ mm_processor_cache_gb: InitVar[float | None] = None
292
+ mm_processor_cache_type: InitVar[MMCacheType | None] = None
293
+ mm_shm_cache_max_object_size_mb: InitVar[int | None] = None
294
+ mm_encoder_tp_mode: InitVar[MMEncoderTPMode | None] = None
295
+ mm_encoder_attn_backend: InitVar[AttentionBackendEnum | str | None] = None
296
+ interleave_mm_strings: InitVar[bool | None] = None
297
+ skip_mm_profiling: InitVar[bool | None] = None
298
+ video_pruning_rate: InitVar[float | None] = None
299
+
300
+ def compute_hash(self) -> str:
301
+ """
302
+ WARNING: Whenever a new field is added to this config,
303
+ ensure that it is included in the factors list if
304
+ it affects the computation graph.
305
+
306
+ Provide a hash that uniquely identifies all the configs
307
+ that affect the structure of the computation
308
+ graph from input ids/embeddings to the final hidden states,
309
+ excluding anything before input ids/embeddings and after
310
+ the final hidden states.
311
+ """
312
+ ignored_factors = {
313
+ "runner",
314
+ "convert",
315
+ "tokenizer",
316
+ "tokenizer_mode",
317
+ "seed",
318
+ "hf_config_path",
319
+ "allowed_local_media_path",
320
+ "allowed_media_domains",
321
+ "tokenizer_revision",
322
+ "spec_target_max_model_len",
323
+ "enforce_eager",
324
+ "logprobs_mode",
325
+ "disable_cascade_attn",
326
+ "skip_tokenizer_init",
327
+ "served_model_name",
328
+ "config_format",
329
+ "hf_token",
330
+ "hf_overrides",
331
+ "logits_processor_pattern",
332
+ "override_attention_dtype",
333
+ "logits_processors",
334
+ "io_processor_plugin",
335
+ "pooler_config",
336
+ "multimodal_config",
337
+ "limit_mm_per_prompt",
338
+ "media_io_kwargs",
339
+ "mm_processor_kwargs",
340
+ "mm_processor_cache_gb",
341
+ "mm_processor_cache_type",
342
+ "mm_shm_cache_max_object_size_mb",
343
+ "mm_encoder_tp_mode",
344
+ "interleave_mm_strings",
345
+ "skip_mm_profiling",
346
+ }
347
+
348
+ from vllm.config.utils import get_hash_factors, hash_factors
349
+
350
+ factors = get_hash_factors(self, ignored_factors)
351
+ return hash_factors(factors)
352
+
353
+ def _update_nested(
354
+ self,
355
+ target: PretrainedConfig | dict[str, Any],
356
+ updates: dict[str, Any],
357
+ ) -> None:
358
+ """Recursively updates a config or dict with nested updates."""
359
+ for key, value in updates.items():
360
+ if isinstance(value, dict):
361
+ # Get the nested target
362
+ if isinstance(target, dict):
363
+ nested_target = target.get(key)
364
+ else:
365
+ nested_target = getattr(target, key, None)
366
+
367
+ # If nested target exists and can be updated recursively
368
+ if nested_target is not None and (
369
+ isinstance(nested_target, dict)
370
+ or hasattr(nested_target, "__dict__")
371
+ ):
372
+ self._update_nested(nested_target, value)
373
+ continue
374
+
375
+ # Set the value (base case)
376
+ if isinstance(target, dict):
377
+ target[key] = value
378
+ else:
379
+ setattr(target, key, value)
380
+
381
+ def _apply_dict_overrides(
382
+ self,
383
+ config: PretrainedConfig,
384
+ overrides: dict[str, Any],
385
+ ) -> None:
386
+ """Apply dict overrides, handling both nested configs and dict values."""
387
+ from transformers import PretrainedConfig
388
+
389
+ for key, value in overrides.items():
390
+ attr = getattr(config, key, None)
391
+ if attr is not None and isinstance(attr, PretrainedConfig):
392
+ # It's a nested config - recursively update it
393
+ self._update_nested(attr, value)
394
+ else:
395
+ # It's a dict-valued parameter - set it directly
396
+ setattr(config, key, value)
397
+
398
+ def __post_init__(
399
+ self,
400
+ # Multimodal config init vars
401
+ limit_mm_per_prompt: dict[str, int | dict[str, int]] | None,
402
+ enable_mm_embeds: bool | None,
403
+ media_io_kwargs: dict[str, dict[str, Any]] | None,
404
+ mm_processor_kwargs: dict[str, Any] | None,
405
+ mm_processor_cache_gb: float | None,
406
+ mm_processor_cache_type: MMCacheType | None,
407
+ mm_shm_cache_max_object_size_mb: int | None,
408
+ mm_encoder_tp_mode: MMEncoderTPMode | None,
409
+ mm_encoder_attn_backend: AttentionBackendEnum | str | None,
410
+ interleave_mm_strings: bool | None,
411
+ skip_mm_profiling: bool | None,
412
+ video_pruning_rate: float | None,
413
+ ) -> None:
414
+ # Keep set served_model_name before maybe_model_redirect(self.model)
415
+ self.served_model_name = get_served_model_name(
416
+ self.model, self.served_model_name
417
+ )
418
+ self.model = maybe_model_redirect(self.model)
419
+ # The tokenizer is consistent with the model by default.
420
+ if self.tokenizer is None:
421
+ self.tokenizer = self.model
422
+ if self.tokenizer_revision is None:
423
+ self.tokenizer_revision = self.revision
424
+ self.tokenizer = maybe_model_redirect(self.tokenizer)
425
+
426
+ if isinstance(self.hf_config_path, str):
427
+ self.hf_config_path = maybe_model_redirect(self.hf_config_path)
428
+
429
+ if callable(self.hf_overrides):
430
+ hf_overrides_kw = {}
431
+ hf_overrides_fn = self.hf_overrides
432
+ dict_overrides: dict[str, Any] = {}
433
+ else:
434
+ # Separate dict overrides from flat ones
435
+ # We'll determine how to apply dict overrides after loading the config
436
+ hf_overrides_kw = {}
437
+ dict_overrides = {}
438
+ for key, value in self.hf_overrides.items():
439
+ if isinstance(value, dict):
440
+ dict_overrides[key] = value
441
+ else:
442
+ hf_overrides_kw[key] = value
443
+ hf_overrides_fn = None
444
+
445
+ self.maybe_pull_model_tokenizer_for_runai(self.model, self.tokenizer)
446
+
447
+ from vllm.platforms import current_platform
448
+
449
+ if self.override_attention_dtype is not None and not current_platform.is_rocm():
450
+ warnings.warn(
451
+ "override-attention-dtype is set but not using ROCm platform",
452
+ stacklevel=2,
453
+ )
454
+
455
+ if self.enable_sleep_mode and not current_platform.is_sleep_mode_available():
456
+ raise ValueError("Sleep mode is not supported on current platform.")
457
+
458
+ hf_config = get_config(
459
+ self.hf_config_path or self.model,
460
+ self.trust_remote_code,
461
+ self.revision,
462
+ self.code_revision,
463
+ self.config_format,
464
+ hf_overrides_kw=hf_overrides_kw,
465
+ hf_overrides_fn=hf_overrides_fn,
466
+ )
467
+ hf_config = maybe_patch_hf_config_from_gguf(
468
+ self.model,
469
+ hf_config,
470
+ )
471
+
472
+ self.hf_config = hf_config
473
+ if dict_overrides:
474
+ self._apply_dict_overrides(hf_config, dict_overrides)
475
+ self.hf_text_config = get_hf_text_config(self.hf_config)
476
+ self.attention_chunk_size = getattr(
477
+ self.hf_text_config, "attention_chunk_size", None
478
+ )
479
+ self.encoder_config = self._get_encoder_config()
480
+ self.hf_image_processor_config = get_hf_image_processor_config(
481
+ self.model, hf_token=self.hf_token, revision=self.revision
482
+ )
483
+
484
+ architectures = self.architectures
485
+ registry = self.registry
486
+ is_generative_model = registry.is_text_generation_model(architectures, self)
487
+ is_pooling_model = registry.is_pooling_model(architectures, self)
488
+
489
+ self.runner_type = self._get_runner_type(architectures, self.runner)
490
+ self.convert_type = self._get_convert_type(
491
+ architectures, self.runner_type, self.convert
492
+ )
493
+
494
+ if self.runner_type == "generate" and not is_generative_model:
495
+ generate_converts = _RUNNER_CONVERTS["generate"]
496
+ if self.convert_type not in generate_converts:
497
+ # Currently we don't have any converters for generative models
498
+ raise ValueError("This model does not support `--runner generate`.")
499
+ if self.runner_type == "pooling" and not is_pooling_model:
500
+ pooling_converts = _RUNNER_CONVERTS["pooling"]
501
+ if self.convert_type not in pooling_converts:
502
+ convert_option = "<" + "|".join(pooling_converts) + ">"
503
+ raise ValueError(
504
+ "This model does not support `--runner pooling`. "
505
+ f"You can pass `--convert {convert_option} to adapt "
506
+ "it into a pooling model."
507
+ )
508
+
509
+ # Note: Initialize these attributes early because transformers fallback
510
+ # may fail to load dynamic modules in child processes
511
+ model_info, arch = registry.inspect_model_cls(architectures, self)
512
+ self._model_info = model_info
513
+ self._architecture = arch
514
+ logger.info("Resolved architecture: %s", arch)
515
+
516
+ # Init pooler config if needed
517
+ if self.runner_type == "pooling":
518
+ if self.pooler_config is None:
519
+ self.pooler_config = PoolerConfig()
520
+
521
+ base_config = get_pooling_config(self.model, self.revision)
522
+ if base_config is not None:
523
+ # Only set values that are not overridden by the user
524
+ for k, v in base_config.items():
525
+ if getattr(self.pooler_config, k) is None:
526
+ setattr(self.pooler_config, k, v)
527
+
528
+ default_pooling_type = self._model_info.default_pooling_type
529
+ if self.pooler_config.pooling_type is None:
530
+ self.pooler_config.pooling_type = default_pooling_type
531
+
532
+ self.dtype: torch.dtype = _get_and_verify_dtype(
533
+ self.model,
534
+ self.hf_config,
535
+ self.dtype,
536
+ is_pooling_model=self.runner_type == "pooling",
537
+ revision=self.revision,
538
+ )
539
+
540
+ self.original_max_model_len = self.max_model_len
541
+ self.max_model_len = self.get_and_verify_max_len(self.max_model_len)
542
+
543
+ if self.is_encoder_decoder:
544
+ self.mm_processor_cache_gb = 0
545
+ logger.info("Encoder-decoder model detected, disabling mm processor cache.")
546
+
547
+ # Init multimodal config if needed
548
+ if self._model_info.supports_multimodal:
549
+ if (
550
+ mm_encoder_tp_mode == "data"
551
+ and not self._model_info.supports_multimodal_encoder_tp_data
552
+ ):
553
+ logger.warning_once(
554
+ "This model does not support `--mm-encoder-tp-mode data`. "
555
+ "Falling back to `--mm-encoder-tp-mode weights`."
556
+ )
557
+ mm_encoder_tp_mode = "weights"
558
+
559
+ mm_config_kwargs = dict(
560
+ limit_per_prompt=limit_mm_per_prompt,
561
+ enable_mm_embeds=enable_mm_embeds,
562
+ media_io_kwargs=media_io_kwargs,
563
+ mm_processor_kwargs=mm_processor_kwargs,
564
+ mm_processor_cache_gb=mm_processor_cache_gb,
565
+ mm_processor_cache_type=mm_processor_cache_type,
566
+ mm_shm_cache_max_object_size_mb=mm_shm_cache_max_object_size_mb,
567
+ mm_encoder_tp_mode=mm_encoder_tp_mode,
568
+ mm_encoder_attn_backend=mm_encoder_attn_backend,
569
+ interleave_mm_strings=interleave_mm_strings,
570
+ skip_mm_profiling=skip_mm_profiling,
571
+ video_pruning_rate=video_pruning_rate,
572
+ )
573
+
574
+ mm_config_kwargs = {
575
+ k: v for k, v in mm_config_kwargs.items() if v is not None
576
+ }
577
+
578
+ self.multimodal_config = MultiModalConfig(**mm_config_kwargs)
579
+
580
+ # Multimodal GGUF models must use original repo for mm processing
581
+ if is_gguf(self.tokenizer) and self.is_multimodal_model:
582
+ raise ValueError(
583
+ "Loading a multimodal GGUF model needs to use original "
584
+ "tokenizer. Please specify the unquantized hf model's "
585
+ "repo name or path using the --tokenizer argument."
586
+ )
587
+
588
+ if self.disable_sliding_window:
589
+ # Set after get_and_verify_max_len to ensure that max_model_len
590
+ # can be correctly capped to sliding window size
591
+ self.hf_text_config.sliding_window = None
592
+
593
+ # Avoid running try_verify_and_update_config multiple times
594
+ self.config_updated = False
595
+
596
+ self._verify_quantization()
597
+ self._verify_cuda_graph()
598
+ self._verify_bnb_config()
599
+
600
+ @field_validator("tokenizer", "max_model_len", mode="wrap")
601
+ @classmethod
602
+ def _skip_none_validation(cls, value: Any, handler: Callable) -> Any:
603
+ """Skip validation if the value is `None` when initialisation is delayed."""
604
+ if value is None:
605
+ return value
606
+ return handler(value)
607
+
608
+ @field_validator("tokenizer_mode", mode="after")
609
+ def _lowercase_tokenizer_mode(cls, tokenizer_mode: str) -> str:
610
+ return tokenizer_mode.lower()
611
+
612
+ @field_validator("quantization", mode="before")
613
+ @classmethod
614
+ def validate_quantization_before(cls, value: Any) -> Any:
615
+ if isinstance(value, str):
616
+ return value.lower()
617
+ return value
618
+
619
+ @model_validator(mode="after")
620
+ def validate_model_config_after(self: "ModelConfig") -> "ModelConfig":
621
+ """Called after __post_init__"""
622
+ if not isinstance(self.tokenizer, str):
623
+ raise ValueError(
624
+ f"tokenizer must be a string, got "
625
+ f"{type(self.tokenizer).__name__}: {self.tokenizer!r}. "
626
+ "Please provide a valid tokenizer path or HuggingFace model ID."
627
+ )
628
+ if not isinstance(self.max_model_len, int):
629
+ raise ValueError(
630
+ f"max_model_len must be a positive integer, "
631
+ f"got {type(self.max_model_len).__name__}: {self.max_model_len!r}. "
632
+ "Example: max_model_len=2048"
633
+ )
634
+ return self
635
+
636
+ def _get_transformers_backend_cls(self) -> str:
637
+ """Determine which Transformers modeling backend class will be used if
638
+ `model_impl` is set to `transformers` or `auto`."""
639
+ cls = "Transformers"
640
+ # If 'hf_config != hf_text_config' it's a nested config, i.e. multimodal
641
+ cls += "MultiModal" if self.hf_config != self.hf_text_config else ""
642
+ cls += "MoE" if self.get_num_experts() > 1 else ""
643
+ # Check if the architecture we're wrapping has defaults
644
+ runner = None
645
+ task = None
646
+ if defaults := try_match_architecture_defaults(self.architectures[0]):
647
+ _, (runner, task) = defaults
648
+ # User specified value take precedence
649
+ if self.runner != "auto":
650
+ runner = self.runner
651
+ # Only consider Transformers modeling backend pooling classes if we're wrapping
652
+ # an architecture that defaults to pooling. Otherwise, we return the LM class
653
+ # and use adapters.
654
+ if runner == "pooling" and task in {"embed", "classify"}:
655
+ if task == "embed":
656
+ cls += "EmbeddingModel"
657
+ elif task == "classify":
658
+ cls += "ForSequenceClassification"
659
+ else:
660
+ cls += "ForCausalLM"
661
+ return cls
662
+
663
+ def using_transformers_backend(self) -> bool:
664
+ """Check if the model is using the Transformers modeling backend class."""
665
+ used_cls = self._model_info.architecture
666
+ transformers_backend_cls = self._get_transformers_backend_cls()
667
+ return used_cls == transformers_backend_cls
668
+
669
+ @property
670
+ def registry(self):
671
+ return me_models.ModelRegistry
672
+
673
+ @property
674
+ def architectures(self) -> list[str]:
675
+ return getattr(self.hf_config, "architectures", [])
676
+
677
+ @property
678
+ def architecture(self) -> str:
679
+ """The architecture vllm actually used."""
680
+ return self._architecture
681
+
682
+ def maybe_pull_model_tokenizer_for_runai(self, model: str, tokenizer: str) -> None:
683
+ """Pull model/tokenizer from Object Storage to temporary
684
+ directory when needed.
685
+
686
+ Args:
687
+ model: Model name or path
688
+ tokenizer: Tokenizer name or path
689
+ """
690
+
691
+ if not (is_runai_obj_uri(model) or is_runai_obj_uri(tokenizer)):
692
+ return
693
+
694
+ if is_runai_obj_uri(model):
695
+ object_storage_model = ObjectStorageModel(url=model)
696
+ object_storage_model.pull_files(
697
+ model, allow_pattern=["*.model", "*.py", "*.json"]
698
+ )
699
+ self.model_weights = model
700
+ self.model = object_storage_model.dir
701
+
702
+ # If tokenizer is same as model, download to same directory
703
+ if model == tokenizer:
704
+ object_storage_model.pull_files(
705
+ model,
706
+ ignore_pattern=[
707
+ "*.pt",
708
+ "*.safetensors",
709
+ "*.bin",
710
+ "*.tensors",
711
+ "*.pth",
712
+ ],
713
+ )
714
+ self.tokenizer = object_storage_model.dir
715
+ return
716
+
717
+ # Only download tokenizer if needed and not already handled
718
+ if is_runai_obj_uri(tokenizer):
719
+ object_storage_tokenizer = ObjectStorageModel(url=tokenizer)
720
+ object_storage_tokenizer.pull_files(
721
+ model,
722
+ ignore_pattern=["*.pt", "*.safetensors", "*.bin", "*.tensors", "*.pth"],
723
+ )
724
+ self.tokenizer = object_storage_tokenizer.dir
725
+
726
+ def _get_encoder_config(self):
727
+ model = self.model
728
+ if is_remote_gguf(model):
729
+ model, _ = split_remote_gguf(model)
730
+ return get_sentence_transformer_tokenizer_config(model, self.revision)
731
+
732
+ def _get_default_runner_type(
733
+ self,
734
+ architectures: list[str],
735
+ ) -> RunnerType:
736
+ registry = self.registry
737
+
738
+ # Some Sentence Transformers models use *ForCausalLM archs
739
+ if get_pooling_config(self.model, self.revision):
740
+ return "pooling"
741
+
742
+ for arch in architectures:
743
+ if arch in registry.get_supported_archs():
744
+ if registry.is_pooling_model(architectures, self):
745
+ return "pooling"
746
+ if registry.is_text_generation_model(architectures, self):
747
+ return "generate"
748
+
749
+ match = try_match_architecture_defaults(arch)
750
+ if match:
751
+ _, (runner_type, _) = match
752
+ return runner_type
753
+
754
+ return "generate"
755
+
756
+ def _get_runner_type(
757
+ self,
758
+ architectures: list[str],
759
+ runner: RunnerOption,
760
+ ) -> RunnerType:
761
+ if runner != "auto":
762
+ return runner
763
+
764
+ runner_type = self._get_default_runner_type(architectures)
765
+
766
+ # Don't log the most common case
767
+ if runner_type != "generate":
768
+ logger.info(
769
+ "Resolved `--runner auto` to `--runner %s`. "
770
+ "Pass the value explicitly to silence this message.",
771
+ runner_type,
772
+ )
773
+
774
+ return runner_type
775
+
776
+ def _get_default_convert_type(
777
+ self,
778
+ architectures: list[str],
779
+ runner_type: RunnerType,
780
+ ) -> ConvertType:
781
+ registry = self.registry
782
+
783
+ for arch in architectures:
784
+ if arch in registry.get_supported_archs():
785
+ if runner_type == "generate" and registry.is_text_generation_model(
786
+ architectures, self
787
+ ):
788
+ return "none"
789
+ if runner_type == "pooling" and registry.is_pooling_model(
790
+ architectures, self
791
+ ):
792
+ return "none"
793
+
794
+ match = try_match_architecture_defaults(arch, runner_type=runner_type)
795
+ if match:
796
+ _, (_, convert_type) = match
797
+ return convert_type
798
+
799
+ # This is to handle Sentence Transformers models that use *ForCausalLM
800
+ # and also multi-modal pooling models which are not defined as
801
+ # Sentence Transformers models
802
+ if runner_type == "pooling":
803
+ return "embed"
804
+
805
+ return "none"
806
+
807
+ def _get_convert_type(
808
+ self,
809
+ architectures: list[str],
810
+ runner_type: RunnerType,
811
+ convert: ConvertOption,
812
+ ) -> ConvertType:
813
+ if convert == "reward":
814
+ logger.warning(
815
+ "`--convert reward` is deprecated and will be removed in v0.15. "
816
+ "Please use `--convert embed` instead."
817
+ )
818
+ return "embed"
819
+
820
+ if convert != "auto":
821
+ return convert
822
+
823
+ convert_type = self._get_default_convert_type(architectures, runner_type)
824
+
825
+ # Don't log the most common case
826
+ if convert_type != "none":
827
+ logger.info(
828
+ "Resolved `--convert auto` to `--convert %s`. "
829
+ "Pass the value explicitly to silence this message.",
830
+ convert_type,
831
+ )
832
+
833
+ return convert_type
834
+
835
+ def _parse_quant_hf_config(self, hf_config: PretrainedConfig):
836
+ quant_cfg = getattr(hf_config, "quantization_config", None)
837
+ if quant_cfg is None:
838
+ # compressed-tensors uses a "compression_config" key
839
+ quant_cfg = getattr(hf_config, "compression_config", None)
840
+
841
+ else:
842
+ # Set quant_method for ModelOpt models.
843
+ producer_name = quant_cfg.get("producer", {}).get("name")
844
+ if producer_name == "modelopt":
845
+ quant_algo = quant_cfg.get("quantization", {}).get("quant_algo")
846
+ if quant_algo == "FP8":
847
+ quant_cfg["quant_method"] = "modelopt"
848
+ elif quant_algo == "NVFP4":
849
+ quant_cfg["quant_method"] = "modelopt_fp4"
850
+ elif quant_algo is not None:
851
+ raise ValueError(f"Unknown ModelOpt quant algo: {quant_algo}")
852
+
853
+ return quant_cfg
854
+
855
+ def _verify_quantization(self) -> None:
856
+ supported_quantization = me_quant.QUANTIZATION_METHODS
857
+ if self.quantization is not None:
858
+ self.quantization = cast(me_quant.QuantizationMethods, self.quantization)
859
+
860
+ # Parse quantization method from the HF model config, if available.
861
+ quant_cfg = self._parse_quant_hf_config(self.hf_config)
862
+ if quant_cfg is None and (
863
+ text_config := getattr(self.hf_config, "text_config", None)
864
+ ):
865
+ # Check the text config as well for multi-modal models.
866
+ quant_cfg = self._parse_quant_hf_config(text_config)
867
+
868
+ if quant_cfg is not None:
869
+ # Use the community standard 'quant_method'
870
+ quant_method = quant_cfg.get("quant_method", "").lower()
871
+
872
+ # Normalize library names
873
+ quant_method = quant_method.replace(
874
+ "compressed_tensors", "compressed-tensors"
875
+ )
876
+
877
+ quant_cfg["quant_method"] = quant_method
878
+
879
+ # Quantization methods which are overrides (i.e. they have a
880
+ # `override_quantization_method` method) must be checked in order
881
+ # of preference (this is particularly important for GPTQ).
882
+ overrides = [
883
+ "bitblas",
884
+ "gptq_marlin_24",
885
+ "gptq_marlin",
886
+ "gptq_bitblas",
887
+ "awq_marlin",
888
+ "ipex",
889
+ "moe_wna16",
890
+ "modelopt",
891
+ "modelopt_fp4",
892
+ "petit_nvfp4",
893
+ # Ensure heavy backends are probed last to avoid unnecessary
894
+ # imports during override detection (e.g., MXFP4 imports Triton)
895
+ "mxfp4",
896
+ "cpu_gptq",
897
+ "cpu_awq",
898
+ ]
899
+ quantization_methods = [
900
+ q for q in supported_quantization if q not in overrides
901
+ ]
902
+ # Any custom overrides will be in quantization_methods so we place
903
+ # them at the start of the list so custom overrides have preference
904
+ # over the built-in ones.
905
+ quantization_methods = quantization_methods + overrides
906
+
907
+ # Detect which checkpoint is it
908
+ for name in quantization_methods:
909
+ method = me_quant.get_quantization_config(name)
910
+ quantization_override = method.override_quantization_method(
911
+ quant_cfg, self.quantization
912
+ )
913
+ if quantization_override is not None:
914
+ # Raise error if the override is not custom (custom would
915
+ # be in QUANTIZATION_METHODS but not QuantizationMethods)
916
+ # and hasn't been added to the overrides list.
917
+ if (
918
+ name in get_args(me_quant.QuantizationMethods)
919
+ and name not in overrides
920
+ ):
921
+ raise ValueError(
922
+ f"Quantization method {name} is an override but "
923
+ "is has not been added to the `overrides` list "
924
+ "above. This is necessary to ensure that the "
925
+ "overrides are checked in order of preference."
926
+ )
927
+ quant_method = quantization_override
928
+ self.quantization = quantization_override
929
+ break
930
+
931
+ quant_method = quant_method if quant_method != "" else None
932
+ # Verify quantization configurations.
933
+ if self.quantization is None:
934
+ self.quantization = quant_method
935
+ elif self.quantization != quant_method:
936
+ raise ValueError(
937
+ "Quantization method specified in the model config "
938
+ f"({quant_method}) does not match the quantization "
939
+ f"method specified in the `quantization` argument "
940
+ f"({self.quantization})."
941
+ )
942
+
943
+ if self.quantization is not None:
944
+ if self.quantization not in supported_quantization:
945
+ raise ValueError(
946
+ f"Unknown quantization method: {self.quantization}. Must "
947
+ f"be one of {supported_quantization}."
948
+ )
949
+ from vllm.platforms import current_platform
950
+
951
+ current_platform.verify_quantization(self.quantization)
952
+
953
+ def _verify_cuda_graph(self) -> None:
954
+ # CUDAGraph capture not supported for encoder-decoder models on ROCm
955
+ unsupported_rocm = self.is_encoder_decoder
956
+ if unsupported_rocm and not self.enforce_eager and current_platform.is_rocm():
957
+ logger.warning(
958
+ "CUDA graph is not supported for %s on ROCm yet, fallback "
959
+ "to eager mode.",
960
+ self.hf_config.model_type,
961
+ )
962
+ self.enforce_eager = True
963
+
964
+ def _verify_bnb_config(self) -> None:
965
+ """
966
+ The current version of bitsandbytes (0.46.1) with 8-bit models does not
967
+ yet support CUDA graph.
968
+ # TODO Remove this when bitsandbytes supports.
969
+ """
970
+ is_bitsandbytes = self.quantization == "bitsandbytes"
971
+ has_quantization_config = (
972
+ getattr(self.hf_config, "quantization_config", None) is not None
973
+ )
974
+ is_8bit = (
975
+ self.hf_config.quantization_config.get("load_in_8bit", False)
976
+ if has_quantization_config
977
+ else False
978
+ )
979
+ if all(
980
+ [
981
+ is_bitsandbytes,
982
+ has_quantization_config,
983
+ is_8bit,
984
+ not self.enforce_eager,
985
+ ]
986
+ ):
987
+ logger.warning(
988
+ "CUDA graph is not supported on BitsAndBytes 8bit yet, "
989
+ "fallback to the eager mode."
990
+ )
991
+
992
+ self.enforce_eager = True
993
+
994
+ def _verify_with_expert_parallelism(self) -> None:
995
+ num_experts = self.get_num_experts()
996
+ if num_experts < 1:
997
+ raise ValueError(
998
+ "Number of experts in the model must be greater than 0 "
999
+ "when expert parallelism is enabled."
1000
+ )
1001
+
1002
+ def verify_dual_chunk_attention_config(
1003
+ self,
1004
+ load_config: LoadConfig,
1005
+ ) -> None:
1006
+ if hasattr(self.hf_config, "dual_chunk_attention_config"):
1007
+ # Try loading the sparse attention config
1008
+ from vllm.model_executor.model_loader.weight_utils import (
1009
+ get_sparse_attention_config,
1010
+ )
1011
+
1012
+ sparse_attn_config = get_sparse_attention_config(self, load_config)
1013
+ if sparse_attn_config:
1014
+ self.hf_config.dual_chunk_attention_config[
1015
+ "sparse_attention_config"
1016
+ ] = sparse_attn_config
1017
+ if (
1018
+ "sparse_attention_enabled"
1019
+ not in self.hf_config.dual_chunk_attention_config
1020
+ ):
1021
+ self.hf_config.dual_chunk_attention_config[
1022
+ "sparse_attention_enabled"
1023
+ ] = True
1024
+
1025
+ def verify_with_parallel_config(
1026
+ self,
1027
+ parallel_config: ParallelConfig,
1028
+ ) -> None:
1029
+ total_num_attention_heads = getattr(
1030
+ self.hf_text_config, "num_attention_heads", 0
1031
+ )
1032
+ tensor_parallel_size = parallel_config.tensor_parallel_size
1033
+ if total_num_attention_heads % tensor_parallel_size != 0:
1034
+ raise ValueError(
1035
+ f"Total number of attention heads ({total_num_attention_heads})"
1036
+ " must be divisible by tensor parallel size "
1037
+ f"({tensor_parallel_size})."
1038
+ )
1039
+
1040
+ if parallel_config.enable_expert_parallel:
1041
+ self._verify_with_expert_parallelism()
1042
+
1043
+ pipeline_parallel_size = parallel_config.pipeline_parallel_size
1044
+ if pipeline_parallel_size > 1 and not self.registry.is_pp_supported_model(
1045
+ self.architectures, self
1046
+ ):
1047
+ raise NotImplementedError(
1048
+ "Pipeline parallelism is not supported for this model. "
1049
+ "Supported models implement the `SupportsPP` interface."
1050
+ )
1051
+
1052
+ decode_context_parallel_size = parallel_config.decode_context_parallel_size
1053
+ if decode_context_parallel_size > 1 and not self.use_mla:
1054
+ total_num_kv_heads = self.get_total_num_kv_heads()
1055
+ assert tensor_parallel_size > total_num_kv_heads, (
1056
+ f"tensor parallel size {tensor_parallel_size} must be greater "
1057
+ f"than total num kv heads {total_num_kv_heads} when enable "
1058
+ f"decode context parallel for GQA/MQA"
1059
+ )
1060
+
1061
+ max_dcp_size = tensor_parallel_size // total_num_kv_heads
1062
+ assert decode_context_parallel_size <= max_dcp_size, (
1063
+ f"decode context parallel size must less than or equal to "
1064
+ f"(tensor parallel size {tensor_parallel_size} // total "
1065
+ f"num kv heads {total_num_kv_heads}) = {max_dcp_size}, "
1066
+ f"but got {decode_context_parallel_size}"
1067
+ )
1068
+
1069
+ num_q_per_kv = total_num_attention_heads // total_num_kv_heads
1070
+ assert num_q_per_kv % decode_context_parallel_size == 0, (
1071
+ f"Total number of q per kv attn heads ({num_q_per_kv})"
1072
+ " must be divisible by dcp world size when enable "
1073
+ "decode context parallel for GQA "
1074
+ f"({parallel_config.decode_context_parallel_size})."
1075
+ )
1076
+
1077
+ def get_sliding_window(self) -> int | None:
1078
+ """Get the sliding window size from the HF text config if present."""
1079
+ return getattr(self.hf_text_config, "sliding_window", None)
1080
+
1081
+ def get_vocab_size(self) -> int:
1082
+ return getattr(self.hf_text_config, "vocab_size", 0)
1083
+
1084
+ def get_hidden_size(self) -> int:
1085
+ return getattr(self.hf_text_config, "hidden_size", 0)
1086
+
1087
+ def get_inputs_embeds_size(self) -> int:
1088
+ # The size of inputs_embeds is usually identical to the size
1089
+ # of the hidden states, however there are exceptions, such as
1090
+ # embedding models like CLIP and SigLIP
1091
+ for target_attr in ("projection_dim", "projection_size"):
1092
+ if hasattr(self.hf_text_config, target_attr):
1093
+ return getattr(self.hf_text_config, target_attr)
1094
+
1095
+ return self.get_hidden_size()
1096
+
1097
+ @property
1098
+ def is_deepseek_mla(self) -> bool:
1099
+ if not hasattr(self.hf_text_config, "model_type"):
1100
+ return False
1101
+ elif self.hf_text_config.model_type in (
1102
+ "deepseek_v2",
1103
+ "deepseek_v3",
1104
+ "deepseek_v32",
1105
+ "deepseek_mtp",
1106
+ "kimi_k2",
1107
+ "kimi_linear",
1108
+ "longcat_flash",
1109
+ "pangu_ultra_moe",
1110
+ "pangu_ultra_moe_mtp",
1111
+ ):
1112
+ return self.hf_text_config.kv_lora_rank is not None
1113
+ elif self.hf_text_config.model_type == "eagle":
1114
+ # if the model is an EAGLE module, check for the
1115
+ # underlying architecture
1116
+ return (
1117
+ self.hf_text_config.model.model_type
1118
+ in ("deepseek_v2", "deepseek_v3", "deepseek_v32")
1119
+ and self.hf_text_config.kv_lora_rank is not None
1120
+ )
1121
+ return False
1122
+
1123
+ @cached_property
1124
+ def is_mm_prefix_lm(self) -> bool:
1125
+ """Whether to use bidirectional attention for mm positions."""
1126
+ MM_PREFIX_LM_MODELS = (
1127
+ "gemma3",
1128
+ # TODO(Isotr0py): Disable paligemma for now before
1129
+ # we supports soft cap attention for FlexAttention
1130
+ # "paligemma",
1131
+ )
1132
+ if not hasattr(self.hf_config, "model_type"):
1133
+ return False
1134
+ return self.hf_config.model_type in MM_PREFIX_LM_MODELS
1135
+
1136
+ def get_head_size(self) -> int:
1137
+ # TODO remove hard code
1138
+ if self.is_deepseek_mla:
1139
+ qk_rope_head_dim = getattr(self.hf_text_config, "qk_rope_head_dim", 0)
1140
+ if self.use_mla:
1141
+ return self.hf_text_config.kv_lora_rank + qk_rope_head_dim
1142
+ else:
1143
+ qk_nope_head_dim = getattr(self.hf_text_config, "qk_nope_head_dim", 0)
1144
+ if qk_rope_head_dim and qk_nope_head_dim:
1145
+ return qk_rope_head_dim + qk_nope_head_dim
1146
+
1147
+ if hasattr(self.hf_text_config, "model_type") and (
1148
+ self.hf_text_config.model_type == "zamba2"
1149
+ ):
1150
+ return self.hf_text_config.attention_head_dim
1151
+
1152
+ if self.is_attention_free:
1153
+ return 0
1154
+
1155
+ # NOTE: Some configs may set head_dim=None in the config
1156
+ if getattr(self.hf_text_config, "head_dim", None) is not None:
1157
+ return self.hf_text_config.head_dim
1158
+
1159
+ # NOTE: Some models (such as PLaMo2.1) use `hidden_size_per_head`
1160
+ if getattr(self.hf_text_config, "hidden_size_per_head", None) is not None:
1161
+ return self.hf_text_config.hidden_size_per_head
1162
+
1163
+ # FIXME(woosuk): This may not be true for all models.
1164
+ return (
1165
+ self.hf_text_config.hidden_size // self.hf_text_config.num_attention_heads
1166
+ )
1167
+
1168
+ def get_total_num_kv_heads(self) -> int:
1169
+ """Returns the total number of KV heads."""
1170
+ # For GPTBigCode & Falcon:
1171
+ # NOTE: for falcon, when new_decoder_architecture is True, the
1172
+ # multi_query flag is ignored and we use n_head_kv for the number of
1173
+ # KV heads.
1174
+ falcon_model_types = ["falcon", "RefinedWeb", "RefinedWebModel"]
1175
+ new_decoder_arch_falcon = (
1176
+ self.hf_config.model_type in falcon_model_types
1177
+ and getattr(self.hf_config, "new_decoder_architecture", False)
1178
+ )
1179
+ if not new_decoder_arch_falcon and getattr(
1180
+ self.hf_text_config, "multi_query", False
1181
+ ):
1182
+ # Multi-query attention, only one KV head.
1183
+ # Currently, tensor parallelism is not supported in this case.
1184
+ return 1
1185
+
1186
+ # For DBRX and MPT
1187
+ if self.hf_config.model_type == "mpt":
1188
+ if "kv_n_heads" in self.hf_config.attn_config:
1189
+ return self.hf_config.attn_config["kv_n_heads"]
1190
+ return self.hf_config.num_attention_heads
1191
+ if self.hf_config.model_type == "dbrx":
1192
+ return getattr(
1193
+ self.hf_config.attn_config,
1194
+ "kv_n_heads",
1195
+ self.hf_config.num_attention_heads,
1196
+ )
1197
+
1198
+ if self.hf_config.model_type == "nemotron-nas":
1199
+ for block in self.hf_config.block_configs:
1200
+ if not block.attention.no_op:
1201
+ return (
1202
+ self.hf_config.num_attention_heads
1203
+ // block.attention.n_heads_in_group
1204
+ )
1205
+
1206
+ raise RuntimeError(
1207
+ "Could not determine the number of key-value attention heads "
1208
+ "from model configuration. "
1209
+ f"Model: {self.model}, Architecture: {self.architectures}. "
1210
+ "This usually indicates an unsupported model architecture or "
1211
+ "missing configuration. "
1212
+ "Please check if your model is supported at: "
1213
+ "https://docs.vllm.ai/en/latest/models/supported_models.html"
1214
+ )
1215
+
1216
+ if self.is_attention_free:
1217
+ return 0
1218
+
1219
+ attributes = [
1220
+ # For Falcon:
1221
+ "n_head_kv",
1222
+ "num_kv_heads",
1223
+ # For LLaMA-2:
1224
+ "num_key_value_heads",
1225
+ # For ChatGLM:
1226
+ "multi_query_group_num",
1227
+ ]
1228
+ for attr in attributes:
1229
+ num_kv_heads = getattr(self.hf_text_config, attr, None)
1230
+ if num_kv_heads is not None:
1231
+ return num_kv_heads
1232
+
1233
+ # For non-grouped-query attention models, the number of KV heads is
1234
+ # equal to the number of attention heads.
1235
+ return self.hf_text_config.num_attention_heads
1236
+
1237
+ def get_num_kv_heads(self, parallel_config: ParallelConfig) -> int:
1238
+ """Returns the number of KV heads per GPU."""
1239
+ if self.use_mla:
1240
+ # When using MLA during decode it becomes MQA
1241
+ return 1
1242
+
1243
+ total_num_kv_heads = self.get_total_num_kv_heads()
1244
+ # If tensor parallelism is used, we divide the number of KV heads by
1245
+ # the tensor parallel size. We will replicate the KV heads in the
1246
+ # case where the number of KV heads is smaller than the tensor
1247
+ # parallel size so each GPU has at least one KV head.
1248
+ return max(1, total_num_kv_heads // parallel_config.tensor_parallel_size)
1249
+
1250
+ def get_num_attention_heads(self, parallel_config: ParallelConfig) -> int:
1251
+ num_heads = getattr(self.hf_text_config, "num_attention_heads", 0)
1252
+ return num_heads // parallel_config.tensor_parallel_size
1253
+
1254
+ def get_num_experts(self) -> int:
1255
+ """Returns the number of experts in the model."""
1256
+ num_expert_names = [
1257
+ "num_experts", # Jamba
1258
+ "moe_num_experts", # Dbrx
1259
+ "n_routed_experts", # DeepSeek
1260
+ "num_local_experts", # Mixtral
1261
+ ]
1262
+ num_experts = getattr_iter(self.hf_text_config, num_expert_names, 0)
1263
+ if isinstance(num_experts, list):
1264
+ # Ernie VL's remote code uses list[int]...
1265
+ # The values are always the same so we just take the first one.
1266
+ return num_experts[0]
1267
+ # Coerce to 0 if explicitly set to None
1268
+ return num_experts or 0
1269
+
1270
+ def get_total_num_hidden_layers(self) -> int:
1271
+ if (
1272
+ self.hf_text_config.model_type == "deepseek_mtp"
1273
+ or self.hf_config.model_type == "mimo_mtp"
1274
+ or self.hf_config.model_type == "glm4_moe_mtp"
1275
+ or self.hf_config.model_type == "ernie_mtp"
1276
+ or self.hf_config.model_type == "qwen3_next_mtp"
1277
+ or self.hf_config.model_type == "pangu_ultra_moe_mtp"
1278
+ ):
1279
+ total_num_hidden_layers = getattr(
1280
+ self.hf_text_config, "num_nextn_predict_layers", 0
1281
+ )
1282
+ elif self.hf_config.model_type == "longcat_flash_mtp":
1283
+ total_num_hidden_layers = getattr(
1284
+ self.hf_text_config, "num_nextn_predict_layers", 1
1285
+ )
1286
+ else:
1287
+ total_num_hidden_layers = getattr(
1288
+ self.hf_text_config, "num_hidden_layers", 0
1289
+ )
1290
+ return total_num_hidden_layers
1291
+
1292
+ def get_layers_start_end_indices(
1293
+ self, parallel_config: ParallelConfig
1294
+ ) -> tuple[int, int]:
1295
+ from vllm.distributed.utils import get_pp_indices
1296
+
1297
+ total_num_hidden_layers = self.get_total_num_hidden_layers()
1298
+
1299
+ # the layout order is: DP x PP x TP
1300
+ pp_rank = (
1301
+ parallel_config.rank // parallel_config.tensor_parallel_size
1302
+ ) % parallel_config.pipeline_parallel_size
1303
+ pp_size = parallel_config.pipeline_parallel_size
1304
+ start, end = get_pp_indices(total_num_hidden_layers, pp_rank, pp_size)
1305
+ return start, end
1306
+
1307
+ def get_num_layers(self, parallel_config: ParallelConfig) -> int:
1308
+ start, end = self.get_layers_start_end_indices(parallel_config)
1309
+ return end - start
1310
+
1311
+ def get_num_layers_by_block_type(
1312
+ self,
1313
+ parallel_config: ParallelConfig,
1314
+ block_type: LayerBlockType = "attention",
1315
+ ) -> int:
1316
+ # This function relies on 'layers_block_type' in hf_config,
1317
+ # for w/o this attribute, we will need to have workarounds like so
1318
+ attn_block_type = block_type == "attention"
1319
+ is_transformer = (
1320
+ not self.is_hybrid and not self.has_noops and not self.is_attention_free
1321
+ )
1322
+ start, end = self.get_layers_start_end_indices(parallel_config)
1323
+
1324
+ if is_transformer:
1325
+ # Handle the basic case first
1326
+ return end - start if attn_block_type else 0
1327
+ elif self.is_attention_free:
1328
+ # Attention free
1329
+ # Note that this code assumes there
1330
+ # is only one type of attention-free block type.
1331
+ return 0 if attn_block_type else end - start
1332
+ elif self.has_noops:
1333
+ block_configs = self.hf_config.block_configs
1334
+ return sum(not bc.attention.no_op for bc in block_configs[start:end])
1335
+ else:
1336
+ # Hybrid model Jamba
1337
+ layers_block_type_value = getattr(
1338
+ self.hf_text_config, "layers_block_type", None
1339
+ )
1340
+ if layers_block_type_value is not None:
1341
+ if hasattr(self.hf_text_config, "model_type") and (
1342
+ self.hf_text_config.model_type == "zamba2"
1343
+ ):
1344
+ if attn_block_type:
1345
+ return sum(
1346
+ t == "hybrid" for t in layers_block_type_value[start:end]
1347
+ )
1348
+ else:
1349
+ return self.get_num_layers(parallel_config)
1350
+ return sum(t == block_type for t in layers_block_type_value[start:end])
1351
+
1352
+ # Hybrid model Minimax
1353
+ attn_type_list = getattr(self.hf_config, "attn_type_list", None)
1354
+ if attn_type_list:
1355
+ return sum(t == 1 for t in attn_type_list[start:end])
1356
+
1357
+ # Hybrid model Qwen3Next
1358
+ layer_types_value = getattr(self.hf_config, "layer_types", None)
1359
+ if layer_types_value is not None:
1360
+ if block_type == "attention":
1361
+ return sum(
1362
+ t == "full_attention" for t in layer_types_value[start:end]
1363
+ )
1364
+ elif block_type == "linear_attention":
1365
+ return sum(
1366
+ t == "linear_attention" for t in layer_types_value[start:end]
1367
+ )
1368
+ else:
1369
+ return sum(t == block_type for t in layer_types_value[start:end])
1370
+
1371
+ if (
1372
+ layers_block_type_value is None
1373
+ and attn_type_list is None
1374
+ and layer_types_value is None
1375
+ ):
1376
+ raise ValueError(
1377
+ "The model is an hybrid without a layers_block_type or an "
1378
+ "attn_type_list, or a layer_types in the hf_config, "
1379
+ f"cannot determine the num of {block_type} layers"
1380
+ )
1381
+
1382
+ def get_mamba_chunk_size(self) -> int | None:
1383
+ """
1384
+ Returns the mamba chunk size if it exists
1385
+ """
1386
+ # used by e.g. Bamba, FalconH1, Granite, PLaMo2
1387
+ chunk_size = getattr(self.hf_text_config, "mamba_chunk_size", None)
1388
+ if chunk_size is None:
1389
+ # used by e.g. Mamba2, NemotronH, Zamba
1390
+ chunk_size = getattr(self.hf_text_config, "chunk_size", None)
1391
+
1392
+ # Since Mamba1 does not have a chunk notion
1393
+ # we use a default chunk size of 1024.
1394
+ if chunk_size is None:
1395
+ chunk_size = 2048
1396
+
1397
+ return chunk_size
1398
+
1399
+ def get_multimodal_config(self) -> MultiModalConfig:
1400
+ """
1401
+ Get the multimodal configuration of the model.
1402
+
1403
+ Raises:
1404
+ ValueError: If the model is not multimodal.
1405
+ """
1406
+ if self.multimodal_config is None:
1407
+ raise ValueError("The model is not multimodal.")
1408
+
1409
+ return self.multimodal_config
1410
+
1411
+ def try_get_generation_config(self) -> dict[str, Any]:
1412
+ """
1413
+ This method attempts to retrieve the non-default values of the
1414
+ generation config for this model.
1415
+
1416
+ The generation config can contain information about special tokens, as
1417
+ well as sampling parameters. Which is why this method exists separately
1418
+ to `get_diff_sampling_param`.
1419
+
1420
+ Returns:
1421
+ A dictionary containing the non-default generation config.
1422
+ """
1423
+ if self.generation_config in {"auto", "vllm"}:
1424
+ config = try_get_generation_config(
1425
+ self.hf_config_path or self.model,
1426
+ trust_remote_code=self.trust_remote_code,
1427
+ revision=self.revision,
1428
+ config_format=self.config_format,
1429
+ )
1430
+ else:
1431
+ config = try_get_generation_config(
1432
+ self.generation_config,
1433
+ trust_remote_code=self.trust_remote_code,
1434
+ config_format=self.config_format,
1435
+ )
1436
+
1437
+ if config is None:
1438
+ return {}
1439
+
1440
+ return config.to_diff_dict()
1441
+
1442
+ def get_diff_sampling_param(self) -> dict[str, Any]:
1443
+ """
1444
+ This method returns a dictionary containing the non-default sampling
1445
+ parameters with `override_generation_config` applied.
1446
+
1447
+ The default sampling parameters are:
1448
+
1449
+ - vLLM's neutral defaults if `self.generation_config="vllm"`
1450
+ - the model's defaults if `self.generation_config="auto"`
1451
+ - as defined in `generation_config.json` if
1452
+ `self.generation_config="path/to/generation_config/dir"`
1453
+
1454
+ Returns:
1455
+ A dictionary containing the non-default sampling parameters.
1456
+ """
1457
+ if self.generation_config == "vllm":
1458
+ config = {}
1459
+ else:
1460
+ config = self.try_get_generation_config()
1461
+
1462
+ # Overriding with given generation config
1463
+ config.update(self.override_generation_config)
1464
+
1465
+ available_params = [
1466
+ "repetition_penalty",
1467
+ "temperature",
1468
+ "top_k",
1469
+ "top_p",
1470
+ "min_p",
1471
+ "max_new_tokens",
1472
+ ]
1473
+ if any(p in config for p in available_params):
1474
+ diff_sampling_param = {
1475
+ p: config.get(p) for p in available_params if config.get(p) is not None
1476
+ }
1477
+ # Huggingface definition of max_new_tokens is equivalent
1478
+ # to vLLM's max_tokens
1479
+ if "max_new_tokens" in diff_sampling_param:
1480
+ diff_sampling_param["max_tokens"] = diff_sampling_param.pop(
1481
+ "max_new_tokens"
1482
+ )
1483
+ else:
1484
+ diff_sampling_param = {}
1485
+
1486
+ if diff_sampling_param:
1487
+ logger.warning_once(
1488
+ "Default sampling parameters have been overridden by the "
1489
+ "model's Hugging Face generation config recommended from the "
1490
+ "model creator. If this is not intended, please relaunch "
1491
+ "vLLM instance with `--generation-config vllm`."
1492
+ )
1493
+ return diff_sampling_param
1494
+
1495
+ @property
1496
+ def is_encoder_decoder(self) -> bool:
1497
+ """Extract the HF encoder/decoder model flag."""
1498
+ return is_encoder_decoder(self.hf_config)
1499
+
1500
+ @property
1501
+ def uses_alibi(self) -> bool:
1502
+ cfg = self.hf_text_config
1503
+
1504
+ return (
1505
+ getattr(cfg, "alibi", False) # Falcon
1506
+ or "BloomForCausalLM" in self.architectures # Bloom
1507
+ or getattr(cfg, "position_encoding_type", "") == "alibi" # codellm_1b_alibi
1508
+ or (
1509
+ hasattr(cfg, "attn_config") # MPT
1510
+ and (
1511
+ (
1512
+ isinstance(cfg.attn_config, dict)
1513
+ and cfg.attn_config.get("alibi", False)
1514
+ )
1515
+ or (
1516
+ not isinstance(cfg.attn_config, dict)
1517
+ and getattr(cfg.attn_config, "alibi", False)
1518
+ )
1519
+ )
1520
+ )
1521
+ )
1522
+
1523
+ @property
1524
+ def uses_mrope(self) -> bool:
1525
+ return uses_mrope(self.hf_config)
1526
+
1527
+ @property
1528
+ def uses_xdrope_dim(self) -> int:
1529
+ return uses_xdrope_dim(self.hf_config)
1530
+
1531
+ @property
1532
+ def is_multimodal_model(self) -> bool:
1533
+ return self.multimodal_config is not None
1534
+
1535
+ @property
1536
+ def is_multimodal_raw_input_only_model(self) -> bool:
1537
+ return self._model_info.supports_multimodal_raw_input_only
1538
+
1539
+ @property
1540
+ def is_cross_encoder(self) -> bool:
1541
+ return (
1542
+ self._model_info.supports_cross_encoding or self.convert_type == "classify"
1543
+ )
1544
+
1545
+ @property
1546
+ def is_pp_supported(self) -> bool:
1547
+ return self._model_info.supports_pp
1548
+
1549
+ @property
1550
+ def is_attention_free(self) -> bool:
1551
+ return self._model_info.is_attention_free
1552
+
1553
+ @property
1554
+ def is_hybrid(self) -> bool:
1555
+ # Handle granite-4.0-micro case which uses hybrid config but does not
1556
+ # actually contain any non-attention layers.
1557
+ layer_types = getattr(self.hf_config, "layer_types", None)
1558
+ if layer_types is not None and all(
1559
+ layer == "attention" for layer in layer_types
1560
+ ):
1561
+ return False
1562
+ return self._model_info.is_hybrid
1563
+
1564
+ @property
1565
+ def has_noops(self) -> bool:
1566
+ return self._model_info.has_noops
1567
+
1568
+ @property
1569
+ def has_inner_state(self):
1570
+ return self._model_info.has_inner_state
1571
+
1572
+ @property
1573
+ def supports_mamba_prefix_caching(self) -> bool:
1574
+ return self._model_info.supports_mamba_prefix_caching
1575
+
1576
+ @property
1577
+ def use_mla(self) -> bool:
1578
+ return self.is_deepseek_mla and not envs.VLLM_MLA_DISABLE
1579
+
1580
+ @property
1581
+ def is_matryoshka(self) -> bool:
1582
+ return bool(getattr(self.hf_config, "matryoshka_dimensions", None)) or getattr(
1583
+ self.hf_config, "is_matryoshka", False
1584
+ )
1585
+
1586
+ @property
1587
+ def matryoshka_dimensions(self):
1588
+ return getattr(self.hf_config, "matryoshka_dimensions", None)
1589
+
1590
+ @property
1591
+ def use_pad_token(self) -> bool:
1592
+ # cross_encoder models defaults to using pad_token.
1593
+ # `llm as reranker` models defaults to not using pad_token.
1594
+ return getattr(self.hf_config, "use_pad_token", True)
1595
+
1596
+ @property
1597
+ def head_dtype(self) -> torch.dtype:
1598
+ """
1599
+ "head" refers to the last Linear layer(s) of an LLM,
1600
+ such as the lm_head in a generation model,
1601
+ or the score or classifier in a classification model.
1602
+
1603
+ `head_dtype` currently only supports pooling models.\n
1604
+ - The pooling model defaults to using fp32 head,
1605
+ you can use --hf-overrides '{"head_dtype": "model"}' to disable it.
1606
+ """
1607
+
1608
+ head_dtype = _get_head_dtype(
1609
+ config=self.hf_config, dtype=self.dtype, runner_type=self.runner_type
1610
+ )
1611
+
1612
+ if self.runner_type != "pooling" and head_dtype != self.dtype:
1613
+ logger.warning_once(
1614
+ "`head_dtype` currently only supports pooling models."
1615
+ "fallback to model dtype [%s].",
1616
+ self.dtype,
1617
+ )
1618
+ return self.dtype
1619
+
1620
+ if head_dtype not in current_platform.supported_dtypes:
1621
+ logger.warning_once(
1622
+ "The current platform does not support [%s] head dtype, "
1623
+ "fallback to model dtype [%s].",
1624
+ head_dtype,
1625
+ self.dtype,
1626
+ )
1627
+ return self.dtype
1628
+
1629
+ logger.debug_once("head dtype: %s", head_dtype)
1630
+ return head_dtype
1631
+
1632
+ @property
1633
+ def embedding_size(self):
1634
+ dense_modules = try_get_dense_modules(self.model, revision=self.revision)
1635
+ if dense_modules is not None:
1636
+ return dense_modules[-1]["out_features"]
1637
+ return self.get_hidden_size()
1638
+
1639
+ def get_and_verify_max_len(self, max_model_len: int):
1640
+ # Consider max_model_len in tokenizer_config only when
1641
+ # pooling models use absolute position_embedding.
1642
+ tokenizer_config = None
1643
+ if (
1644
+ self.runner_type == "pooling"
1645
+ and getattr(self.hf_config, "position_embedding_type", "") == "absolute"
1646
+ ):
1647
+ tokenizer_config = try_get_tokenizer_config(
1648
+ self.tokenizer,
1649
+ trust_remote_code=self.trust_remote_code,
1650
+ revision=self.tokenizer_revision,
1651
+ )
1652
+ max_model_len = _get_and_verify_max_len(
1653
+ hf_config=self.hf_text_config,
1654
+ tokenizer_config=tokenizer_config,
1655
+ max_model_len=max_model_len,
1656
+ disable_sliding_window=self.disable_sliding_window,
1657
+ sliding_window=self.get_sliding_window(),
1658
+ spec_target_max_model_len=self.spec_target_max_model_len,
1659
+ encoder_config=self.encoder_config,
1660
+ )
1661
+ logger.info("Using max model len %s", max_model_len)
1662
+ return max_model_len
1663
+
1664
+ @property
1665
+ def attn_type(self) -> AttnTypeStr:
1666
+ if self.pooler_config is not None:
1667
+ pooling_type = self._model_info.default_pooling_type.lower()
1668
+ if pooling_type == "cls":
1669
+ return "encoder_only"
1670
+ else:
1671
+ is_causal = getattr(self.hf_config, "is_causal", True)
1672
+ return "encoder_only" if not is_causal else self._model_info.attn_type
1673
+ elif self.is_hybrid:
1674
+ return "hybrid"
1675
+ elif self.is_attention_free:
1676
+ return "attention_free"
1677
+ elif self.is_encoder_decoder:
1678
+ return "encoder_decoder"
1679
+ else:
1680
+ return "decoder"
1681
+
1682
+ @property
1683
+ def is_chunked_prefill_supported(self) -> bool:
1684
+ attn_type = self.attn_type
1685
+ if self.pooler_config is not None:
1686
+ # for pooling models
1687
+ if attn_type == "encoder_only":
1688
+ logger.debug(
1689
+ "Pooling models with bidirectional attn does not support "
1690
+ "chunked prefill."
1691
+ )
1692
+ return False
1693
+ elif attn_type == "decoder":
1694
+ pooling_type = self.pooler_config.pooling_type.lower()
1695
+ if pooling_type in ["mean", "step", "cls"]:
1696
+ logger.debug(
1697
+ "Pooling models with %s pooling does not "
1698
+ "support chunked prefill.",
1699
+ pooling_type,
1700
+ )
1701
+ return False
1702
+ elif pooling_type in ["all", "last"]:
1703
+ logger.debug(
1704
+ "Pooling models with causal attn and %s pooling support "
1705
+ "chunked prefill.",
1706
+ pooling_type,
1707
+ )
1708
+ return True
1709
+ else:
1710
+ raise ValueError(f"{pooling_type=} not supported.")
1711
+ # vllm currently does not have pooling models using hybrid,
1712
+ # attention_free or encoder_decoder attn types.
1713
+ return attn_type != "encoder_decoder"
1714
+ else:
1715
+ if attn_type == "encoder_decoder":
1716
+ logger.debug("Encoder decoder models does not support chunked prefill.")
1717
+ return False
1718
+ logger.debug("Generative models support chunked prefill.")
1719
+ return True
1720
+
1721
+ @property
1722
+ def is_prefix_caching_supported(self) -> bool:
1723
+ attn_type = self.attn_type
1724
+ if self.pooler_config is not None:
1725
+ # for pooling models
1726
+ if attn_type == "encoder_only":
1727
+ logger.debug(
1728
+ "Pooling models with bidirectional attn does not "
1729
+ "support prefix caching."
1730
+ )
1731
+ return False
1732
+ elif attn_type == "decoder":
1733
+ pooling_type = self.pooler_config.pooling_type.lower()
1734
+ if pooling_type in ["mean", "step", "cls"]:
1735
+ logger.debug(
1736
+ "Pooling models with %s pooling does not "
1737
+ "support prefix caching.",
1738
+ pooling_type,
1739
+ )
1740
+ return False
1741
+ elif pooling_type in ["all", "last"]:
1742
+ logger.debug(
1743
+ "Pooling models with causal attn and %s pooling support "
1744
+ "prefix caching.",
1745
+ pooling_type,
1746
+ )
1747
+ return True
1748
+ else:
1749
+ raise ValueError(f"{pooling_type=} not supported.")
1750
+ # vllm currently does not have pooling models using hybrid,
1751
+ # attention_free or encoder_decoder attn types.
1752
+ return False
1753
+ else:
1754
+ if attn_type == "hybrid":
1755
+ logger.debug(
1756
+ "Hybrid models does not support prefix caching since the feature "
1757
+ "is still experimental."
1758
+ )
1759
+ return False
1760
+ elif attn_type == "attention_free":
1761
+ logger.debug(
1762
+ "Attention free models does not support prefix caching since the "
1763
+ "feature is still experimental."
1764
+ )
1765
+ return False
1766
+ elif attn_type == "encoder_decoder":
1767
+ logger.debug("Encoder decoder models does not support prefix caching.")
1768
+ return False
1769
+ else: # attn_type == "decoder"
1770
+ logger.debug("Generative models support prefix caching.")
1771
+ return True
1772
+
1773
+ def is_model_moe(
1774
+ self,
1775
+ ) -> bool:
1776
+ return self.get_num_experts() > 1
1777
+
1778
+ def is_quantized(self) -> bool:
1779
+ return getattr(self.hf_config, "quantization_config", None) is not None
1780
+
1781
+
1782
+ def get_served_model_name(model: str, served_model_name: str | list[str] | None):
1783
+ """
1784
+ If the input is a non-empty list, the first model_name in
1785
+ `served_model_name` is taken.
1786
+ If the input is a non-empty string, it is used directly.
1787
+ For cases where the input is either an empty string or an
1788
+ empty list, the fallback is to use `self.model`.
1789
+ """
1790
+ if not served_model_name:
1791
+ return model
1792
+ if isinstance(served_model_name, list):
1793
+ return served_model_name[0]
1794
+ return served_model_name
1795
+
1796
+
1797
+ # Some model suffixes are based on auto classes from Transformers:
1798
+ # https://huggingface.co/docs/transformers/en/model_doc/auto
1799
+ # NOTE: Items higher on this list priority over lower ones
1800
+ _SUFFIX_TO_DEFAULTS: list[tuple[str, tuple[RunnerType, ConvertType]]] = [
1801
+ ("ForCausalLM", ("generate", "none")),
1802
+ ("ForConditionalGeneration", ("generate", "none")),
1803
+ ("ChatModel", ("generate", "none")),
1804
+ ("LMHeadModel", ("generate", "none")),
1805
+ ("ForTextEncoding", ("pooling", "embed")),
1806
+ ("EmbeddingModel", ("pooling", "embed")),
1807
+ ("ForSequenceClassification", ("pooling", "classify")),
1808
+ ("ForTokenClassification", ("pooling", "classify")),
1809
+ ("ForAudioClassification", ("pooling", "classify")),
1810
+ ("ForImageClassification", ("pooling", "classify")),
1811
+ ("ForVideoClassification", ("pooling", "classify")),
1812
+ ("ClassificationModel", ("pooling", "classify")),
1813
+ ("ForRewardModeling", ("pooling", "embed")),
1814
+ ("RewardModel", ("pooling", "embed")),
1815
+ # Let other `*Model`s take priority
1816
+ ("Model", ("pooling", "embed")),
1817
+ ]
1818
+
1819
+
1820
+ def iter_architecture_defaults():
1821
+ yield from _SUFFIX_TO_DEFAULTS
1822
+
1823
+
1824
+ def try_match_architecture_defaults(
1825
+ architecture: str,
1826
+ *,
1827
+ runner_type: RunnerType | None = None,
1828
+ convert_type: ConvertType | None = None,
1829
+ ) -> tuple[str, tuple[RunnerType, ConvertType]] | None:
1830
+ for suffix, (
1831
+ default_runner_type,
1832
+ default_convert_type,
1833
+ ) in iter_architecture_defaults():
1834
+ if (
1835
+ (runner_type is None or runner_type == default_runner_type)
1836
+ and (convert_type is None or convert_type == default_convert_type)
1837
+ and architecture.endswith(suffix)
1838
+ ):
1839
+ return suffix, (default_runner_type, default_convert_type)
1840
+
1841
+ return None
1842
+
1843
+
1844
+ _STR_DTYPE_TO_TORCH_DTYPE = {
1845
+ "half": torch.float16,
1846
+ "float16": torch.float16,
1847
+ "float": torch.float32,
1848
+ "float32": torch.float32,
1849
+ "bfloat16": torch.bfloat16,
1850
+ }
1851
+
1852
+ # model_type -> reason
1853
+ _FLOAT16_NOT_SUPPORTED_MODELS = {
1854
+ "gemma2": "Numerical instability. Please use bfloat16 or float32 instead.",
1855
+ "gemma3": "Numerical instability. Please use bfloat16 or float32 instead.",
1856
+ "gemma3_text": "Numerical instability. Please use bfloat16 or float32 instead.",
1857
+ "plamo2": "Numerical instability. Please use bfloat16 or float32 instead.",
1858
+ "glm4": "Numerical instability. Please use bfloat16 or float32 instead.",
1859
+ }
1860
+
1861
+
1862
+ def _is_valid_dtype(model_type: str, dtype: torch.dtype):
1863
+ if model_type in _FLOAT16_NOT_SUPPORTED_MODELS and dtype == torch.float16: # noqa: E501, SIM103
1864
+ return False
1865
+
1866
+ return True
1867
+
1868
+
1869
+ def _check_valid_dtype(model_type: str, dtype: torch.dtype):
1870
+ if model_type in _FLOAT16_NOT_SUPPORTED_MODELS and dtype == torch.float16:
1871
+ reason = _FLOAT16_NOT_SUPPORTED_MODELS[model_type]
1872
+ raise ValueError(
1873
+ f"The model type {model_type!r} does not support float16. Reason: {reason}"
1874
+ )
1875
+
1876
+ return True
1877
+
1878
+
1879
+ def _find_dtype(
1880
+ model_id: str,
1881
+ config: PretrainedConfig,
1882
+ *,
1883
+ revision: str | None,
1884
+ ):
1885
+ # NOTE: getattr(config, "dtype", torch.float32) is not correct
1886
+ # because config.dtype can be None.
1887
+ config_dtype = getattr(config, "dtype", None)
1888
+
1889
+ # Fallbacks for multi-modal models if the root config
1890
+ # does not define dtype
1891
+ if config_dtype is None:
1892
+ config_dtype = getattr(config.get_text_config(), "dtype", None)
1893
+ if config_dtype is None and hasattr(config, "vision_config"):
1894
+ config_dtype = getattr(config.vision_config, "dtype", None)
1895
+ if config_dtype is None and hasattr(config, "encoder_config"):
1896
+ config_dtype = getattr(config.encoder_config, "dtype", None)
1897
+
1898
+ # Try to read the dtype of the weights if they are in safetensors format
1899
+ if config_dtype is None:
1900
+ repo_mt = try_get_safetensors_metadata(model_id, revision=revision)
1901
+
1902
+ if repo_mt and (files_mt := repo_mt.files_metadata):
1903
+ param_dtypes: set[torch.dtype] = {
1904
+ _SAFETENSORS_TO_TORCH_DTYPE[dtype_str]
1905
+ for file_mt in files_mt.values()
1906
+ for dtype_str in file_mt.parameter_count
1907
+ if dtype_str in _SAFETENSORS_TO_TORCH_DTYPE
1908
+ }
1909
+
1910
+ if param_dtypes:
1911
+ return common_broadcastable_dtype(param_dtypes)
1912
+
1913
+ if config_dtype is None:
1914
+ config_dtype = torch.float32
1915
+
1916
+ return config_dtype
1917
+
1918
+
1919
+ def _resolve_auto_dtype(
1920
+ model_type: str,
1921
+ config_dtype: torch.dtype,
1922
+ *,
1923
+ is_pooling_model: bool,
1924
+ ):
1925
+ from vllm.platforms import current_platform
1926
+
1927
+ supported_dtypes = [
1928
+ dtype
1929
+ for dtype in current_platform.supported_dtypes
1930
+ if _is_valid_dtype(model_type, dtype)
1931
+ ]
1932
+
1933
+ if is_pooling_model and torch.float16 in supported_dtypes:
1934
+ preferred_dtype = torch.float16
1935
+ else:
1936
+ preferred_dtype = supported_dtypes[0]
1937
+
1938
+ # Downcast for float32 models
1939
+ if config_dtype == torch.float32:
1940
+ config_dtype = preferred_dtype
1941
+
1942
+ if config_dtype in supported_dtypes:
1943
+ return config_dtype
1944
+
1945
+ # Ensure device compatibility
1946
+ device_name = current_platform.get_device_name()
1947
+ device_capability = current_platform.get_device_capability()
1948
+
1949
+ if device_capability is None:
1950
+ device_str = f"{device_name!r}"
1951
+ else:
1952
+ version_str = device_capability.as_version_str()
1953
+ device_str = f"{device_name!r} (with compute capability {version_str})"
1954
+
1955
+ logger.warning(
1956
+ "Your device %s doesn't support %s. Falling back to %s for compatibility.",
1957
+ device_str,
1958
+ config_dtype,
1959
+ preferred_dtype,
1960
+ )
1961
+
1962
+ return preferred_dtype
1963
+
1964
+
1965
+ def _get_and_verify_dtype(
1966
+ model_id: str,
1967
+ config: PretrainedConfig,
1968
+ dtype: str | torch.dtype,
1969
+ *,
1970
+ is_pooling_model: bool,
1971
+ revision: str | None = None,
1972
+ ) -> torch.dtype:
1973
+ config_dtype = _find_dtype(model_id, config, revision=revision)
1974
+ model_type = config.model_type
1975
+
1976
+ if isinstance(dtype, str):
1977
+ dtype = dtype.lower()
1978
+ if dtype == "auto":
1979
+ # Set default dtype from model config
1980
+ torch_dtype = _resolve_auto_dtype(
1981
+ model_type,
1982
+ config_dtype,
1983
+ is_pooling_model=is_pooling_model,
1984
+ )
1985
+ else:
1986
+ if dtype not in _STR_DTYPE_TO_TORCH_DTYPE:
1987
+ raise ValueError(f"Unknown dtype: {dtype!r}")
1988
+ torch_dtype = _STR_DTYPE_TO_TORCH_DTYPE[dtype]
1989
+ elif isinstance(dtype, torch.dtype):
1990
+ torch_dtype = dtype
1991
+ else:
1992
+ raise ValueError(f"Unknown dtype: {dtype}")
1993
+
1994
+ _check_valid_dtype(model_type, torch_dtype)
1995
+
1996
+ if torch_dtype != config_dtype:
1997
+ if torch_dtype == torch.float32:
1998
+ # Upcasting to float32 is allowed.
1999
+ logger.info("Upcasting %s to %s.", config_dtype, torch_dtype)
2000
+ elif config_dtype == torch.float32:
2001
+ # Downcasting from float32 to float16 or bfloat16 is allowed.
2002
+ logger.info("Downcasting %s to %s.", config_dtype, torch_dtype)
2003
+ else:
2004
+ # Casting between float16 and bfloat16 is allowed with a warning.
2005
+ logger.warning("Casting %s to %s.", config_dtype, torch_dtype)
2006
+
2007
+ return torch_dtype
2008
+
2009
+
2010
+ def _get_head_dtype(
2011
+ config: PretrainedConfig, dtype: torch.dtype, runner_type: str
2012
+ ) -> torch.dtype:
2013
+ head_dtype: str | torch.dtype | None = getattr(config, "head_dtype", None)
2014
+
2015
+ if head_dtype == "model":
2016
+ return dtype
2017
+ elif isinstance(head_dtype, str):
2018
+ head_dtype = head_dtype.lower()
2019
+ if head_dtype not in _STR_DTYPE_TO_TORCH_DTYPE:
2020
+ raise ValueError(f"Unknown dtype: {head_dtype!r}")
2021
+ return _STR_DTYPE_TO_TORCH_DTYPE[head_dtype]
2022
+ elif isinstance(head_dtype, torch.dtype):
2023
+ return head_dtype
2024
+ elif head_dtype is None:
2025
+ if torch.float32 not in current_platform.supported_dtypes:
2026
+ return dtype
2027
+ if runner_type == "pooling":
2028
+ return torch.float32
2029
+ return dtype
2030
+ else:
2031
+ raise ValueError(f"Unknown dtype: {head_dtype}")
2032
+
2033
+
2034
+ def _get_and_verify_max_len(
2035
+ hf_config: PretrainedConfig,
2036
+ tokenizer_config: dict | None,
2037
+ max_model_len: int | None,
2038
+ disable_sliding_window: bool,
2039
+ sliding_window: int | None,
2040
+ spec_target_max_model_len: int | None = None,
2041
+ encoder_config: Any | None = None,
2042
+ ) -> int:
2043
+ """Get and verify the model's maximum length."""
2044
+ derived_max_model_len = float("inf")
2045
+ possible_keys = [
2046
+ # OPT
2047
+ "max_position_embeddings",
2048
+ # GPT-2
2049
+ "n_positions",
2050
+ # MPT
2051
+ "max_seq_len",
2052
+ # ChatGLM2
2053
+ "seq_length",
2054
+ # Command-R
2055
+ "model_max_length",
2056
+ # Whisper
2057
+ "max_target_positions",
2058
+ # Others
2059
+ "max_sequence_length",
2060
+ "max_seq_length",
2061
+ "seq_len",
2062
+ ]
2063
+ # Choose the smallest "max_length" from the possible keys
2064
+ max_len_key = None
2065
+ for key in possible_keys:
2066
+ max_len = getattr(hf_config, key, None)
2067
+ if max_len is not None:
2068
+ max_len_key = key if max_len < derived_max_model_len else max_len_key
2069
+ derived_max_model_len = min(derived_max_model_len, max_len)
2070
+ # For Command-R / Cohere, Cohere2 / Aya Vision models
2071
+ if tmp_max_len := getattr(hf_config, "model_max_length", None):
2072
+ max_len_key = "model_max_length"
2073
+ derived_max_model_len = tmp_max_len
2074
+
2075
+ # If sliding window is manually disabled, max_length should be less
2076
+ # than the sliding window length in the model config.
2077
+ if (
2078
+ disable_sliding_window
2079
+ and sliding_window is not None
2080
+ and sliding_window < derived_max_model_len
2081
+ ):
2082
+ max_len_key = "sliding_window"
2083
+ derived_max_model_len = sliding_window
2084
+
2085
+ # Consider model_max_length in tokenizer_config
2086
+ if tokenizer_config:
2087
+ tokenizer_model_max_length = tokenizer_config.get(
2088
+ "model_max_length", derived_max_model_len
2089
+ )
2090
+ derived_max_model_len = min(derived_max_model_len, tokenizer_model_max_length)
2091
+
2092
+ # If none of the keys were found in the config, use a default and
2093
+ # log a warning.
2094
+ if derived_max_model_len == float("inf"):
2095
+ if max_model_len is not None:
2096
+ # If max_model_len is specified, we use it.
2097
+ return max_model_len
2098
+
2099
+ if spec_target_max_model_len is not None:
2100
+ # If this is a speculative draft model, we use the max model len
2101
+ # from the target model.
2102
+ return spec_target_max_model_len
2103
+
2104
+ default_max_len = 2048
2105
+ logger.warning(
2106
+ "The model's config.json does not contain any of the following "
2107
+ "keys to determine the original maximum length of the model: "
2108
+ "%s. Assuming the model's maximum length is %d.",
2109
+ possible_keys,
2110
+ default_max_len,
2111
+ )
2112
+ derived_max_model_len = default_max_len
2113
+
2114
+ # In Transformers v5 rope_parameters could be TypedDict or dict[str, TypedDict].
2115
+ # To simplify the verification, we convert it to dict[str, TypedDict].
2116
+ rope_parameters = getattr(hf_config, "rope_parameters", None)
2117
+ if rope_parameters and not set(rope_parameters.keys()).issubset(
2118
+ ALLOWED_LAYER_TYPES
2119
+ ):
2120
+ rope_parameters = {"": rope_parameters}
2121
+
2122
+ # NOTE(woosuk): Gemma3's max_model_len (128K) is already scaled by RoPE
2123
+ # scaling, so we skip applying the scaling factor again.
2124
+ if rope_parameters is not None and "gemma3" not in hf_config.model_type:
2125
+ scaling_factor = 1.0
2126
+ for rp in rope_parameters.values():
2127
+ # No need to consider "type" key because of patch_rope_parameters when
2128
+ # loading HF config
2129
+ rope_type = rp["rope_type"]
2130
+
2131
+ if rope_type not in ("su", "longrope", "llama3"):
2132
+ # NOTE: rope_type == "default" does not define factor https://github.com/huggingface/transformers/blob/v4.45.2/src/transformers/modeling_rope_utils.py
2133
+ # NOTE: This assumes all layer types have the same scaling factor.
2134
+ scaling_factor = rp.get("factor", scaling_factor)
2135
+
2136
+ if rope_type == "yarn":
2137
+ derived_max_model_len = rp["original_max_position_embeddings"]
2138
+ # Do this outside loop since all layer types should have the same scaling
2139
+ derived_max_model_len *= scaling_factor
2140
+
2141
+ if encoder_config and "max_seq_length" in encoder_config:
2142
+ derived_max_model_len = encoder_config["max_seq_length"]
2143
+
2144
+ # If the user didn't specify `max_model_len`, then use that derived from
2145
+ # the model config as a default value.
2146
+ if max_model_len is None:
2147
+ # For LongRoPE, default to original_max_position_embeddings to avoid
2148
+ # performance degradation for shorter sequences
2149
+ if rope_parameters is not None and any(
2150
+ rp["rope_type"] == "longrope" for rp in rope_parameters.values()
2151
+ ):
2152
+ max_model_len = int(
2153
+ getattr(
2154
+ hf_config, "original_max_position_embeddings", derived_max_model_len
2155
+ )
2156
+ )
2157
+ else:
2158
+ max_model_len = int(derived_max_model_len)
2159
+ max_model_len = current_platform.check_max_model_len(max_model_len)
2160
+
2161
+ # If the user specified a max length, make sure it is smaller than the
2162
+ # derived length from the HF model config.
2163
+ elif max_model_len > derived_max_model_len:
2164
+ # Some models might have a separate key for specifying model_max_length
2165
+ # that will be bigger than derived_max_model_len. We compare user input
2166
+ # with model_max_length and allow this override when it's smaller.
2167
+ model_max_length = getattr(hf_config, "model_max_length", None)
2168
+ if model_max_length is None or max_model_len > model_max_length:
2169
+ msg = (
2170
+ f"User-specified max_model_len ({max_model_len}) is greater "
2171
+ f"than the derived max_model_len ({max_len_key}="
2172
+ f"{derived_max_model_len} or model_max_length="
2173
+ f"{model_max_length} in model's config.json)."
2174
+ )
2175
+ warning = (
2176
+ "VLLM_ALLOW_LONG_MAX_MODEL_LEN must be used with extreme "
2177
+ "caution. If the model uses relative position encoding (RoPE), "
2178
+ "positions exceeding derived_max_model_len lead to nan. If the "
2179
+ "model uses absolute position encoding, positions exceeding "
2180
+ "derived_max_model_len will cause a CUDA array out-of-bounds "
2181
+ "error."
2182
+ )
2183
+ if envs.VLLM_ALLOW_LONG_MAX_MODEL_LEN:
2184
+ logger.warning_once("%s %s", msg, warning)
2185
+ else:
2186
+ raise ValueError(
2187
+ f"{msg} To allow overriding this maximum, set "
2188
+ f"the env var VLLM_ALLOW_LONG_MAX_MODEL_LEN=1. {warning}"
2189
+ )
2190
+ return int(max_model_len)