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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1398) hide show
  1. vllm/_C.abi3.so +0 -0
  2. vllm/__init__.py +220 -0
  3. vllm/_bc_linter.py +59 -0
  4. vllm/_custom_ops.py +2044 -0
  5. vllm/_ipex_ops.py +393 -0
  6. vllm/_version.py +34 -0
  7. vllm/assets/__init__.py +0 -0
  8. vllm/assets/audio.py +45 -0
  9. vllm/assets/base.py +41 -0
  10. vllm/assets/image.py +50 -0
  11. vllm/assets/video.py +145 -0
  12. vllm/attention/__init__.py +15 -0
  13. vllm/attention/backends/__init__.py +0 -0
  14. vllm/attention/backends/abstract.py +204 -0
  15. vllm/attention/backends/utils.py +33 -0
  16. vllm/attention/layer.py +645 -0
  17. vllm/attention/layers/__init__.py +0 -0
  18. vllm/attention/layers/chunked_local_attention.py +93 -0
  19. vllm/attention/layers/cross_attention.py +162 -0
  20. vllm/attention/layers/encoder_only_attention.py +86 -0
  21. vllm/attention/ops/__init__.py +0 -0
  22. vllm/attention/ops/chunked_prefill_paged_decode.py +405 -0
  23. vllm/attention/ops/common.py +345 -0
  24. vllm/attention/ops/flashmla.py +192 -0
  25. vllm/attention/ops/merge_attn_states.py +43 -0
  26. vllm/attention/ops/paged_attn.py +262 -0
  27. vllm/attention/ops/pallas_kv_cache_update.py +124 -0
  28. vllm/attention/ops/prefix_prefill.py +928 -0
  29. vllm/attention/ops/rocm_aiter_mla.py +104 -0
  30. vllm/attention/ops/rocm_aiter_paged_attn.py +102 -0
  31. vllm/attention/ops/triton_decode_attention.py +691 -0
  32. vllm/attention/ops/triton_flash_attention.py +984 -0
  33. vllm/attention/ops/triton_merge_attn_states.py +97 -0
  34. vllm/attention/ops/triton_reshape_and_cache_flash.py +175 -0
  35. vllm/attention/ops/triton_unified_attention.py +894 -0
  36. vllm/attention/selector.py +245 -0
  37. vllm/attention/utils/__init__.py +0 -0
  38. vllm/attention/utils/fa_utils.py +85 -0
  39. vllm/attention/utils/kv_sharing_utils.py +33 -0
  40. vllm/beam_search.py +87 -0
  41. vllm/benchmarks/__init__.py +0 -0
  42. vllm/benchmarks/datasets.py +2723 -0
  43. vllm/benchmarks/latency.py +170 -0
  44. vllm/benchmarks/lib/__init__.py +3 -0
  45. vllm/benchmarks/lib/endpoint_request_func.py +533 -0
  46. vllm/benchmarks/lib/ready_checker.py +73 -0
  47. vllm/benchmarks/lib/utils.py +80 -0
  48. vllm/benchmarks/serve.py +1358 -0
  49. vllm/benchmarks/throughput.py +696 -0
  50. vllm/collect_env.py +823 -0
  51. vllm/compilation/__init__.py +0 -0
  52. vllm/compilation/activation_quant_fusion.py +189 -0
  53. vllm/compilation/backends.py +650 -0
  54. vllm/compilation/base_static_graph.py +56 -0
  55. vllm/compilation/collective_fusion.py +1188 -0
  56. vllm/compilation/compiler_interface.py +573 -0
  57. vllm/compilation/counter.py +47 -0
  58. vllm/compilation/cuda_graph.py +199 -0
  59. vllm/compilation/cuda_piecewise_backend.py +117 -0
  60. vllm/compilation/decorators.py +400 -0
  61. vllm/compilation/fix_functionalization.py +205 -0
  62. vllm/compilation/fusion.py +383 -0
  63. vllm/compilation/fusion_attn.py +295 -0
  64. vllm/compilation/fx_utils.py +84 -0
  65. vllm/compilation/inductor_pass.py +136 -0
  66. vllm/compilation/monitor.py +57 -0
  67. vllm/compilation/noop_elimination.py +158 -0
  68. vllm/compilation/pass_manager.py +125 -0
  69. vllm/compilation/post_cleanup.py +20 -0
  70. vllm/compilation/sequence_parallelism.py +478 -0
  71. vllm/compilation/torch25_custom_graph_pass.py +42 -0
  72. vllm/compilation/vllm_inductor_pass.py +156 -0
  73. vllm/compilation/wrapper.py +136 -0
  74. vllm/config/__init__.py +814 -0
  75. vllm/config/cache.py +220 -0
  76. vllm/config/compilation.py +673 -0
  77. vllm/config/device.py +74 -0
  78. vllm/config/kv_events.py +50 -0
  79. vllm/config/kv_transfer.py +111 -0
  80. vllm/config/load.py +113 -0
  81. vllm/config/lora.py +132 -0
  82. vllm/config/model.py +1912 -0
  83. vllm/config/multimodal.py +129 -0
  84. vllm/config/observability.py +99 -0
  85. vllm/config/parallel.py +524 -0
  86. vllm/config/pooler.py +97 -0
  87. vllm/config/scheduler.py +287 -0
  88. vllm/config/speculative.py +568 -0
  89. vllm/config/speech_to_text.py +39 -0
  90. vllm/config/structured_outputs.py +64 -0
  91. vllm/config/utils.py +145 -0
  92. vllm/connections.py +186 -0
  93. vllm/device_allocator/__init__.py +0 -0
  94. vllm/device_allocator/cumem.py +311 -0
  95. vllm/distributed/__init__.py +6 -0
  96. vllm/distributed/communication_op.py +41 -0
  97. vllm/distributed/device_communicators/__init__.py +0 -0
  98. vllm/distributed/device_communicators/all2all.py +440 -0
  99. vllm/distributed/device_communicators/all_reduce_utils.py +317 -0
  100. vllm/distributed/device_communicators/base_device_communicator.py +295 -0
  101. vllm/distributed/device_communicators/cpu_communicator.py +201 -0
  102. vllm/distributed/device_communicators/cuda_communicator.py +323 -0
  103. vllm/distributed/device_communicators/cuda_wrapper.py +180 -0
  104. vllm/distributed/device_communicators/custom_all_reduce.py +311 -0
  105. vllm/distributed/device_communicators/mnnvl_compat.py +28 -0
  106. vllm/distributed/device_communicators/pynccl.py +340 -0
  107. vllm/distributed/device_communicators/pynccl_allocator.py +186 -0
  108. vllm/distributed/device_communicators/pynccl_wrapper.py +416 -0
  109. vllm/distributed/device_communicators/quick_all_reduce.py +278 -0
  110. vllm/distributed/device_communicators/ray_communicator.py +258 -0
  111. vllm/distributed/device_communicators/shm_broadcast.py +589 -0
  112. vllm/distributed/device_communicators/shm_object_storage.py +635 -0
  113. vllm/distributed/device_communicators/symm_mem.py +136 -0
  114. vllm/distributed/device_communicators/tpu_communicator.py +102 -0
  115. vllm/distributed/device_communicators/xpu_communicator.py +94 -0
  116. vllm/distributed/eplb/__init__.py +8 -0
  117. vllm/distributed/eplb/eplb_state.py +620 -0
  118. vllm/distributed/eplb/rebalance_algo.py +239 -0
  119. vllm/distributed/eplb/rebalance_execute.py +424 -0
  120. vllm/distributed/kv_events.py +362 -0
  121. vllm/distributed/kv_transfer/README.md +29 -0
  122. vllm/distributed/kv_transfer/__init__.py +13 -0
  123. vllm/distributed/kv_transfer/disagg_prefill_workflow.jpg +0 -0
  124. vllm/distributed/kv_transfer/kv_connector/__init__.py +0 -0
  125. vllm/distributed/kv_transfer/kv_connector/base.py +10 -0
  126. vllm/distributed/kv_transfer/kv_connector/factory.py +113 -0
  127. vllm/distributed/kv_transfer/kv_connector/utils.py +261 -0
  128. vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +6 -0
  129. vllm/distributed/kv_transfer/kv_connector/v1/base.py +388 -0
  130. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +168 -0
  131. vllm/distributed/kv_transfer/kv_connector/v1/metrics.py +100 -0
  132. vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +328 -0
  133. vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +1473 -0
  134. vllm/distributed/kv_transfer/kv_connector/v1/offloading_connector.py +485 -0
  135. vllm/distributed/kv_transfer/kv_connector/v1/p2p/__init__.py +0 -0
  136. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_connector.py +488 -0
  137. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py +550 -0
  138. vllm/distributed/kv_transfer/kv_connector/v1/p2p/tensor_memory_pool.py +267 -0
  139. vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py +418 -0
  140. vllm/distributed/kv_transfer/kv_lookup_buffer/__init__.py +0 -0
  141. vllm/distributed/kv_transfer/kv_lookup_buffer/base.py +175 -0
  142. vllm/distributed/kv_transfer/kv_lookup_buffer/mooncake_store.py +161 -0
  143. vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py +237 -0
  144. vllm/distributed/kv_transfer/kv_pipe/__init__.py +0 -0
  145. vllm/distributed/kv_transfer/kv_pipe/base.py +67 -0
  146. vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py +290 -0
  147. vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +280 -0
  148. vllm/distributed/kv_transfer/kv_transfer_state.py +73 -0
  149. vllm/distributed/parallel_state.py +1532 -0
  150. vllm/distributed/tpu_distributed_utils.py +178 -0
  151. vllm/distributed/utils.py +536 -0
  152. vllm/engine/__init__.py +0 -0
  153. vllm/engine/arg_utils.py +1778 -0
  154. vllm/engine/async_llm_engine.py +6 -0
  155. vllm/engine/llm_engine.py +6 -0
  156. vllm/engine/metrics.py +577 -0
  157. vllm/engine/metrics_types.py +84 -0
  158. vllm/engine/protocol.py +333 -0
  159. vllm/entrypoints/__init__.py +0 -0
  160. vllm/entrypoints/api_server.py +178 -0
  161. vllm/entrypoints/chat_utils.py +1705 -0
  162. vllm/entrypoints/cli/__init__.py +12 -0
  163. vllm/entrypoints/cli/benchmark/__init__.py +0 -0
  164. vllm/entrypoints/cli/benchmark/base.py +25 -0
  165. vllm/entrypoints/cli/benchmark/latency.py +21 -0
  166. vllm/entrypoints/cli/benchmark/main.py +55 -0
  167. vllm/entrypoints/cli/benchmark/serve.py +21 -0
  168. vllm/entrypoints/cli/benchmark/throughput.py +21 -0
  169. vllm/entrypoints/cli/collect_env.py +36 -0
  170. vllm/entrypoints/cli/main.py +60 -0
  171. vllm/entrypoints/cli/openai.py +233 -0
  172. vllm/entrypoints/cli/run_batch.py +67 -0
  173. vllm/entrypoints/cli/serve.py +232 -0
  174. vllm/entrypoints/cli/types.py +29 -0
  175. vllm/entrypoints/constants.py +10 -0
  176. vllm/entrypoints/context.py +481 -0
  177. vllm/entrypoints/harmony_utils.py +436 -0
  178. vllm/entrypoints/launcher.py +164 -0
  179. vllm/entrypoints/llm.py +1629 -0
  180. vllm/entrypoints/logger.py +79 -0
  181. vllm/entrypoints/openai/__init__.py +0 -0
  182. vllm/entrypoints/openai/api_server.py +1953 -0
  183. vllm/entrypoints/openai/cli_args.py +288 -0
  184. vllm/entrypoints/openai/logits_processors.py +90 -0
  185. vllm/entrypoints/openai/protocol.py +2757 -0
  186. vllm/entrypoints/openai/run_batch.py +491 -0
  187. vllm/entrypoints/openai/serving_chat.py +1597 -0
  188. vllm/entrypoints/openai/serving_classification.py +173 -0
  189. vllm/entrypoints/openai/serving_completion.py +692 -0
  190. vllm/entrypoints/openai/serving_embedding.py +631 -0
  191. vllm/entrypoints/openai/serving_engine.py +992 -0
  192. vllm/entrypoints/openai/serving_models.py +288 -0
  193. vllm/entrypoints/openai/serving_pooling.py +276 -0
  194. vllm/entrypoints/openai/serving_responses.py +1709 -0
  195. vllm/entrypoints/openai/serving_score.py +479 -0
  196. vllm/entrypoints/openai/serving_tokenization.py +196 -0
  197. vllm/entrypoints/openai/serving_transcription.py +136 -0
  198. vllm/entrypoints/openai/speech_to_text.py +388 -0
  199. vllm/entrypoints/openai/tool_parsers/__init__.py +55 -0
  200. vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +164 -0
  201. vllm/entrypoints/openai/tool_parsers/deepseekv31_tool_parser.py +367 -0
  202. vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py +370 -0
  203. vllm/entrypoints/openai/tool_parsers/glm4_moe_tool_parser.py +185 -0
  204. vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py +259 -0
  205. vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py +237 -0
  206. vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py +455 -0
  207. vllm/entrypoints/openai/tool_parsers/hunyuan_a13b_tool_parser.py +372 -0
  208. vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py +216 -0
  209. vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py +308 -0
  210. vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py +377 -0
  211. vllm/entrypoints/openai/tool_parsers/llama4_pythonic_tool_parser.py +316 -0
  212. vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +269 -0
  213. vllm/entrypoints/openai/tool_parsers/longcat_tool_parser.py +39 -0
  214. vllm/entrypoints/openai/tool_parsers/minimax_tool_parser.py +816 -0
  215. vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +369 -0
  216. vllm/entrypoints/openai/tool_parsers/openai_tool_parser.py +93 -0
  217. vllm/entrypoints/openai/tool_parsers/phi4mini_tool_parser.py +112 -0
  218. vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py +308 -0
  219. vllm/entrypoints/openai/tool_parsers/qwen3coder_tool_parser.py +707 -0
  220. vllm/entrypoints/openai/tool_parsers/qwen3xml_tool_parser.py +1137 -0
  221. vllm/entrypoints/openai/tool_parsers/seed_oss_tool_parser.py +679 -0
  222. vllm/entrypoints/openai/tool_parsers/step3_tool_parser.py +296 -0
  223. vllm/entrypoints/openai/tool_parsers/utils.py +124 -0
  224. vllm/entrypoints/openai/tool_parsers/xlam_tool_parser.py +524 -0
  225. vllm/entrypoints/renderer.py +395 -0
  226. vllm/entrypoints/score_utils.py +232 -0
  227. vllm/entrypoints/ssl.py +75 -0
  228. vllm/entrypoints/tool.py +139 -0
  229. vllm/entrypoints/tool_server.py +206 -0
  230. vllm/entrypoints/utils.py +233 -0
  231. vllm/env_override.py +23 -0
  232. vllm/envs.py +1590 -0
  233. vllm/executor/__init__.py +0 -0
  234. vllm/executor/executor_base.py +381 -0
  235. vllm/executor/msgspec_utils.py +35 -0
  236. vllm/executor/ray_distributed_executor.py +699 -0
  237. vllm/executor/ray_utils.py +410 -0
  238. vllm/executor/uniproc_executor.py +176 -0
  239. vllm/forward_context.py +402 -0
  240. vllm/inputs/__init__.py +30 -0
  241. vllm/inputs/data.py +356 -0
  242. vllm/inputs/parse.py +151 -0
  243. vllm/inputs/preprocess.py +664 -0
  244. vllm/logger.py +229 -0
  245. vllm/logging_utils/__init__.py +10 -0
  246. vllm/logging_utils/dump_input.py +81 -0
  247. vllm/logging_utils/formatter.py +79 -0
  248. vllm/logging_utils/log_time.py +32 -0
  249. vllm/logits_process.py +119 -0
  250. vllm/logprobs.py +28 -0
  251. vllm/lora/__init__.py +0 -0
  252. vllm/lora/layers/__init__.py +34 -0
  253. vllm/lora/layers/base.py +69 -0
  254. vllm/lora/layers/base_linear.py +185 -0
  255. vllm/lora/layers/column_parallel_linear.py +609 -0
  256. vllm/lora/layers/logits_processor.py +247 -0
  257. vllm/lora/layers/qkv_x_parallel_linear.py +8 -0
  258. vllm/lora/layers/replicated_linear.py +60 -0
  259. vllm/lora/layers/row_parallel_linear.py +196 -0
  260. vllm/lora/layers/utils.py +65 -0
  261. vllm/lora/layers/vocal_parallel_embedding.py +174 -0
  262. vllm/lora/lora_weights.py +199 -0
  263. vllm/lora/models.py +816 -0
  264. vllm/lora/ops/__init__.py +0 -0
  265. vllm/lora/ops/ipex_ops/__init__.py +7 -0
  266. vllm/lora/ops/ipex_ops/lora_ops.py +44 -0
  267. vllm/lora/ops/torch_ops/__init__.py +16 -0
  268. vllm/lora/ops/torch_ops/lora_ops.py +119 -0
  269. vllm/lora/ops/triton_ops/__init__.py +12 -0
  270. vllm/lora/ops/triton_ops/kernel_utils.py +243 -0
  271. vllm/lora/ops/triton_ops/lora_expand_op.py +289 -0
  272. vllm/lora/ops/triton_ops/lora_kernel_metadata.py +148 -0
  273. vllm/lora/ops/triton_ops/lora_shrink_op.py +243 -0
  274. vllm/lora/ops/triton_ops/utils.py +126 -0
  275. vllm/lora/ops/xla_ops/__init__.py +7 -0
  276. vllm/lora/ops/xla_ops/lora_ops.py +144 -0
  277. vllm/lora/peft_helper.py +127 -0
  278. vllm/lora/punica_wrapper/__init__.py +10 -0
  279. vllm/lora/punica_wrapper/punica_base.py +458 -0
  280. vllm/lora/punica_wrapper/punica_cpu.py +349 -0
  281. vllm/lora/punica_wrapper/punica_gpu.py +272 -0
  282. vllm/lora/punica_wrapper/punica_selector.py +20 -0
  283. vllm/lora/punica_wrapper/punica_tpu.py +391 -0
  284. vllm/lora/punica_wrapper/punica_xpu.py +276 -0
  285. vllm/lora/punica_wrapper/utils.py +136 -0
  286. vllm/lora/request.py +97 -0
  287. vllm/lora/resolver.py +85 -0
  288. vllm/lora/utils.py +246 -0
  289. vllm/lora/worker_manager.py +267 -0
  290. vllm/model_executor/__init__.py +12 -0
  291. vllm/model_executor/custom_op.py +194 -0
  292. vllm/model_executor/layers/__init__.py +0 -0
  293. vllm/model_executor/layers/activation.py +575 -0
  294. vllm/model_executor/layers/attention_layer_base.py +23 -0
  295. vllm/model_executor/layers/fla/__init__.py +8 -0
  296. vllm/model_executor/layers/fla/ops/__init__.py +17 -0
  297. vllm/model_executor/layers/fla/ops/chunk.py +225 -0
  298. vllm/model_executor/layers/fla/ops/chunk_delta_h.py +290 -0
  299. vllm/model_executor/layers/fla/ops/chunk_o.py +177 -0
  300. vllm/model_executor/layers/fla/ops/chunk_scaled_dot_kkt.py +140 -0
  301. vllm/model_executor/layers/fla/ops/cumsum.py +226 -0
  302. vllm/model_executor/layers/fla/ops/fused_recurrent.py +366 -0
  303. vllm/model_executor/layers/fla/ops/index.py +39 -0
  304. vllm/model_executor/layers/fla/ops/l2norm.py +143 -0
  305. vllm/model_executor/layers/fla/ops/layernorm_guard.py +337 -0
  306. vllm/model_executor/layers/fla/ops/op.py +39 -0
  307. vllm/model_executor/layers/fla/ops/solve_tril.py +365 -0
  308. vllm/model_executor/layers/fla/ops/utils.py +180 -0
  309. vllm/model_executor/layers/fla/ops/wy_fast.py +114 -0
  310. vllm/model_executor/layers/fused_moe/__init__.py +89 -0
  311. vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +322 -0
  312. vllm/model_executor/layers/fused_moe/batched_triton_or_deep_gemm_moe.py +141 -0
  313. vllm/model_executor/layers/fused_moe/config.py +804 -0
  314. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  315. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  316. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  317. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  318. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  319. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +218 -0
  320. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
  321. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  322. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  323. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  324. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  325. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  326. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  327. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H100,dtype=fp8_w8a8.json +123 -0
  328. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  329. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  330. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  331. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20.json +146 -0
  332. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
  333. vllm/model_executor/layers/fused_moe/configs/E=128,N=352,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +122 -0
  334. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  335. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  336. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  337. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  338. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  339. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e.json +146 -0
  340. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20.json +146 -0
  341. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  342. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
  343. vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  344. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +146 -0
  345. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +114 -0
  346. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  347. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  348. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  349. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  350. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  351. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
  352. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  353. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
  354. vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
  355. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  356. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
  357. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200.json +146 -0
  358. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
  359. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  360. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  361. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  362. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  363. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  364. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  365. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  366. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  367. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  368. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  369. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  370. vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  371. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  372. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  373. vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  374. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  375. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  376. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  377. vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  378. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  379. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  380. vllm/model_executor/layers/fused_moe/configs/E=160,N=320,device_name=NVIDIA_H20-3e.json +146 -0
  381. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  382. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  383. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  384. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  385. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  386. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  387. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  388. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  389. vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
  390. vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  391. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  392. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  393. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  394. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  395. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  396. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  397. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  398. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  399. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  400. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  401. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  402. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  403. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  404. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  405. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  406. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  407. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  408. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  409. vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  410. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  411. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  412. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  413. vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  414. vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  415. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  416. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  417. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  418. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200.json +146 -0
  419. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +147 -0
  420. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  421. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H20-3e.json +146 -0
  422. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H200.json +146 -0
  423. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200.json +146 -0
  424. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
  425. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  426. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H20-3e.json +146 -0
  427. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H200.json +146 -0
  428. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200.json +146 -0
  429. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
  430. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  431. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H20-3e.json +146 -0
  432. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H200.json +146 -0
  433. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_B200.json +146 -0
  434. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H20-3e.json +146 -0
  435. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H200.json +146 -0
  436. vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
  437. vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
  438. vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
  439. vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
  440. vllm/model_executor/layers/fused_moe/configs/E=62,N=128,device_name=AMD_Instinct_MI300X.json +200 -0
  441. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=AMD_Instinct_MI300X.json +200 -0
  442. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  443. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=AMD_Instinct_MI300X.json +200 -0
  444. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  445. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  446. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  447. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  448. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  449. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  450. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
  451. vllm/model_executor/layers/fused_moe/configs/E=64,N=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  452. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  453. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  454. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
  455. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  456. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20.json +146 -0
  457. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  458. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  459. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  460. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
  461. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  462. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20.json +146 -0
  463. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  464. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  465. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  466. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  467. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  468. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  469. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
  470. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  471. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20.json +146 -0
  472. vllm/model_executor/layers/fused_moe/configs/E=64,N=896,device_name=NVIDIA_H20.json +146 -0
  473. vllm/model_executor/layers/fused_moe/configs/E=72,N=192,device_name=AMD_Instinct_MI300X.json +200 -0
  474. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=AMD_Instinct_MI300X.json +200 -0
  475. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  476. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=AMD_Instinct_MI300X.json +200 -0
  477. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  478. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  479. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
  480. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  481. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
  482. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
  483. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  484. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
  485. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  486. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
  487. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  488. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
  489. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  490. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
  491. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  492. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
  493. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  494. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  495. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  496. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  497. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
  498. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  499. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
  500. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  501. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
  502. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  503. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  504. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  505. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +154 -0
  506. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  507. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
  508. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  509. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
  510. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  511. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
  512. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  513. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  514. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  515. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  516. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  517. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  518. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
  519. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
  520. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  521. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
  522. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  523. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
  524. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  525. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  526. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  527. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  528. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
  529. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  530. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
  531. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  532. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
  533. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  534. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  535. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  536. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  537. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
  538. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  539. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
  540. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  541. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
  542. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  543. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  544. vllm/model_executor/layers/fused_moe/configs/README +12 -0
  545. vllm/model_executor/layers/fused_moe/cpu_fused_moe.py +300 -0
  546. vllm/model_executor/layers/fused_moe/cutlass_moe.py +957 -0
  547. vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +362 -0
  548. vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +413 -0
  549. vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +361 -0
  550. vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +274 -0
  551. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_moe.py +268 -0
  552. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_prepare_finalize.py +300 -0
  553. vllm/model_executor/layers/fused_moe/flashinfer_trtllm_moe.py +184 -0
  554. vllm/model_executor/layers/fused_moe/fused_batched_moe.py +993 -0
  555. vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +239 -0
  556. vllm/model_executor/layers/fused_moe/fused_moe.py +1890 -0
  557. vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py +307 -0
  558. vllm/model_executor/layers/fused_moe/layer.py +2195 -0
  559. vllm/model_executor/layers/fused_moe/modular_kernel.py +1038 -0
  560. vllm/model_executor/layers/fused_moe/moe_align_block_size.py +87 -0
  561. vllm/model_executor/layers/fused_moe/moe_pallas.py +80 -0
  562. vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +205 -0
  563. vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
  564. vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +341 -0
  565. vllm/model_executor/layers/fused_moe/prepare_finalize.py +70 -0
  566. vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +424 -0
  567. vllm/model_executor/layers/fused_moe/routing_simulator.py +291 -0
  568. vllm/model_executor/layers/fused_moe/topk_weight_and_reduce.py +146 -0
  569. vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +143 -0
  570. vllm/model_executor/layers/fused_moe/trtllm_moe.py +191 -0
  571. vllm/model_executor/layers/fused_moe/utils.py +274 -0
  572. vllm/model_executor/layers/layernorm.py +395 -0
  573. vllm/model_executor/layers/lightning_attn.py +661 -0
  574. vllm/model_executor/layers/linear.py +1603 -0
  575. vllm/model_executor/layers/logits_processor.py +106 -0
  576. vllm/model_executor/layers/mamba/__init__.py +0 -0
  577. vllm/model_executor/layers/mamba/abstract.py +42 -0
  578. vllm/model_executor/layers/mamba/linear_attn.py +403 -0
  579. vllm/model_executor/layers/mamba/mamba_mixer.py +466 -0
  580. vllm/model_executor/layers/mamba/mamba_mixer2.py +764 -0
  581. vllm/model_executor/layers/mamba/mamba_utils.py +186 -0
  582. vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
  583. vllm/model_executor/layers/mamba/ops/causal_conv1d.py +1092 -0
  584. vllm/model_executor/layers/mamba/ops/layernorm_gated.py +168 -0
  585. vllm/model_executor/layers/mamba/ops/mamba_ssm.py +414 -0
  586. vllm/model_executor/layers/mamba/ops/ssd_bmm.py +242 -0
  587. vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +527 -0
  588. vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +724 -0
  589. vllm/model_executor/layers/mamba/ops/ssd_combined.py +238 -0
  590. vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +200 -0
  591. vllm/model_executor/layers/mamba/short_conv.py +253 -0
  592. vllm/model_executor/layers/mla.py +173 -0
  593. vllm/model_executor/layers/pooler.py +719 -0
  594. vllm/model_executor/layers/quantization/__init__.py +157 -0
  595. vllm/model_executor/layers/quantization/auto_round.py +388 -0
  596. vllm/model_executor/layers/quantization/awq.py +228 -0
  597. vllm/model_executor/layers/quantization/awq_marlin.py +554 -0
  598. vllm/model_executor/layers/quantization/awq_triton.py +320 -0
  599. vllm/model_executor/layers/quantization/base_config.py +170 -0
  600. vllm/model_executor/layers/quantization/bitblas.py +464 -0
  601. vllm/model_executor/layers/quantization/bitsandbytes.py +627 -0
  602. vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +0 -0
  603. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +797 -0
  604. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +2074 -0
  605. vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +27 -0
  606. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +366 -0
  607. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +55 -0
  608. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +160 -0
  609. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_nvfp4.py +105 -0
  610. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +185 -0
  611. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_fp8.py +169 -0
  612. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_int.py +135 -0
  613. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +121 -0
  614. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +157 -0
  615. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +111 -0
  616. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +201 -0
  617. vllm/model_executor/layers/quantization/compressed_tensors/transform/__init__.py +0 -0
  618. vllm/model_executor/layers/quantization/compressed_tensors/transform/linear.py +238 -0
  619. vllm/model_executor/layers/quantization/compressed_tensors/transform/module.py +153 -0
  620. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/__init__.py +0 -0
  621. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/linear_qutlass_nvfp4.py +46 -0
  622. vllm/model_executor/layers/quantization/compressed_tensors/transform/utils.py +13 -0
  623. vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +206 -0
  624. vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
  625. vllm/model_executor/layers/quantization/deepspeedfp.py +196 -0
  626. vllm/model_executor/layers/quantization/experts_int8.py +223 -0
  627. vllm/model_executor/layers/quantization/fbgemm_fp8.py +172 -0
  628. vllm/model_executor/layers/quantization/fp8.py +1098 -0
  629. vllm/model_executor/layers/quantization/gguf.py +599 -0
  630. vllm/model_executor/layers/quantization/gptq.py +340 -0
  631. vllm/model_executor/layers/quantization/gptq_bitblas.py +448 -0
  632. vllm/model_executor/layers/quantization/gptq_marlin.py +751 -0
  633. vllm/model_executor/layers/quantization/gptq_marlin_24.py +297 -0
  634. vllm/model_executor/layers/quantization/hqq_marlin.py +333 -0
  635. vllm/model_executor/layers/quantization/inc.py +61 -0
  636. vllm/model_executor/layers/quantization/input_quant_fp8.py +156 -0
  637. vllm/model_executor/layers/quantization/ipex_quant.py +415 -0
  638. vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
  639. vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +91 -0
  640. vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +93 -0
  641. vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +116 -0
  642. vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +302 -0
  643. vllm/model_executor/layers/quantization/kernels/mixed_precision/conch.py +92 -0
  644. vllm/model_executor/layers/quantization/kernels/mixed_precision/cutlass.py +117 -0
  645. vllm/model_executor/layers/quantization/kernels/mixed_precision/dynamic_4bit.py +92 -0
  646. vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +143 -0
  647. vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +144 -0
  648. vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +139 -0
  649. vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +67 -0
  650. vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +89 -0
  651. vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +161 -0
  652. vllm/model_executor/layers/quantization/kernels/scaled_mm/cpu.py +206 -0
  653. vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +137 -0
  654. vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +41 -0
  655. vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +104 -0
  656. vllm/model_executor/layers/quantization/kv_cache.py +143 -0
  657. vllm/model_executor/layers/quantization/modelopt.py +1596 -0
  658. vllm/model_executor/layers/quantization/moe_wna16.py +484 -0
  659. vllm/model_executor/layers/quantization/mxfp4.py +988 -0
  660. vllm/model_executor/layers/quantization/petit.py +306 -0
  661. vllm/model_executor/layers/quantization/ptpc_fp8.py +129 -0
  662. vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
  663. vllm/model_executor/layers/quantization/quark/quark.py +432 -0
  664. vllm/model_executor/layers/quantization/quark/quark_moe.py +561 -0
  665. vllm/model_executor/layers/quantization/quark/schemes/__init__.py +9 -0
  666. vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +55 -0
  667. vllm/model_executor/layers/quantization/quark/schemes/quark_w4a4_mxfp4.py +239 -0
  668. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +163 -0
  669. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +122 -0
  670. vllm/model_executor/layers/quantization/quark/utils.py +105 -0
  671. vllm/model_executor/layers/quantization/rtn.py +466 -0
  672. vllm/model_executor/layers/quantization/schema.py +86 -0
  673. vllm/model_executor/layers/quantization/torchao.py +214 -0
  674. vllm/model_executor/layers/quantization/tpu_int8.py +125 -0
  675. vllm/model_executor/layers/quantization/utils/__init__.py +6 -0
  676. vllm/model_executor/layers/quantization/utils/allspark_utils.py +52 -0
  677. vllm/model_executor/layers/quantization/utils/bitblas_utils.py +210 -0
  678. vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  679. vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  680. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  681. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  682. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  683. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  684. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  685. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  686. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  687. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  688. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  689. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  690. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  691. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  692. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  693. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  694. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  695. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  696. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  697. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  698. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  699. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  700. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  701. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  702. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  703. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  704. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  705. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  706. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  707. vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  708. vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  709. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  710. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  711. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  712. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  713. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  714. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  715. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  716. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  717. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  718. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  719. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  720. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  721. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  722. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  723. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  724. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  725. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  726. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  727. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  728. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  729. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  730. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  731. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  732. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  733. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  734. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  735. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  736. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  737. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  738. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  739. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  740. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  741. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  742. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  743. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  744. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  745. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  746. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  747. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  748. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  749. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  750. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  751. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  752. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  753. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  754. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  755. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  756. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  757. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  758. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  759. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  760. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  761. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  762. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  763. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  764. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  765. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  766. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  767. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  768. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  769. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  770. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  771. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  772. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  773. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  774. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  775. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  776. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  777. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  778. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  779. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  780. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  781. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  782. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  783. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  784. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  785. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  786. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  787. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  788. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  789. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  790. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  791. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  792. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  793. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  794. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  795. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  796. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  797. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  798. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  799. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  800. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  801. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  802. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  803. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  804. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  805. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  806. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  807. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +18 -0
  808. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  809. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  810. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  811. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  812. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  813. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  814. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  815. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  816. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  817. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  818. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  819. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  820. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  821. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  822. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  823. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  824. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  825. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  826. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  827. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  828. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  829. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  830. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  831. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  832. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  833. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  834. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  835. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  836. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  837. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  838. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  839. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  840. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  841. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  842. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  843. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  844. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  845. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  846. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  847. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  848. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  849. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  850. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  851. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  852. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  853. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  854. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  855. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  856. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  857. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  858. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  859. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  860. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  861. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  862. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  863. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  864. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  865. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  866. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  867. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  868. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  869. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  870. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  871. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  872. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  873. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  874. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  875. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  876. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  877. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  878. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  879. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  880. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  881. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  882. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  883. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  884. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  885. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  886. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  887. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  888. vllm/model_executor/layers/quantization/utils/configs/README.md +3 -0
  889. vllm/model_executor/layers/quantization/utils/flashinfer_fp4_moe.py +79 -0
  890. vllm/model_executor/layers/quantization/utils/flashinfer_utils.py +248 -0
  891. vllm/model_executor/layers/quantization/utils/fp8_utils.py +949 -0
  892. vllm/model_executor/layers/quantization/utils/gptq_utils.py +146 -0
  893. vllm/model_executor/layers/quantization/utils/int8_utils.py +492 -0
  894. vllm/model_executor/layers/quantization/utils/layer_utils.py +40 -0
  895. vllm/model_executor/layers/quantization/utils/machete_utils.py +50 -0
  896. vllm/model_executor/layers/quantization/utils/marlin_utils.py +479 -0
  897. vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +396 -0
  898. vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +345 -0
  899. vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +165 -0
  900. vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +464 -0
  901. vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +141 -0
  902. vllm/model_executor/layers/quantization/utils/mxfp8_utils.py +20 -0
  903. vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +137 -0
  904. vllm/model_executor/layers/quantization/utils/nvfp4_moe_support.py +59 -0
  905. vllm/model_executor/layers/quantization/utils/petit_utils.py +122 -0
  906. vllm/model_executor/layers/quantization/utils/quant_utils.py +641 -0
  907. vllm/model_executor/layers/quantization/utils/w8a8_utils.py +458 -0
  908. vllm/model_executor/layers/resampler.py +270 -0
  909. vllm/model_executor/layers/rotary_embedding/__init__.py +204 -0
  910. vllm/model_executor/layers/rotary_embedding/base.py +177 -0
  911. vllm/model_executor/layers/rotary_embedding/common.py +150 -0
  912. vllm/model_executor/layers/rotary_embedding/deepseek_scaling_rope.py +138 -0
  913. vllm/model_executor/layers/rotary_embedding/dual_chunk_rope.py +197 -0
  914. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_alpha_rope.py +41 -0
  915. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_scaling_rope.py +67 -0
  916. vllm/model_executor/layers/rotary_embedding/ernie45_vl_rope.py +80 -0
  917. vllm/model_executor/layers/rotary_embedding/linear_scaling_rope.py +115 -0
  918. vllm/model_executor/layers/rotary_embedding/llama3_rope.py +54 -0
  919. vllm/model_executor/layers/rotary_embedding/llama4_vision_rope.py +81 -0
  920. vllm/model_executor/layers/rotary_embedding/mrope.py +1321 -0
  921. vllm/model_executor/layers/rotary_embedding/ntk_scaling_rope.py +42 -0
  922. vllm/model_executor/layers/rotary_embedding/phi3_long_rope_scaled_rope.py +129 -0
  923. vllm/model_executor/layers/rotary_embedding/rocm_aiter_rope_ops.py +86 -0
  924. vllm/model_executor/layers/rotary_embedding/yarn_scaling_rope.py +68 -0
  925. vllm/model_executor/layers/shared_fused_moe/__init__.py +6 -0
  926. vllm/model_executor/layers/shared_fused_moe/shared_fused_moe.py +56 -0
  927. vllm/model_executor/layers/utils.py +195 -0
  928. vllm/model_executor/layers/vocab_parallel_embedding.py +487 -0
  929. vllm/model_executor/model_loader/__init__.py +138 -0
  930. vllm/model_executor/model_loader/base_loader.py +52 -0
  931. vllm/model_executor/model_loader/bitsandbytes_loader.py +788 -0
  932. vllm/model_executor/model_loader/default_loader.py +277 -0
  933. vllm/model_executor/model_loader/dummy_loader.py +28 -0
  934. vllm/model_executor/model_loader/gguf_loader.py +155 -0
  935. vllm/model_executor/model_loader/runai_streamer_loader.py +104 -0
  936. vllm/model_executor/model_loader/sharded_state_loader.py +199 -0
  937. vllm/model_executor/model_loader/tensorizer.py +738 -0
  938. vllm/model_executor/model_loader/tensorizer_loader.py +143 -0
  939. vllm/model_executor/model_loader/tpu.py +114 -0
  940. vllm/model_executor/model_loader/utils.py +292 -0
  941. vllm/model_executor/model_loader/weight_utils.py +990 -0
  942. vllm/model_executor/models/__init__.py +33 -0
  943. vllm/model_executor/models/adapters.py +542 -0
  944. vllm/model_executor/models/aimv2.py +246 -0
  945. vllm/model_executor/models/apertus.py +579 -0
  946. vllm/model_executor/models/arcee.py +422 -0
  947. vllm/model_executor/models/arctic.py +558 -0
  948. vllm/model_executor/models/aria.py +650 -0
  949. vllm/model_executor/models/aya_vision.py +468 -0
  950. vllm/model_executor/models/baichuan.py +474 -0
  951. vllm/model_executor/models/bailing_moe.py +642 -0
  952. vllm/model_executor/models/bamba.py +514 -0
  953. vllm/model_executor/models/bert.py +665 -0
  954. vllm/model_executor/models/bert_with_rope.py +687 -0
  955. vllm/model_executor/models/blip.py +339 -0
  956. vllm/model_executor/models/blip2.py +712 -0
  957. vllm/model_executor/models/bloom.py +374 -0
  958. vllm/model_executor/models/chameleon.py +1139 -0
  959. vllm/model_executor/models/chatglm.py +476 -0
  960. vllm/model_executor/models/clip.py +407 -0
  961. vllm/model_executor/models/cohere2_vision.py +481 -0
  962. vllm/model_executor/models/commandr.py +465 -0
  963. vllm/model_executor/models/config.py +445 -0
  964. vllm/model_executor/models/dbrx.py +471 -0
  965. vllm/model_executor/models/deepseek.py +497 -0
  966. vllm/model_executor/models/deepseek_eagle.py +240 -0
  967. vllm/model_executor/models/deepseek_mtp.py +289 -0
  968. vllm/model_executor/models/deepseek_v2.py +1444 -0
  969. vllm/model_executor/models/deepseek_vl2.py +658 -0
  970. vllm/model_executor/models/dots1.py +546 -0
  971. vllm/model_executor/models/dots_ocr.py +873 -0
  972. vllm/model_executor/models/ernie45.py +43 -0
  973. vllm/model_executor/models/ernie45_moe.py +607 -0
  974. vllm/model_executor/models/ernie45_vl.py +1527 -0
  975. vllm/model_executor/models/ernie45_vl_moe.py +727 -0
  976. vllm/model_executor/models/ernie_mtp.py +268 -0
  977. vllm/model_executor/models/exaone.py +550 -0
  978. vllm/model_executor/models/exaone4.py +533 -0
  979. vllm/model_executor/models/fairseq2_llama.py +154 -0
  980. vllm/model_executor/models/falcon.py +509 -0
  981. vllm/model_executor/models/falcon_h1.py +674 -0
  982. vllm/model_executor/models/fuyu.py +399 -0
  983. vllm/model_executor/models/gemma.py +425 -0
  984. vllm/model_executor/models/gemma2.py +422 -0
  985. vllm/model_executor/models/gemma3.py +555 -0
  986. vllm/model_executor/models/gemma3_mm.py +721 -0
  987. vllm/model_executor/models/gemma3n.py +1113 -0
  988. vllm/model_executor/models/gemma3n_mm.py +761 -0
  989. vllm/model_executor/models/glm.py +23 -0
  990. vllm/model_executor/models/glm4.py +304 -0
  991. vllm/model_executor/models/glm4_1v.py +1690 -0
  992. vllm/model_executor/models/glm4_moe.py +727 -0
  993. vllm/model_executor/models/glm4_moe_mtp.py +301 -0
  994. vllm/model_executor/models/glm4v.py +654 -0
  995. vllm/model_executor/models/gpt2.py +380 -0
  996. vllm/model_executor/models/gpt_bigcode.py +344 -0
  997. vllm/model_executor/models/gpt_j.py +339 -0
  998. vllm/model_executor/models/gpt_neox.py +330 -0
  999. vllm/model_executor/models/gpt_oss.py +712 -0
  1000. vllm/model_executor/models/granite.py +489 -0
  1001. vllm/model_executor/models/granite_speech.py +794 -0
  1002. vllm/model_executor/models/granitemoe.py +550 -0
  1003. vllm/model_executor/models/granitemoehybrid.py +614 -0
  1004. vllm/model_executor/models/granitemoeshared.py +332 -0
  1005. vllm/model_executor/models/gritlm.py +262 -0
  1006. vllm/model_executor/models/grok1.py +547 -0
  1007. vllm/model_executor/models/h2ovl.py +536 -0
  1008. vllm/model_executor/models/hunyuan_v1.py +1042 -0
  1009. vllm/model_executor/models/hyperclovax_vision.py +1192 -0
  1010. vllm/model_executor/models/idefics2_vision_model.py +417 -0
  1011. vllm/model_executor/models/idefics3.py +756 -0
  1012. vllm/model_executor/models/interfaces.py +959 -0
  1013. vllm/model_executor/models/interfaces_base.py +192 -0
  1014. vllm/model_executor/models/intern_vit.py +441 -0
  1015. vllm/model_executor/models/internlm2.py +450 -0
  1016. vllm/model_executor/models/internlm2_ve.py +148 -0
  1017. vllm/model_executor/models/interns1.py +838 -0
  1018. vllm/model_executor/models/interns1_vit.py +418 -0
  1019. vllm/model_executor/models/internvl.py +1423 -0
  1020. vllm/model_executor/models/jais.py +373 -0
  1021. vllm/model_executor/models/jamba.py +591 -0
  1022. vllm/model_executor/models/jina_vl.py +144 -0
  1023. vllm/model_executor/models/keye.py +1680 -0
  1024. vllm/model_executor/models/keye_vl1_5.py +602 -0
  1025. vllm/model_executor/models/kimi_vl.py +618 -0
  1026. vllm/model_executor/models/lfm2.py +548 -0
  1027. vllm/model_executor/models/llama.py +669 -0
  1028. vllm/model_executor/models/llama4.py +746 -0
  1029. vllm/model_executor/models/llama4_eagle.py +239 -0
  1030. vllm/model_executor/models/llama_eagle.py +179 -0
  1031. vllm/model_executor/models/llama_eagle3.py +296 -0
  1032. vllm/model_executor/models/llava.py +870 -0
  1033. vllm/model_executor/models/llava_next.py +571 -0
  1034. vllm/model_executor/models/llava_next_video.py +476 -0
  1035. vllm/model_executor/models/llava_onevision.py +942 -0
  1036. vllm/model_executor/models/longcat_flash.py +715 -0
  1037. vllm/model_executor/models/longcat_flash_mtp.py +352 -0
  1038. vllm/model_executor/models/mamba.py +275 -0
  1039. vllm/model_executor/models/mamba2.py +291 -0
  1040. vllm/model_executor/models/medusa.py +169 -0
  1041. vllm/model_executor/models/midashenglm.py +792 -0
  1042. vllm/model_executor/models/mimo.py +188 -0
  1043. vllm/model_executor/models/mimo_mtp.py +280 -0
  1044. vllm/model_executor/models/minicpm.py +631 -0
  1045. vllm/model_executor/models/minicpm3.py +230 -0
  1046. vllm/model_executor/models/minicpm_eagle.py +389 -0
  1047. vllm/model_executor/models/minicpmo.py +770 -0
  1048. vllm/model_executor/models/minicpmv.py +1784 -0
  1049. vllm/model_executor/models/minimax_text_01.py +986 -0
  1050. vllm/model_executor/models/minimax_vl_01.py +426 -0
  1051. vllm/model_executor/models/mistral3.py +628 -0
  1052. vllm/model_executor/models/mixtral.py +606 -0
  1053. vllm/model_executor/models/mllama4.py +1076 -0
  1054. vllm/model_executor/models/mlp_speculator.py +206 -0
  1055. vllm/model_executor/models/modernbert.py +374 -0
  1056. vllm/model_executor/models/module_mapping.py +72 -0
  1057. vllm/model_executor/models/molmo.py +1567 -0
  1058. vllm/model_executor/models/moonvit.py +673 -0
  1059. vllm/model_executor/models/motif.py +345 -0
  1060. vllm/model_executor/models/mpt.py +329 -0
  1061. vllm/model_executor/models/nano_nemotron_vl.py +1394 -0
  1062. vllm/model_executor/models/nemotron.py +507 -0
  1063. vllm/model_executor/models/nemotron_h.py +565 -0
  1064. vllm/model_executor/models/nemotron_nas.py +481 -0
  1065. vllm/model_executor/models/nemotron_vl.py +652 -0
  1066. vllm/model_executor/models/nvlm_d.py +203 -0
  1067. vllm/model_executor/models/olmo.py +404 -0
  1068. vllm/model_executor/models/olmo2.py +439 -0
  1069. vllm/model_executor/models/olmoe.py +483 -0
  1070. vllm/model_executor/models/opt.py +412 -0
  1071. vllm/model_executor/models/orion.py +348 -0
  1072. vllm/model_executor/models/ovis.py +559 -0
  1073. vllm/model_executor/models/ovis2_5.py +642 -0
  1074. vllm/model_executor/models/paligemma.py +411 -0
  1075. vllm/model_executor/models/persimmon.py +343 -0
  1076. vllm/model_executor/models/phi.py +356 -0
  1077. vllm/model_executor/models/phi3.py +19 -0
  1078. vllm/model_executor/models/phi3v.py +698 -0
  1079. vllm/model_executor/models/phi4_multimodal.py +1475 -0
  1080. vllm/model_executor/models/phi4mm.py +1279 -0
  1081. vllm/model_executor/models/phi4mm_audio.py +1254 -0
  1082. vllm/model_executor/models/phi4mm_utils.py +1875 -0
  1083. vllm/model_executor/models/phimoe.py +679 -0
  1084. vllm/model_executor/models/pixtral.py +1345 -0
  1085. vllm/model_executor/models/plamo2.py +978 -0
  1086. vllm/model_executor/models/qwen.py +361 -0
  1087. vllm/model_executor/models/qwen2.py +523 -0
  1088. vllm/model_executor/models/qwen2_5_omni_thinker.py +984 -0
  1089. vllm/model_executor/models/qwen2_5_vl.py +1481 -0
  1090. vllm/model_executor/models/qwen2_audio.py +489 -0
  1091. vllm/model_executor/models/qwen2_moe.py +558 -0
  1092. vllm/model_executor/models/qwen2_rm.py +122 -0
  1093. vllm/model_executor/models/qwen2_vl.py +1670 -0
  1094. vllm/model_executor/models/qwen3.py +341 -0
  1095. vllm/model_executor/models/qwen3_moe.py +692 -0
  1096. vllm/model_executor/models/qwen3_next.py +1266 -0
  1097. vllm/model_executor/models/qwen3_next_mtp.py +281 -0
  1098. vllm/model_executor/models/qwen3_vl.py +1613 -0
  1099. vllm/model_executor/models/qwen3_vl_moe.py +358 -0
  1100. vllm/model_executor/models/qwen_vl.py +795 -0
  1101. vllm/model_executor/models/radio.py +576 -0
  1102. vllm/model_executor/models/registry.py +990 -0
  1103. vllm/model_executor/models/roberta.py +252 -0
  1104. vllm/model_executor/models/rvl.py +103 -0
  1105. vllm/model_executor/models/seed_oss.py +485 -0
  1106. vllm/model_executor/models/siglip.py +540 -0
  1107. vllm/model_executor/models/siglip2navit.py +689 -0
  1108. vllm/model_executor/models/skyworkr1v.py +911 -0
  1109. vllm/model_executor/models/smolvlm.py +44 -0
  1110. vllm/model_executor/models/solar.py +504 -0
  1111. vllm/model_executor/models/stablelm.py +341 -0
  1112. vllm/model_executor/models/starcoder2.py +354 -0
  1113. vllm/model_executor/models/step3_text.py +510 -0
  1114. vllm/model_executor/models/step3_vl.py +1072 -0
  1115. vllm/model_executor/models/swin.py +475 -0
  1116. vllm/model_executor/models/tarsier.py +639 -0
  1117. vllm/model_executor/models/telechat2.py +151 -0
  1118. vllm/model_executor/models/teleflm.py +79 -0
  1119. vllm/model_executor/models/terratorch.py +294 -0
  1120. vllm/model_executor/models/transformers.py +948 -0
  1121. vllm/model_executor/models/ultravox.py +654 -0
  1122. vllm/model_executor/models/utils.py +808 -0
  1123. vllm/model_executor/models/vision.py +404 -0
  1124. vllm/model_executor/models/voxtral.py +786 -0
  1125. vllm/model_executor/models/whisper.py +963 -0
  1126. vllm/model_executor/models/zamba2.py +960 -0
  1127. vllm/model_executor/parameter.py +620 -0
  1128. vllm/model_executor/utils.py +86 -0
  1129. vllm/model_executor/warmup/__init__.py +0 -0
  1130. vllm/model_executor/warmup/deep_gemm_warmup.py +230 -0
  1131. vllm/model_executor/warmup/kernel_warmup.py +83 -0
  1132. vllm/multimodal/__init__.py +33 -0
  1133. vllm/multimodal/audio.py +116 -0
  1134. vllm/multimodal/base.py +27 -0
  1135. vllm/multimodal/cache.py +697 -0
  1136. vllm/multimodal/evs.py +273 -0
  1137. vllm/multimodal/hasher.py +102 -0
  1138. vllm/multimodal/image.py +130 -0
  1139. vllm/multimodal/inputs.py +987 -0
  1140. vllm/multimodal/parse.py +511 -0
  1141. vllm/multimodal/processing.py +2148 -0
  1142. vllm/multimodal/profiling.py +284 -0
  1143. vllm/multimodal/registry.py +345 -0
  1144. vllm/multimodal/utils.py +503 -0
  1145. vllm/multimodal/video.py +319 -0
  1146. vllm/outputs.py +324 -0
  1147. vllm/platforms/__init__.py +263 -0
  1148. vllm/platforms/cpu.py +340 -0
  1149. vllm/platforms/cuda.py +668 -0
  1150. vllm/platforms/interface.py +620 -0
  1151. vllm/platforms/rocm.py +497 -0
  1152. vllm/platforms/tpu.py +233 -0
  1153. vllm/platforms/xpu.py +243 -0
  1154. vllm/plugins/__init__.py +72 -0
  1155. vllm/plugins/io_processors/__init__.py +68 -0
  1156. vllm/plugins/io_processors/interface.py +67 -0
  1157. vllm/plugins/lora_resolvers/README.md +16 -0
  1158. vllm/plugins/lora_resolvers/__init__.py +0 -0
  1159. vllm/plugins/lora_resolvers/filesystem_resolver.py +50 -0
  1160. vllm/pooling_params.py +191 -0
  1161. vllm/profiler/__init__.py +0 -0
  1162. vllm/profiler/layerwise_profile.py +375 -0
  1163. vllm/profiler/utils.py +148 -0
  1164. vllm/py.typed +2 -0
  1165. vllm/ray/__init__.py +0 -0
  1166. vllm/ray/lazy_utils.py +22 -0
  1167. vllm/ray/ray_env.py +72 -0
  1168. vllm/reasoning/__init__.py +29 -0
  1169. vllm/reasoning/abs_reasoning_parsers.py +202 -0
  1170. vllm/reasoning/basic_parsers.py +156 -0
  1171. vllm/reasoning/deepseek_r1_reasoning_parser.py +67 -0
  1172. vllm/reasoning/glm4_moe_reasoning_parser.py +151 -0
  1173. vllm/reasoning/gptoss_reasoning_parser.py +87 -0
  1174. vllm/reasoning/granite_reasoning_parser.py +363 -0
  1175. vllm/reasoning/hunyuan_a13b_reasoning_parser.py +245 -0
  1176. vllm/reasoning/mistral_reasoning_parser.py +56 -0
  1177. vllm/reasoning/qwen3_reasoning_parser.py +72 -0
  1178. vllm/reasoning/seedoss_reasoning_parser.py +28 -0
  1179. vllm/reasoning/step3_reasoning_parser.py +109 -0
  1180. vllm/sampling_params.py +593 -0
  1181. vllm/scalar_type.py +349 -0
  1182. vllm/scripts.py +15 -0
  1183. vllm/sequence.py +103 -0
  1184. vllm/tasks.py +11 -0
  1185. vllm/test_utils.py +129 -0
  1186. vllm/third_party/__init__.py +0 -0
  1187. vllm/third_party/pynvml.py +6140 -0
  1188. vllm/tracing.py +136 -0
  1189. vllm/transformers_utils/__init__.py +24 -0
  1190. vllm/transformers_utils/chat_templates/__init__.py +5 -0
  1191. vllm/transformers_utils/chat_templates/registry.py +70 -0
  1192. vllm/transformers_utils/chat_templates/template_basic.jinja +3 -0
  1193. vllm/transformers_utils/chat_templates/template_blip2.jinja +11 -0
  1194. vllm/transformers_utils/chat_templates/template_chatml.jinja +10 -0
  1195. vllm/transformers_utils/chat_templates/template_deepseek_vl2.jinja +23 -0
  1196. vllm/transformers_utils/chat_templates/template_fuyu.jinja +3 -0
  1197. vllm/transformers_utils/chat_templates/template_minicpmv45.jinja +93 -0
  1198. vllm/transformers_utils/config.py +1102 -0
  1199. vllm/transformers_utils/config_parser_base.py +20 -0
  1200. vllm/transformers_utils/configs/__init__.py +63 -0
  1201. vllm/transformers_utils/configs/arctic.py +207 -0
  1202. vllm/transformers_utils/configs/chatglm.py +72 -0
  1203. vllm/transformers_utils/configs/deepseek_v3.py +101 -0
  1204. vllm/transformers_utils/configs/deepseek_vl2.py +216 -0
  1205. vllm/transformers_utils/configs/dotsocr.py +69 -0
  1206. vllm/transformers_utils/configs/eagle.py +84 -0
  1207. vllm/transformers_utils/configs/falcon.py +90 -0
  1208. vllm/transformers_utils/configs/jais.py +237 -0
  1209. vllm/transformers_utils/configs/kimi_vl.py +37 -0
  1210. vllm/transformers_utils/configs/medusa.py +63 -0
  1211. vllm/transformers_utils/configs/midashenglm.py +101 -0
  1212. vllm/transformers_utils/configs/mistral.py +165 -0
  1213. vllm/transformers_utils/configs/mlp_speculator.py +68 -0
  1214. vllm/transformers_utils/configs/moonvit.py +33 -0
  1215. vllm/transformers_utils/configs/nemotron.py +205 -0
  1216. vllm/transformers_utils/configs/nemotron_h.py +259 -0
  1217. vllm/transformers_utils/configs/nemotron_vl.py +56 -0
  1218. vllm/transformers_utils/configs/olmo3.py +80 -0
  1219. vllm/transformers_utils/configs/ovis.py +176 -0
  1220. vllm/transformers_utils/configs/qwen3_next.py +275 -0
  1221. vllm/transformers_utils/configs/radio.py +91 -0
  1222. vllm/transformers_utils/configs/speculators/__init__.py +2 -0
  1223. vllm/transformers_utils/configs/speculators/algos.py +32 -0
  1224. vllm/transformers_utils/configs/speculators/base.py +111 -0
  1225. vllm/transformers_utils/configs/step3_vl.py +123 -0
  1226. vllm/transformers_utils/configs/ultravox.py +116 -0
  1227. vllm/transformers_utils/detokenizer_utils.py +199 -0
  1228. vllm/transformers_utils/dynamic_module.py +60 -0
  1229. vllm/transformers_utils/processor.py +299 -0
  1230. vllm/transformers_utils/processors/__init__.py +16 -0
  1231. vllm/transformers_utils/processors/deepseek_vl2.py +362 -0
  1232. vllm/transformers_utils/processors/ovis.py +420 -0
  1233. vllm/transformers_utils/processors/ovis2_5.py +458 -0
  1234. vllm/transformers_utils/runai_utils.py +104 -0
  1235. vllm/transformers_utils/s3_utils.py +93 -0
  1236. vllm/transformers_utils/tokenizer.py +292 -0
  1237. vllm/transformers_utils/tokenizer_base.py +154 -0
  1238. vllm/transformers_utils/tokenizers/__init__.py +10 -0
  1239. vllm/transformers_utils/tokenizers/mistral.py +521 -0
  1240. vllm/transformers_utils/utils.py +108 -0
  1241. vllm/triton_utils/__init__.py +16 -0
  1242. vllm/triton_utils/importing.py +96 -0
  1243. vllm/usage/__init__.py +0 -0
  1244. vllm/usage/usage_lib.py +259 -0
  1245. vllm/utils/__init__.py +3566 -0
  1246. vllm/utils/deep_gemm.py +319 -0
  1247. vllm/utils/flashinfer.py +443 -0
  1248. vllm/utils/jsontree.py +178 -0
  1249. vllm/utils/tensor_schema.py +235 -0
  1250. vllm/v1/__init__.py +0 -0
  1251. vllm/v1/attention/__init__.py +0 -0
  1252. vllm/v1/attention/backends/__init__.py +0 -0
  1253. vllm/v1/attention/backends/cpu_attn.py +919 -0
  1254. vllm/v1/attention/backends/flash_attn.py +795 -0
  1255. vllm/v1/attention/backends/flashinfer.py +1181 -0
  1256. vllm/v1/attention/backends/flex_attention.py +861 -0
  1257. vllm/v1/attention/backends/gdn_attn.py +332 -0
  1258. vllm/v1/attention/backends/linear_attn.py +67 -0
  1259. vllm/v1/attention/backends/mamba1_attn.py +81 -0
  1260. vllm/v1/attention/backends/mamba2_attn.py +232 -0
  1261. vllm/v1/attention/backends/mamba_attn.py +52 -0
  1262. vllm/v1/attention/backends/mla/__init__.py +0 -0
  1263. vllm/v1/attention/backends/mla/common.py +1783 -0
  1264. vllm/v1/attention/backends/mla/cutlass_mla.py +248 -0
  1265. vllm/v1/attention/backends/mla/flashattn_mla.py +271 -0
  1266. vllm/v1/attention/backends/mla/flashinfer_mla.py +114 -0
  1267. vllm/v1/attention/backends/mla/flashmla.py +203 -0
  1268. vllm/v1/attention/backends/mla/flashmla_sparse.py +544 -0
  1269. vllm/v1/attention/backends/mla/indexer.py +342 -0
  1270. vllm/v1/attention/backends/mla/rocm_aiter_mla.py +255 -0
  1271. vllm/v1/attention/backends/mla/triton_mla.py +177 -0
  1272. vllm/v1/attention/backends/pallas.py +409 -0
  1273. vllm/v1/attention/backends/rocm_aiter_fa.py +549 -0
  1274. vllm/v1/attention/backends/rocm_attn.py +426 -0
  1275. vllm/v1/attention/backends/short_conv_attn.py +94 -0
  1276. vllm/v1/attention/backends/tree_attn.py +451 -0
  1277. vllm/v1/attention/backends/triton_attn.py +361 -0
  1278. vllm/v1/attention/backends/utils.py +990 -0
  1279. vllm/v1/attention/backends/xformers.py +438 -0
  1280. vllm/v1/core/__init__.py +0 -0
  1281. vllm/v1/core/block_pool.py +416 -0
  1282. vllm/v1/core/encoder_cache_manager.py +333 -0
  1283. vllm/v1/core/kv_cache_coordinator.py +440 -0
  1284. vllm/v1/core/kv_cache_manager.py +399 -0
  1285. vllm/v1/core/kv_cache_utils.py +1291 -0
  1286. vllm/v1/core/sched/__init__.py +0 -0
  1287. vllm/v1/core/sched/async_scheduler.py +47 -0
  1288. vllm/v1/core/sched/interface.py +158 -0
  1289. vllm/v1/core/sched/output.py +166 -0
  1290. vllm/v1/core/sched/request_queue.py +224 -0
  1291. vllm/v1/core/sched/scheduler.py +1296 -0
  1292. vllm/v1/core/sched/utils.py +69 -0
  1293. vllm/v1/core/single_type_kv_cache_manager.py +671 -0
  1294. vllm/v1/cudagraph_dispatcher.py +125 -0
  1295. vllm/v1/engine/__init__.py +203 -0
  1296. vllm/v1/engine/async_llm.py +742 -0
  1297. vllm/v1/engine/coordinator.py +357 -0
  1298. vllm/v1/engine/core.py +1235 -0
  1299. vllm/v1/engine/core_client.py +1334 -0
  1300. vllm/v1/engine/detokenizer.py +349 -0
  1301. vllm/v1/engine/exceptions.py +17 -0
  1302. vllm/v1/engine/llm_engine.py +370 -0
  1303. vllm/v1/engine/logprobs.py +201 -0
  1304. vllm/v1/engine/output_processor.py +576 -0
  1305. vllm/v1/engine/parallel_sampling.py +133 -0
  1306. vllm/v1/engine/processor.py +545 -0
  1307. vllm/v1/engine/utils.py +860 -0
  1308. vllm/v1/executor/__init__.py +0 -0
  1309. vllm/v1/executor/abstract.py +137 -0
  1310. vllm/v1/executor/multiproc_executor.py +726 -0
  1311. vllm/v1/executor/ray_distributed_executor.py +108 -0
  1312. vllm/v1/executor/utils.py +23 -0
  1313. vllm/v1/kv_cache_interface.py +375 -0
  1314. vllm/v1/kv_offload/__init__.py +0 -0
  1315. vllm/v1/kv_offload/abstract.py +165 -0
  1316. vllm/v1/kv_offload/backend.py +96 -0
  1317. vllm/v1/kv_offload/backends/__init__.py +0 -0
  1318. vllm/v1/kv_offload/backends/cpu.py +61 -0
  1319. vllm/v1/kv_offload/cpu.py +75 -0
  1320. vllm/v1/kv_offload/factory.py +56 -0
  1321. vllm/v1/kv_offload/lru_manager.py +132 -0
  1322. vllm/v1/kv_offload/mediums.py +39 -0
  1323. vllm/v1/kv_offload/spec.py +61 -0
  1324. vllm/v1/kv_offload/worker/__init__.py +0 -0
  1325. vllm/v1/kv_offload/worker/cpu_gpu.py +171 -0
  1326. vllm/v1/kv_offload/worker/worker.py +142 -0
  1327. vllm/v1/metrics/__init__.py +0 -0
  1328. vllm/v1/metrics/loggers.py +741 -0
  1329. vllm/v1/metrics/prometheus.py +82 -0
  1330. vllm/v1/metrics/ray_wrappers.py +152 -0
  1331. vllm/v1/metrics/reader.py +246 -0
  1332. vllm/v1/metrics/stats.py +257 -0
  1333. vllm/v1/outputs.py +161 -0
  1334. vllm/v1/pool/__init__.py +0 -0
  1335. vllm/v1/pool/metadata.py +77 -0
  1336. vllm/v1/request.py +241 -0
  1337. vllm/v1/sample/__init__.py +0 -0
  1338. vllm/v1/sample/logits_processor/__init__.py +294 -0
  1339. vllm/v1/sample/logits_processor/builtin.py +275 -0
  1340. vllm/v1/sample/logits_processor/interface.py +97 -0
  1341. vllm/v1/sample/logits_processor/state.py +161 -0
  1342. vllm/v1/sample/metadata.py +43 -0
  1343. vllm/v1/sample/ops/__init__.py +0 -0
  1344. vllm/v1/sample/ops/bad_words.py +39 -0
  1345. vllm/v1/sample/ops/logprobs.py +26 -0
  1346. vllm/v1/sample/ops/penalties.py +43 -0
  1347. vllm/v1/sample/ops/topk_topp_sampler.py +292 -0
  1348. vllm/v1/sample/rejection_sampler.py +623 -0
  1349. vllm/v1/sample/sampler.py +285 -0
  1350. vllm/v1/sample/tpu/__init__.py +0 -0
  1351. vllm/v1/sample/tpu/metadata.py +124 -0
  1352. vllm/v1/sample/tpu/sampler.py +213 -0
  1353. vllm/v1/serial_utils.py +423 -0
  1354. vllm/v1/spec_decode/__init__.py +0 -0
  1355. vllm/v1/spec_decode/eagle.py +1011 -0
  1356. vllm/v1/spec_decode/medusa.py +66 -0
  1357. vllm/v1/spec_decode/metadata.py +62 -0
  1358. vllm/v1/spec_decode/metrics.py +211 -0
  1359. vllm/v1/spec_decode/ngram_proposer.py +276 -0
  1360. vllm/v1/spec_decode/utils.py +14 -0
  1361. vllm/v1/structured_output/__init__.py +295 -0
  1362. vllm/v1/structured_output/backend_guidance.py +245 -0
  1363. vllm/v1/structured_output/backend_lm_format_enforcer.py +167 -0
  1364. vllm/v1/structured_output/backend_outlines.py +320 -0
  1365. vllm/v1/structured_output/backend_types.py +134 -0
  1366. vllm/v1/structured_output/backend_xgrammar.py +327 -0
  1367. vllm/v1/structured_output/request.py +86 -0
  1368. vllm/v1/structured_output/utils.py +454 -0
  1369. vllm/v1/utils.py +396 -0
  1370. vllm/v1/worker/__init__.py +0 -0
  1371. vllm/v1/worker/block_table.py +210 -0
  1372. vllm/v1/worker/cpu_model_runner.py +175 -0
  1373. vllm/v1/worker/cpu_worker.py +156 -0
  1374. vllm/v1/worker/gpu_input_batch.py +863 -0
  1375. vllm/v1/worker/gpu_model_runner.py +4160 -0
  1376. vllm/v1/worker/gpu_ubatch_wrapper.py +399 -0
  1377. vllm/v1/worker/gpu_worker.py +710 -0
  1378. vllm/v1/worker/kv_connector_model_runner_mixin.py +132 -0
  1379. vllm/v1/worker/lora_model_runner_mixin.py +183 -0
  1380. vllm/v1/worker/tpu_input_batch.py +587 -0
  1381. vllm/v1/worker/tpu_model_runner.py +1946 -0
  1382. vllm/v1/worker/tpu_worker.py +346 -0
  1383. vllm/v1/worker/ubatch_splitting.py +192 -0
  1384. vllm/v1/worker/ubatch_utils.py +27 -0
  1385. vllm/v1/worker/ubatching.py +224 -0
  1386. vllm/v1/worker/utils.py +344 -0
  1387. vllm/v1/worker/worker_base.py +65 -0
  1388. vllm/v1/worker/xpu_model_runner.py +57 -0
  1389. vllm/v1/worker/xpu_worker.py +179 -0
  1390. vllm/version.py +41 -0
  1391. vllm/vllm_flash_attn/.gitkeep +0 -0
  1392. vllm/worker/__init__.py +0 -0
  1393. vllm/worker/worker_base.py +279 -0
  1394. vllm_cpu-0.11.0.post2.dist-info/METADATA +348 -0
  1395. vllm_cpu-0.11.0.post2.dist-info/RECORD +1398 -0
  1396. vllm_cpu-0.11.0.post2.dist-info/WHEEL +5 -0
  1397. vllm_cpu-0.11.0.post2.dist-info/entry_points.txt +5 -0
  1398. vllm_cpu-0.11.0.post2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1890 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+ """Fused MoE Triton kernels."""
4
+ import functools
5
+ import json
6
+ import os
7
+ # torch.compile needs typing.List. It will fail torch.library.infer_schema
8
+ # otherwise
9
+ from typing import List # noqa: UP035
10
+ from typing import Any, Callable, Optional, Union
11
+
12
+ import torch
13
+ import torch.nn.functional as F
14
+
15
+ import vllm.envs as envs
16
+ import vllm.model_executor.layers.fused_moe.modular_kernel as mk
17
+ from vllm import _custom_ops as ops
18
+ from vllm.logger import init_logger
19
+ # yapf: disable
20
+ from vllm.model_executor.layers.fused_moe.config import (
21
+ FUSED_MOE_UNQUANTIZED_CONFIG, FusedMoEQuantConfig, _get_config_dtype_str)
22
+ from vllm.model_executor.layers.fused_moe.cutlass_moe import (
23
+ _valid_cutlass_block_scaled_grouped_gemm,
24
+ run_cutlass_block_scaled_fused_experts)
25
+ # yapf: enable
26
+ from vllm.model_executor.layers.fused_moe.deep_gemm_moe import (
27
+ _valid_deep_gemm, deep_gemm_moe_fp8)
28
+ from vllm.model_executor.layers.fused_moe.moe_align_block_size import (
29
+ moe_align_block_size)
30
+ from vllm.model_executor.layers.fused_moe.prepare_finalize import (
31
+ MoEPrepareAndFinalizeNoEP)
32
+ from vllm.model_executor.layers.fused_moe.topk_weight_and_reduce import (
33
+ TopKWeightAndReduceNoOP)
34
+ from vllm.model_executor.layers.fused_moe.utils import (
35
+ _resize_cache, activation_without_mul, moe_kernel_quantize_input)
36
+ from vllm.model_executor.layers.quantization.utils.mxfp4_utils import (
37
+ dequant_mxfp4)
38
+ from vllm.platforms import current_platform
39
+ from vllm.triton_utils import tl, triton
40
+ from vllm.utils import direct_register_custom_op, is_torch_equal_or_newer
41
+ from vllm.utils.deep_gemm import is_deep_gemm_e8m0_used
42
+
43
+ from .rocm_aiter_fused_moe import is_rocm_aiter_moe_enabled
44
+
45
+ logger = init_logger(__name__)
46
+
47
+
48
+ @triton.jit
49
+ def write_zeros_to_output(c_ptr, stride_cm, stride_cn, pid_n, N, offs_token,
50
+ token_mask, BLOCK_SIZE_M, BLOCK_SIZE_N,
51
+ compute_type):
52
+ accumulator = tl.zeros((BLOCK_SIZE_M, BLOCK_SIZE_N), dtype=compute_type)
53
+ offs_cn = pid_n * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)
54
+ c_ptrs = c_ptr + stride_cm * offs_token[:, None] + stride_cn * offs_cn[
55
+ None, :]
56
+ c_mask = token_mask[:, None] & (offs_cn[None, :] < N)
57
+ tl.store(c_ptrs, accumulator, mask=c_mask)
58
+
59
+
60
+ @triton.jit
61
+ def fused_moe_kernel_gptq_awq(
62
+ # Pointers to matrices
63
+ a_ptr,
64
+ b_ptr,
65
+ c_ptr,
66
+ b_scale_ptr,
67
+ b_zp_ptr,
68
+ topk_weights_ptr,
69
+ sorted_token_ids_ptr,
70
+ expert_ids_ptr,
71
+ num_tokens_post_padded_ptr,
72
+ # Matrix dimensions
73
+ N: tl.constexpr,
74
+ K: tl.constexpr,
75
+ EM,
76
+ num_valid_tokens,
77
+ # The stride variables represent how much to increase the ptr by when
78
+ # moving by 1 element in a particular dimension. E.g. `stride_am` is
79
+ # how much to increase `a_ptr` by to get the element one row down
80
+ # (A has M rows).
81
+ stride_am,
82
+ stride_ak,
83
+ stride_be,
84
+ stride_bk,
85
+ stride_bn,
86
+ stride_cm,
87
+ stride_cn,
88
+ stride_bse,
89
+ stride_bsk,
90
+ stride_bsn,
91
+ stride_bze,
92
+ stride_bzk,
93
+ stride_bzn,
94
+ block_k_diviable: tl.constexpr,
95
+ group_size: tl.constexpr,
96
+ # Meta-parameters
97
+ BLOCK_SIZE_M: tl.constexpr,
98
+ BLOCK_SIZE_N: tl.constexpr,
99
+ BLOCK_SIZE_K: tl.constexpr,
100
+ GROUP_SIZE_M: tl.constexpr,
101
+ MUL_ROUTED_WEIGHT: tl.constexpr,
102
+ top_k: tl.constexpr,
103
+ compute_type: tl.constexpr,
104
+ has_zp: tl.constexpr,
105
+ use_int4_w4a16: tl.constexpr,
106
+ use_int8_w8a16: tl.constexpr):
107
+ """
108
+ Implements the fused computation for a Mixture of Experts (MOE) using
109
+ token and expert matrices.
110
+
111
+ Key Parameters:
112
+ - A: The input tensor representing tokens with shape (*, K), where '*' can
113
+ be any shape representing batches and K is the feature dimension of
114
+ each token.
115
+ - B: The stacked MOE weight tensor with shape (E, N, K), where E is
116
+ the number of experts, K is the input feature dimension, and N is
117
+ the output feature dimension.
118
+ - C: The output cache tensor with shape (M, topk, N), where M is the
119
+ total number of tokens post padding, topk is the number of times
120
+ each token is repeated, and N is the output feature dimension.
121
+ - sorted_token_ids: A tensor containing the sorted indices of tokens,
122
+ repeated topk times and arranged by the expert index they are
123
+ assigned to.
124
+ - expert_ids: A tensor containing the indices of the expert for each
125
+ block. It determines which expert matrix from B should be used for
126
+ each block in A.
127
+ This kernel performs the multiplication of a token by its corresponding
128
+ expert matrix as determined by `expert_ids`. The sorting of
129
+ `sorted_token_ids` by expert index and padding ensures divisibility by
130
+ BLOCK_SIZE_M, which is necessary to maintain consistency in block matrix
131
+ multiplication across different blocks processed by the same expert.
132
+ """
133
+ # -----------------------------------------------------------
134
+ # Map program ids `pid` to the block of C it should compute.
135
+ # This is done in a grouped ordering to promote L2 data reuse.
136
+ pid = tl.program_id(axis=0)
137
+ num_pid_m = tl.cdiv(EM, BLOCK_SIZE_M)
138
+ num_pid_n = tl.cdiv(N, BLOCK_SIZE_N)
139
+ num_pid_in_group = GROUP_SIZE_M * num_pid_n
140
+ group_id = pid // num_pid_in_group
141
+ first_pid_m = group_id * GROUP_SIZE_M
142
+ group_size_m = min(num_pid_m - first_pid_m, GROUP_SIZE_M)
143
+ pid_m = first_pid_m + ((pid % num_pid_in_group) % group_size_m)
144
+ pid_n = (pid % num_pid_in_group) // group_size_m
145
+
146
+ # ----------------------------------------------------------
147
+ # Create pointers for the first blocks of A and B.
148
+ # We will advance this pointer as we move in the K direction
149
+ # and accumulate
150
+ # `a_ptrs` is a block of [BLOCK_SIZE_M, BLOCK_SIZE_K] pointers
151
+ # `b_ptrs` is a block of [BLOCK_SIZE_K, BLOCK_SIZE_N] pointers
152
+ num_tokens_post_padded = tl.load(num_tokens_post_padded_ptr)
153
+ if pid_m * BLOCK_SIZE_M >= num_tokens_post_padded:
154
+ return
155
+ offs_token_id = pid_m * BLOCK_SIZE_M + tl.arange(0, BLOCK_SIZE_M).to(
156
+ tl.int64)
157
+ offs_token = tl.load(sorted_token_ids_ptr + offs_token_id)
158
+ token_mask = offs_token < num_valid_tokens
159
+
160
+ off_experts = tl.load(expert_ids_ptr + pid_m).to(tl.int64)
161
+ if off_experts == -1:
162
+ # -----------------------------------------------------------
163
+ # Write back zeros to the output when the expert is not
164
+ # in the current expert parallel rank.
165
+ write_zeros_to_output(c_ptr, stride_cm, stride_cn, pid_n, N,
166
+ offs_token, token_mask, BLOCK_SIZE_M,
167
+ BLOCK_SIZE_N, compute_type)
168
+ return
169
+
170
+ offs_bn = (pid_n * BLOCK_SIZE_N +
171
+ tl.arange(0, BLOCK_SIZE_N).to(tl.int64)) % N
172
+ offs_k = tl.arange(0, BLOCK_SIZE_K)
173
+ a_ptrs = a_ptr + (offs_token[:, None] // top_k * stride_am +
174
+ offs_k[None, :] * stride_ak)
175
+
176
+ if use_int4_w4a16:
177
+ b_ptrs = b_ptr + off_experts * stride_be + \
178
+ (offs_k[:, None] // 2) * stride_bk + offs_bn[None, :] * \
179
+ stride_bn
180
+ b_shifter = (offs_k[:, None] % 2) * 4
181
+ elif use_int8_w8a16:
182
+ b_ptrs = b_ptr + off_experts * stride_be + \
183
+ offs_k[:, None] * stride_bk + offs_bn[None, :] * stride_bn
184
+
185
+ if not has_zp and use_int4_w4a16:
186
+ b_zp_num = 8
187
+ if not has_zp and use_int8_w8a16:
188
+ b_zp_num = 128
189
+ elif has_zp and use_int4_w4a16:
190
+ b_zp_shifter = (offs_bn[None, :] % 2) * 4
191
+
192
+ # -----------------------------------------------------------
193
+ # Iterate to compute a block of the C matrix.
194
+ # We accumulate into a `[BLOCK_SIZE_M, BLOCK_SIZE_N]` block
195
+ # of fp32 values for higher accuracy.
196
+ # `accumulator` will be converted back to fp16 after the loop.
197
+ accumulator = tl.zeros((BLOCK_SIZE_M, BLOCK_SIZE_N), dtype=tl.float32)
198
+ for k in range(0, tl.cdiv(K, BLOCK_SIZE_K)):
199
+ # Load the next block of A and B, generate a mask by checking the
200
+ # K dimension.
201
+
202
+ if not block_k_diviable:
203
+ k_mask = offs_k[:, None] < K - k * BLOCK_SIZE_K
204
+ k_other = 0.0
205
+ else:
206
+ k_mask = None
207
+ k_other = None
208
+
209
+ a = tl.load(a_ptrs,
210
+ mask=token_mask[:, None] &
211
+ (offs_k[None, :] < K - k * BLOCK_SIZE_K),
212
+ other=0.0)
213
+ b = tl.load(b_ptrs)
214
+ if use_int4_w4a16:
215
+ b = (b >> b_shifter) & 0xF
216
+
217
+ b_scale_ptrs = b_scale_ptr + off_experts * stride_bse + \
218
+ offs_bn[None, :] * stride_bsn + \
219
+ ((offs_k[:, None] + BLOCK_SIZE_K * k) // group_size) * \
220
+ stride_bsk
221
+ b_scale = tl.load(b_scale_ptrs, mask=k_mask, other=k_other)
222
+ b_scale = b_scale.to(tl.float32)
223
+
224
+ if has_zp and use_int4_w4a16:
225
+ offs_k_true = (offs_k[:, None] + BLOCK_SIZE_K * k) // group_size
226
+ b_zp_ptrs = b_zp_ptr + off_experts * stride_bze + \
227
+ (offs_bn[None, :] // 2) * stride_bzn + \
228
+ offs_k_true * stride_bzk
229
+ b_zp = tl.load(b_zp_ptrs, mask=k_mask, other=k_other)
230
+ b_zp = ((b_zp >> b_zp_shifter) & 0xF)
231
+ b_zp = b_zp.to(tl.float32)
232
+ elif has_zp and use_int8_w8a16:
233
+ offs_k_true = (offs_k[:, None] + BLOCK_SIZE_K * k) // group_size
234
+ b_zp_ptrs = b_zp_ptr + off_experts * stride_bze + \
235
+ offs_bn[None, :] * stride_bzn + \
236
+ offs_k_true * stride_bzk
237
+ b_zp = tl.load(b_zp_ptrs, mask=k_mask, other=k_other)
238
+ b_zp = b_zp.to(tl.float32)
239
+
240
+ # We accumulate along the K dimension.
241
+ if has_zp:
242
+ b = ((b.to(tl.float32) - b_zp) * b_scale).to(compute_type)
243
+ else:
244
+ b = ((b.to(tl.float32) - b_zp_num) * b_scale).to(compute_type)
245
+ accumulator = tl.dot(a, b, acc=accumulator)
246
+
247
+ # Advance the ptrs to the next K block.
248
+ a_ptrs += BLOCK_SIZE_K * stride_ak
249
+ if use_int4_w4a16:
250
+ b_ptrs += (BLOCK_SIZE_K // 2) * stride_bk
251
+ else:
252
+ b_ptrs += BLOCK_SIZE_K * stride_bk
253
+
254
+ if MUL_ROUTED_WEIGHT:
255
+ moe_weight = tl.load(topk_weights_ptr + offs_token,
256
+ mask=token_mask,
257
+ other=0)
258
+ accumulator = accumulator * moe_weight[:, None]
259
+
260
+ accumulator = accumulator.to(compute_type)
261
+ # -----------------------------------------------------------
262
+ # Write back the block of the output
263
+ offs_cn = pid_n * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)
264
+ c_ptrs = c_ptr + stride_cm * offs_token[:, None] + stride_cn * offs_cn[
265
+ None, :]
266
+ c_mask = token_mask[:, None] & (offs_cn[None, :] < N)
267
+ tl.store(c_ptrs, accumulator, mask=c_mask)
268
+
269
+
270
+ @triton.jit
271
+ def fused_moe_kernel(
272
+ # Pointers to matrices
273
+ a_ptr,
274
+ b_ptr,
275
+ c_ptr,
276
+ b_bias_ptr,
277
+ a_scale_ptr,
278
+ b_scale_ptr,
279
+ topk_weights_ptr,
280
+ sorted_token_ids_ptr,
281
+ expert_ids_ptr,
282
+ num_tokens_post_padded_ptr,
283
+ # Matrix dimensions
284
+ N,
285
+ K,
286
+ EM,
287
+ num_valid_tokens,
288
+ # The stride variables represent how much to increase the ptr by when
289
+ # moving by 1 element in a particular dimension. E.g. `stride_am` is
290
+ # how much to increase `a_ptr` by to get the element one row down
291
+ # (A has M rows).
292
+ stride_am,
293
+ stride_ak,
294
+ stride_be,
295
+ stride_bk,
296
+ stride_bn,
297
+ stride_cm,
298
+ stride_cn,
299
+ stride_asm,
300
+ stride_ask,
301
+ stride_bse,
302
+ stride_bsk,
303
+ stride_bsn,
304
+ stride_bbe, # bias expert stride
305
+ stride_bbn, # bias N stride
306
+ # Block size for block-wise quantization
307
+ group_n: tl.constexpr,
308
+ group_k: tl.constexpr,
309
+ # Meta-parameters
310
+ BLOCK_SIZE_M: tl.constexpr,
311
+ BLOCK_SIZE_N: tl.constexpr,
312
+ BLOCK_SIZE_K: tl.constexpr,
313
+ GROUP_SIZE_M: tl.constexpr,
314
+ MUL_ROUTED_WEIGHT: tl.constexpr,
315
+ top_k: tl.constexpr,
316
+ compute_type: tl.constexpr,
317
+ use_fp8_w8a8: tl.constexpr,
318
+ use_int8_w8a8: tl.constexpr,
319
+ use_int8_w8a16: tl.constexpr,
320
+ per_channel_quant: tl.constexpr,
321
+ HAS_BIAS: tl.constexpr,
322
+ ):
323
+ """
324
+ Implements the fused computation for a Mixture of Experts (MOE) using
325
+ token and expert matrices.
326
+
327
+ Key Parameters:
328
+ - A: The input tensor representing tokens with shape (*, K), where '*' can
329
+ be any shape representing batches and K is the feature dimension of
330
+ each token.
331
+ - B: The stacked MOE weight tensor with shape (E, N, K), where E is
332
+ the number of experts, K is the input feature dimension, and N is
333
+ the output feature dimension.
334
+ - C: The output cache tensor with shape (M, topk, N), where M is the
335
+ total number of tokens post padding, topk is the number of times
336
+ each token is repeated, and N is the output feature dimension.
337
+ - sorted_token_ids: A tensor containing the sorted indices of tokens,
338
+ repeated topk times and arranged by the expert index they are
339
+ assigned to.
340
+ - expert_ids: A tensor containing the indices of the expert for each
341
+ block. It determines which expert matrix from B should be used for
342
+ each block in A.
343
+ This kernel performs the multiplication of a token by its corresponding
344
+ expert matrix as determined by `expert_ids`. The sorting of
345
+ `sorted_token_ids` by expert index and padding ensures divisibility by
346
+ BLOCK_SIZE_M, which is necessary to maintain consistency in block matrix
347
+ multiplication across different blocks processed by the same expert.
348
+ """
349
+ # -----------------------------------------------------------
350
+ # Map program ids `pid` to the block of C it should compute.
351
+ # This is done in a grouped ordering to promote L2 data reuse.
352
+ pid = tl.program_id(axis=0)
353
+ num_pid_m = tl.cdiv(EM, BLOCK_SIZE_M)
354
+ num_pid_n = tl.cdiv(N, BLOCK_SIZE_N)
355
+ num_pid_in_group = GROUP_SIZE_M * num_pid_n
356
+ group_id = pid // num_pid_in_group
357
+ first_pid_m = group_id * GROUP_SIZE_M
358
+ group_size_m = min(num_pid_m - first_pid_m, GROUP_SIZE_M)
359
+ pid_m = first_pid_m + ((pid % num_pid_in_group) % group_size_m)
360
+ pid_n = (pid % num_pid_in_group) // group_size_m
361
+
362
+ # ----------------------------------------------------------
363
+ # Create pointers for the first blocks of A and B.
364
+ # We will advance this pointer as we move in the K direction
365
+ # and accumulate
366
+ # `a_ptrs` is a block of [BLOCK_SIZE_M, BLOCK_SIZE_K] pointers
367
+ # `b_ptrs` is a block of [BLOCK_SIZE_K, BLOCK_SIZE_N] pointers
368
+ num_tokens_post_padded = tl.load(num_tokens_post_padded_ptr)
369
+ if pid_m * BLOCK_SIZE_M >= num_tokens_post_padded:
370
+ return
371
+ offs_token_id = pid_m * BLOCK_SIZE_M + tl.arange(0, BLOCK_SIZE_M).to(
372
+ tl.int64)
373
+ offs_token = tl.load(sorted_token_ids_ptr + offs_token_id)
374
+ token_mask = offs_token < num_valid_tokens
375
+
376
+ off_experts = tl.load(expert_ids_ptr + pid_m).to(tl.int64)
377
+ if off_experts == -1:
378
+ # -----------------------------------------------------------
379
+ # Write back zeros to the output when the expert is not
380
+ # in the current expert parallel rank.
381
+ write_zeros_to_output(c_ptr, stride_cm, stride_cn, pid_n, N,
382
+ offs_token, token_mask, BLOCK_SIZE_M,
383
+ BLOCK_SIZE_N, compute_type)
384
+ return
385
+
386
+ offs_bn = (pid_n * BLOCK_SIZE_N +
387
+ tl.arange(0, BLOCK_SIZE_N).to(tl.int64)) % N
388
+ offs_k = tl.arange(0, BLOCK_SIZE_K)
389
+ a_ptrs = a_ptr + (offs_token[:, None] // top_k * stride_am +
390
+ offs_k[None, :] * stride_ak)
391
+
392
+ b_ptrs = b_ptr + off_experts * stride_be + (offs_k[:, None] * stride_bk +
393
+ offs_bn[None, :] * stride_bn)
394
+ if use_int8_w8a16:
395
+ b_scale_ptrs = b_scale_ptr + off_experts * stride_bse + offs_bn[
396
+ None, :] * stride_bsn
397
+ b_scale = tl.load(b_scale_ptrs)
398
+
399
+ if use_fp8_w8a8 or use_int8_w8a8:
400
+ # block-wise
401
+ if group_k > 0 and group_n > 0:
402
+ a_scale_ptrs = a_scale_ptr + (offs_token // top_k) * stride_asm
403
+ offs_bsn = offs_bn // group_n
404
+ b_scale_ptrs = (b_scale_ptr + off_experts * stride_bse +
405
+ offs_bsn * stride_bsn)
406
+ # channel-wise
407
+ elif per_channel_quant:
408
+ b_scale_ptrs = b_scale_ptr + off_experts * stride_bse + offs_bn[
409
+ None, :] * stride_bsn
410
+ b_scale = tl.load(b_scale_ptrs)
411
+ # Load per-token scale for activations
412
+ a_scale_ptrs = a_scale_ptr + (offs_token // top_k) * stride_asm
413
+ a_scale = tl.load(a_scale_ptrs, mask=token_mask, other=0.0)[:,
414
+ None]
415
+ # tensor-wise
416
+ else:
417
+ a_scale = tl.load(a_scale_ptr)
418
+ b_scale = tl.load(b_scale_ptr + off_experts)
419
+ if HAS_BIAS:
420
+ # bias shape: [num_experts, N]
421
+ bias_ptrs = b_bias_ptr + off_experts * stride_bbe + offs_bn * stride_bbn
422
+ bias = tl.load(bias_ptrs, mask=(offs_bn < N), other=0.0)
423
+ # -----------------------------------------------------------
424
+ # Iterate to compute a block of the C matrix.
425
+ # We accumulate into a `[BLOCK_SIZE_M, BLOCK_SIZE_N]` block
426
+ # of fp32 values for higher accuracy.
427
+ # `accumulator` will be converted back to fp16 after the loop.
428
+ accumulator = tl.zeros((BLOCK_SIZE_M, BLOCK_SIZE_N), dtype=tl.float32)
429
+ for k in range(0, tl.cdiv(K, BLOCK_SIZE_K)):
430
+ # Load the next block of A and B, generate a mask by checking the
431
+ # K dimension.
432
+ a = tl.load(a_ptrs,
433
+ mask=token_mask[:, None] &
434
+ (offs_k[None, :] < K - k * BLOCK_SIZE_K),
435
+ other=0.0)
436
+ b = tl.load(b_ptrs,
437
+ mask=offs_k[:, None] < K - k * BLOCK_SIZE_K,
438
+ other=0.0)
439
+ # We accumulate along the K dimension.
440
+ if use_int8_w8a16:
441
+ accumulator = tl.dot(a, b.to(compute_type), acc=accumulator)
442
+ elif use_fp8_w8a8 or use_int8_w8a8:
443
+ if group_k > 0 and group_n > 0:
444
+ k_start = k * BLOCK_SIZE_K
445
+ offs_ks = k_start // group_k
446
+ a_scale = tl.load(a_scale_ptrs + offs_ks * stride_ask,
447
+ mask=token_mask,
448
+ other=0.0)
449
+ b_scale = tl.load(b_scale_ptrs + offs_ks * stride_bsk)
450
+
451
+ accumulator += tl.dot(a, b) * a_scale[:,
452
+ None] * b_scale[None, :]
453
+ else:
454
+ if use_fp8_w8a8:
455
+ # acc used to enable fp8_fast_accum
456
+ accumulator = tl.dot(a, b, acc=accumulator)
457
+ else:
458
+ accumulator += tl.dot(a, b)
459
+ else:
460
+ accumulator += tl.dot(a, b)
461
+ # Advance the ptrs to the next K block.
462
+ a_ptrs += BLOCK_SIZE_K * stride_ak
463
+ b_ptrs += BLOCK_SIZE_K * stride_bk
464
+ if HAS_BIAS:
465
+ accumulator = accumulator + bias[None, :]
466
+ if MUL_ROUTED_WEIGHT:
467
+ moe_weight = tl.load(topk_weights_ptr + offs_token,
468
+ mask=token_mask,
469
+ other=0)
470
+ accumulator = accumulator * moe_weight[:, None]
471
+ if use_int8_w8a16:
472
+ accumulator = (accumulator * b_scale).to(compute_type)
473
+ elif use_fp8_w8a8 or use_int8_w8a8:
474
+ if group_k > 0 and group_n > 0:
475
+ accumulator = accumulator.to(compute_type)
476
+ else:
477
+ accumulator = (accumulator * a_scale * b_scale).to(compute_type)
478
+ else:
479
+ accumulator = accumulator.to(compute_type)
480
+
481
+ # -----------------------------------------------------------
482
+ # Write back the block of the output
483
+ offs_cn = pid_n * BLOCK_SIZE_N + tl.arange(0, BLOCK_SIZE_N)
484
+ c_ptrs = c_ptr + stride_cm * offs_token[:, None] + stride_cn * offs_cn[
485
+ None, :]
486
+ c_mask = token_mask[:, None] & (offs_cn[None, :] < N)
487
+ tl.store(c_ptrs, accumulator, mask=c_mask)
488
+
489
+
490
+ def invoke_fused_moe_kernel(A: torch.Tensor,
491
+ B: torch.Tensor,
492
+ C: torch.Tensor,
493
+ A_scale: Optional[torch.Tensor],
494
+ B_scale: Optional[torch.Tensor],
495
+ B_zp: Optional[torch.Tensor],
496
+ topk_weights: Optional[torch.Tensor],
497
+ sorted_token_ids: torch.Tensor,
498
+ expert_ids: torch.Tensor,
499
+ num_tokens_post_padded: torch.Tensor,
500
+ mul_routed_weight: bool,
501
+ top_k: int,
502
+ config: dict[str, Any],
503
+ compute_type: tl.dtype,
504
+ use_fp8_w8a8: bool,
505
+ use_int8_w8a8: bool,
506
+ use_int8_w8a16: bool,
507
+ use_int4_w4a16: bool,
508
+ per_channel_quant: bool,
509
+ block_shape: Optional[list[int]] = None,
510
+ B_bias: Optional[torch.Tensor] = None) -> None:
511
+ assert topk_weights is not None or not mul_routed_weight
512
+ assert topk_weights is None or topk_weights.stride(1) == 1
513
+ assert sorted_token_ids.stride(0) == 1
514
+
515
+ if use_fp8_w8a8 or use_int8_w8a8:
516
+ assert B_scale is not None
517
+ assert (block_shape is None
518
+ or triton.cdiv(B.size(-2), block_shape[0]) == B_scale.size(-2))
519
+ assert (block_shape is None
520
+ or triton.cdiv(B.size(-1), block_shape[1]) == B_scale.size(-1))
521
+
522
+ elif use_int8_w8a16 or use_int4_w4a16:
523
+ assert B_scale is not None
524
+ assert block_shape is None or block_shape[0] == 0
525
+ else:
526
+ assert A_scale is None
527
+ assert B_scale is None
528
+
529
+ M = A.size(0)
530
+ num_tokens = M * top_k
531
+
532
+ EM = sorted_token_ids.size(0)
533
+ if A.size(0) < config["BLOCK_SIZE_M"]:
534
+ # optimize for small batch_size.
535
+ # We assume that top_ids of each token is unique,
536
+ # so num_valid_experts <= batch_size <= BLOCK_SIZE_M,
537
+ # and we can skip some invalid blocks.
538
+ EM = min(sorted_token_ids.size(0),
539
+ A.size(0) * top_k * config['BLOCK_SIZE_M'])
540
+ grid = lambda META: (triton.cdiv(EM, META['BLOCK_SIZE_M']) * triton.cdiv(
541
+ B.size(1), META['BLOCK_SIZE_N']), )
542
+ HAS_BIAS = B_bias is not None
543
+ if (use_int8_w8a16 or use_int4_w4a16) and \
544
+ block_shape is not None and block_shape[1] > 0:
545
+ assert B_scale is not None and B_scale.ndim == 3
546
+ assert B_zp is None or B_zp.ndim == 3
547
+
548
+ use_moe_wna16_cuda = should_moe_wna16_use_cuda(
549
+ num_valid_tokens=num_tokens,
550
+ group_size=block_shape[1],
551
+ num_experts=B.size(0),
552
+ bit=4 if use_int4_w4a16 else 8)
553
+ config = config.copy()
554
+ config.update(
555
+ get_moe_wna16_block_config(config=config,
556
+ use_moe_wna16_cuda=use_moe_wna16_cuda,
557
+ num_valid_tokens=num_tokens,
558
+ size_k=A.size(1),
559
+ size_n=B.size(1),
560
+ num_experts=B.size(1),
561
+ group_size=block_shape[1],
562
+ real_top_k=top_k,
563
+ block_size_m=config["BLOCK_SIZE_M"]))
564
+
565
+ if use_moe_wna16_cuda:
566
+ bit = 4 if use_int4_w4a16 else 8
567
+ ops.moe_wna16_gemm(A, C, B, B_scale, B_zp,
568
+ topk_weights if mul_routed_weight else None,
569
+ sorted_token_ids, expert_ids,
570
+ num_tokens_post_padded, top_k,
571
+ config["BLOCK_SIZE_M"], config["BLOCK_SIZE_N"],
572
+ config["BLOCK_SIZE_K"], bit)
573
+ return
574
+
575
+ fused_moe_kernel_gptq_awq[grid](
576
+ A,
577
+ B,
578
+ C,
579
+ B_scale,
580
+ B_zp,
581
+ topk_weights,
582
+ sorted_token_ids,
583
+ expert_ids,
584
+ num_tokens_post_padded,
585
+ B.size(1),
586
+ A.size(1),
587
+ EM,
588
+ num_tokens,
589
+ A.stride(0),
590
+ A.stride(1),
591
+ B.stride(0),
592
+ B.stride(2),
593
+ B.stride(1),
594
+ C.stride(1),
595
+ C.stride(2),
596
+ B_scale.stride(0),
597
+ B_scale.stride(2),
598
+ B_scale.stride(1),
599
+ B_zp.stride(0) if B_zp is not None else 0,
600
+ B_zp.stride(2) if B_zp is not None else 0,
601
+ B_zp.stride(1) if B_zp is not None else 0,
602
+ block_k_diviable=A.size(1) % config["BLOCK_SIZE_K"] == 0,
603
+ group_size=block_shape[1],
604
+ MUL_ROUTED_WEIGHT=mul_routed_weight,
605
+ top_k=top_k,
606
+ compute_type=compute_type,
607
+ has_zp=B_zp is not None,
608
+ use_int4_w4a16=use_int4_w4a16,
609
+ use_int8_w8a16=use_int8_w8a16,
610
+ **config,
611
+ )
612
+ else:
613
+ config = config.copy()
614
+ BLOCK_SIZE_K = config.pop("BLOCK_SIZE_K")
615
+ if block_shape is not None:
616
+ BLOCK_SIZE_K = min(BLOCK_SIZE_K, min(block_shape[0],
617
+ block_shape[1]))
618
+ fused_moe_kernel[grid](
619
+ A,
620
+ B,
621
+ C,
622
+ B_bias,
623
+ A_scale,
624
+ B_scale,
625
+ topk_weights,
626
+ sorted_token_ids,
627
+ expert_ids,
628
+ num_tokens_post_padded,
629
+ B.size(1),
630
+ B.size(2),
631
+ EM,
632
+ num_tokens,
633
+ A.stride(0),
634
+ A.stride(1),
635
+ B.stride(0),
636
+ B.stride(2),
637
+ B.stride(1),
638
+ C.stride(1),
639
+ C.stride(2),
640
+ A_scale.stride(0)
641
+ if A_scale is not None and A_scale.ndim == 2 else 0,
642
+ A_scale.stride(1)
643
+ if A_scale is not None and A_scale.ndim == 2 else 0,
644
+ B_scale.stride(0)
645
+ if B_scale is not None and B_scale.ndim >= 2 else 0,
646
+ B_scale.stride(2)
647
+ if B_scale is not None and B_scale.ndim == 3 else 0,
648
+ B_scale.stride(1)
649
+ if B_scale is not None and B_scale.ndim >= 2 else 0,
650
+ B_bias.stride(0) if B_bias is not None else 0,
651
+ B_bias.stride(1) if B_bias is not None else 0,
652
+ 0 if block_shape is None else block_shape[0],
653
+ 0 if block_shape is None else block_shape[1],
654
+ MUL_ROUTED_WEIGHT=mul_routed_weight,
655
+ top_k=top_k,
656
+ compute_type=compute_type,
657
+ use_fp8_w8a8=use_fp8_w8a8,
658
+ use_int8_w8a8=use_int8_w8a8,
659
+ use_int8_w8a16=use_int8_w8a16,
660
+ per_channel_quant=per_channel_quant,
661
+ HAS_BIAS=HAS_BIAS,
662
+ BLOCK_SIZE_K=BLOCK_SIZE_K,
663
+ **config,
664
+ )
665
+
666
+
667
+ @triton.jit
668
+ def compute_identity_kernel(
669
+ top_k: int,
670
+ hidden_states_ptr: tl.tensor,
671
+ expert_scales_ptr: tl.tensor,
672
+ num_tokens: int,
673
+ output_ptr: tl.tensor,
674
+ hidden_dim: int,
675
+ scales_stride: int,
676
+ BLOCK_SIZE: tl.constexpr,
677
+ ) -> None:
678
+ pid = tl.program_id(0)
679
+
680
+ batch_id = pid // (hidden_dim // BLOCK_SIZE)
681
+ dim_offset = pid % (hidden_dim // BLOCK_SIZE) * BLOCK_SIZE
682
+
683
+ if batch_id >= num_tokens or dim_offset >= hidden_dim:
684
+ return
685
+
686
+ h = tl.load(hidden_states_ptr + batch_id * hidden_dim + dim_offset +
687
+ tl.arange(0, BLOCK_SIZE),
688
+ mask=(dim_offset + tl.arange(0, BLOCK_SIZE)) < hidden_dim)
689
+
690
+ result = tl.zeros([BLOCK_SIZE], dtype=tl.float32)
691
+ for i in range(top_k):
692
+ scale = tl.load(expert_scales_ptr + batch_id * scales_stride + i)
693
+ result += h * scale
694
+
695
+ tl.store(output_ptr + batch_id * hidden_dim + dim_offset +
696
+ tl.arange(0, BLOCK_SIZE),
697
+ result,
698
+ mask=(dim_offset + tl.arange(0, BLOCK_SIZE)) < hidden_dim)
699
+
700
+
701
+ def zero_experts_compute_triton(expert_indices: torch.Tensor,
702
+ expert_scales: torch.Tensor, num_experts: int,
703
+ zero_expert_type: str,
704
+ hidden_states: torch.Tensor) -> torch.Tensor:
705
+ N = expert_indices.numel()
706
+ top_k = expert_indices.size(-1)
707
+ grid = lambda meta: (triton.cdiv(N, meta['BLOCK_SIZE']), )
708
+
709
+ if zero_expert_type == "identity":
710
+ zero_expert_mask = expert_indices < num_experts
711
+ zero_expert_scales = expert_scales.clone()
712
+ zero_expert_scales[zero_expert_mask] = 0.0
713
+
714
+ normal_expert_mask = expert_indices >= num_experts
715
+ expert_indices[normal_expert_mask] = 0
716
+ expert_scales[normal_expert_mask] = 0.0
717
+
718
+ output = torch.zeros_like(hidden_states).to(hidden_states.device)
719
+ hidden_dim = hidden_states.size(-1)
720
+ num_tokens = hidden_states.size(0)
721
+
722
+ grid = lambda meta: (num_tokens * (hidden_dim // meta['BLOCK_SIZE']), )
723
+ compute_identity_kernel[grid](
724
+ top_k,
725
+ hidden_states,
726
+ zero_expert_scales,
727
+ num_tokens,
728
+ output,
729
+ hidden_dim,
730
+ zero_expert_scales.stride(0),
731
+ BLOCK_SIZE=256,
732
+ )
733
+
734
+ return output
735
+
736
+
737
+ # Adapted from: https://github.com/sgl-project/sglang/pull/2628
738
+ def get_config_file_name(E: int,
739
+ N: int,
740
+ dtype: Optional[str],
741
+ block_shape: Optional[list[int]] = None) -> str:
742
+ device_name = current_platform.get_device_name().replace(" ", "_")
743
+ dtype_selector = "" if not dtype else f",dtype={dtype}"
744
+ block_shape_selector = ("" if not block_shape or not all(block_shape) else
745
+ f",block_shape={block_shape}").replace(" ", "")
746
+ return f"E={E},N={N},device_name={device_name}{dtype_selector}{block_shape_selector}.json" # noqa: E501
747
+
748
+
749
+ # Adapted from: https://github.com/sgl-project/sglang/pull/2628
750
+ @functools.lru_cache
751
+ def get_moe_configs(
752
+ E: int,
753
+ N: int,
754
+ dtype: Optional[str],
755
+ block_n: Optional[int] = None,
756
+ block_k: Optional[int] = None,
757
+ ) -> Optional[dict[int, Any]]:
758
+ """
759
+ Return optimized configurations for the fused MoE kernel.
760
+
761
+ The return value will be a dictionary that maps an irregular grid of
762
+ batch sizes to configurations of the fused_moe kernel. To evaluate the
763
+ kernel on a given batch size bs, the closest batch size in the grid should
764
+ be picked and the associated configuration chosen to invoke the kernel.
765
+ """
766
+
767
+ # First look up if an optimized configuration is available in the configs
768
+ # directory
769
+ block_shape = [block_n, block_k] if block_n and block_k else None
770
+ json_file_name = get_config_file_name(E, N, dtype, block_shape)
771
+
772
+ config_file_paths = []
773
+
774
+ # note that we prioritize user defined config
775
+ user_defined_config_folder = envs.VLLM_TUNED_CONFIG_FOLDER
776
+ if user_defined_config_folder is not None:
777
+ user_defined_config_file_path = os.path.join(
778
+ user_defined_config_folder, json_file_name)
779
+ config_file_paths.append(user_defined_config_file_path)
780
+
781
+ default_config_file_path = os.path.join(
782
+ os.path.dirname(os.path.realpath(__file__)), "configs", json_file_name)
783
+ config_file_paths.append(default_config_file_path)
784
+
785
+ for config_file_path in config_file_paths:
786
+ if os.path.exists(config_file_path):
787
+ with open(config_file_path) as f:
788
+ logger.info("Using configuration from %s for MoE layer.",
789
+ config_file_path)
790
+ # If a configuration has been found, return it
791
+ tuned_config = json.load(f)
792
+ # Delete triton_version from tuned_config
793
+ tuned_config.pop("triton_version", None)
794
+ return {int(key): val for key, val in tuned_config.items()}
795
+
796
+ # If no optimized configuration is available, we will use the default
797
+ # configuration
798
+ logger.warning(
799
+ ("Using default MoE config. Performance might be sub-optimal! "
800
+ "Config file not found at %s"), config_file_paths)
801
+ return None
802
+
803
+
804
+ def get_moe_wna16_block_config(config: dict[str,
805
+ int], use_moe_wna16_cuda: bool,
806
+ num_valid_tokens: int, size_k: int, size_n: int,
807
+ num_experts: int, group_size: int,
808
+ real_top_k: int, block_size_m: int):
809
+ if "BLOCK_SIZE_N" in config and "BLOCK_SIZE_K" in config:
810
+ # optimal block config is set
811
+ return {}
812
+ if not use_moe_wna16_cuda:
813
+ # triton moe wna16 kernel
814
+ if num_valid_tokens // real_top_k == 1:
815
+ # if bs=1, use a smaller BLOCK_SIZE_N
816
+ return {"BLOCK_SIZE_N": 32, "BLOCK_SIZE_K": 64}
817
+ else:
818
+ return {"BLOCK_SIZE_N": 64, "BLOCK_SIZE_K": 32}
819
+ else:
820
+ # cuda moe wna16 kernel
821
+ # set default block_size 128, and increase them when num_blocks
822
+ # is too large.
823
+ block_size_n = 128
824
+ block_size_k = 128
825
+ if block_size_k <= group_size:
826
+ block_size_k = group_size
827
+
828
+ num_n_blocks = size_k // block_size_k
829
+ num_k_blocks = size_n // block_size_k
830
+ num_m_blocks = (num_valid_tokens + block_size_m - 1) / block_size_m + \
831
+ num_experts
832
+ if num_valid_tokens // real_top_k <= block_size_m:
833
+ num_m_blocks = min(num_m_blocks, num_valid_tokens)
834
+ num_blocks = num_m_blocks * num_n_blocks * num_k_blocks
835
+
836
+ if size_k % 256 == 0 and num_blocks >= 256 and \
837
+ block_size_k < 256:
838
+ block_size_k = 256
839
+ num_blocks = num_blocks // (256 // block_size_k)
840
+
841
+ if num_m_blocks <= 16 and size_k % (block_size_k * 2) == 0 and \
842
+ size_k % (block_size_k * 2) == 0 and block_size_k <= 512 and \
843
+ num_blocks >= 512:
844
+ block_size_k = block_size_k * 2
845
+ num_blocks = num_blocks // 2
846
+
847
+ if num_blocks > 1024:
848
+ block_size_n = 256
849
+ num_n_blocks = num_n_blocks // 2
850
+ num_blocks = num_blocks // 2
851
+
852
+ if size_n <= 1024 and num_blocks >= 1024:
853
+ # The kernel performance got much better with BLOCK_SIZE_N=1024
854
+ # when num_blocks is large, event when N is small.
855
+ # Not sure why, maybe it force the CUDA SM process only one block
856
+ # at the same time.
857
+ block_size_n = 1024
858
+
859
+ return {"BLOCK_SIZE_N": block_size_n, "BLOCK_SIZE_K": block_size_k}
860
+
861
+
862
+ def should_moe_wna16_use_cuda(num_valid_tokens: int, group_size: int,
863
+ num_experts: int, bit: int):
864
+ return current_platform.is_cuda() and bit == 4 and \
865
+ group_size in [32, 64, 128] and num_valid_tokens / num_experts <= 6
866
+
867
+
868
+ def get_default_config(
869
+ M: int,
870
+ E: int,
871
+ N: int,
872
+ K: int,
873
+ topk: int,
874
+ dtype: Optional[str],
875
+ block_shape: Optional[list[int]] = None,
876
+ ) -> dict[str, int]:
877
+ if dtype == "fp8_w8a8" and block_shape is not None:
878
+ # Block-wise quant: BLOCK_SIZE_N must be divisible by block_shape[0]
879
+ # BLOCK_SIZE_K must be divisible by block_shape[1]
880
+ # num_stages=3 can cause triton.runtime.errors.OutOfResources
881
+ # on ROCm, set it to 2 instead.
882
+ config = {
883
+ "BLOCK_SIZE_M": 64,
884
+ "BLOCK_SIZE_N": block_shape[0],
885
+ "BLOCK_SIZE_K": block_shape[1],
886
+ "GROUP_SIZE_M": 32,
887
+ "num_warps": 4,
888
+ "num_stages": 3 if not current_platform.is_rocm() else 2,
889
+ }
890
+ elif dtype in ["int4_w4a16", "int8_w8a16"] and block_shape is not None:
891
+ # moe wna16 kernels
892
+ # only set BLOCK_SIZE_M
893
+ # BLOCK_SIZE_N and BLOCK_SIZE_K would be set later
894
+ bit = 4 if dtype == "int4_w4a16" else 8
895
+ use_moe_wna16_cuda = should_moe_wna16_use_cuda(M * topk,
896
+ block_shape[1], E, bit)
897
+ if use_moe_wna16_cuda:
898
+ config = {"BLOCK_SIZE_M": min(16, M)}
899
+ elif M <= 20:
900
+ config = {"BLOCK_SIZE_M": 16, "GROUP_SIZE_M": 1}
901
+ elif M <= 40:
902
+ config = {"BLOCK_SIZE_M": 32, "GROUP_SIZE_M": 1}
903
+ else:
904
+ config = {"BLOCK_SIZE_M": 64, "GROUP_SIZE_M": 1}
905
+ elif M <= E:
906
+ config = {
907
+ "BLOCK_SIZE_M": 16,
908
+ "BLOCK_SIZE_N": 32,
909
+ "BLOCK_SIZE_K": 64,
910
+ "GROUP_SIZE_M": 1,
911
+ }
912
+ else:
913
+ config = {
914
+ "BLOCK_SIZE_M": 64,
915
+ "BLOCK_SIZE_N": 64,
916
+ "BLOCK_SIZE_K": 32,
917
+ "GROUP_SIZE_M": 8,
918
+ }
919
+ return config
920
+
921
+
922
+ def try_get_optimal_moe_config(
923
+ w1_shape: tuple[int, ...],
924
+ w2_shape: tuple[int, ...],
925
+ top_k: int,
926
+ dtype: Optional[str],
927
+ M: int,
928
+ block_shape: Optional[list[int]] = None,
929
+ ) -> dict[str, int]:
930
+ from vllm.model_executor.layers.fused_moe import get_config
931
+ override_config = get_config()
932
+ if override_config:
933
+ config = override_config
934
+ else:
935
+ # First try to load optimal config from the file
936
+ E, _, N = w2_shape
937
+ if dtype == "int4_w4a16":
938
+ N = N * 2
939
+ block_n = block_shape[0] if block_shape else 0
940
+ block_k = block_shape[1] if block_shape else 0
941
+ configs = get_moe_configs(E, N, dtype, block_n, block_k)
942
+
943
+ if configs:
944
+ # If an optimal configuration map has been found, look up the
945
+ # optimal config
946
+ config = configs[min(configs.keys(), key=lambda x: abs(x - M))]
947
+ else:
948
+ # Else use the default config
949
+ config = get_default_config(M, E, N, w1_shape[2], top_k, dtype,
950
+ block_shape)
951
+ return config
952
+
953
+
954
+ def vllm_topk_softmax(topk_weights: torch.Tensor, topk_indices: torch.Tensor,
955
+ token_expert_indices: torch.Tensor,
956
+ gating_output: torch.Tensor,
957
+ renormalize: bool) -> tuple[torch.Tensor, ...]:
958
+ ops.topk_softmax(
959
+ topk_weights,
960
+ topk_indices,
961
+ token_expert_indices,
962
+ gating_output,
963
+ )
964
+ if renormalize:
965
+ topk_weights = topk_weights / topk_weights.sum(dim=-1, keepdim=True)
966
+
967
+ return topk_weights, topk_indices
968
+
969
+
970
+ def dispatch_topk_func() -> Callable[..., tuple[torch.Tensor, ...]]:
971
+ if is_rocm_aiter_moe_enabled():
972
+ from .rocm_aiter_fused_moe import rocm_aiter_topk_softmax
973
+ return rocm_aiter_topk_softmax
974
+ return vllm_topk_softmax
975
+
976
+
977
+ def fused_topk(
978
+ hidden_states: torch.Tensor,
979
+ gating_output: torch.Tensor,
980
+ topk: int,
981
+ renormalize: bool,
982
+ indices_type: Optional[torch.dtype] = None,
983
+ ) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
984
+ assert hidden_states.size(0) == gating_output.size(0), (
985
+ "Number of tokens mismatch")
986
+
987
+ M, _ = hidden_states.size()
988
+
989
+ topk_weights = torch.empty(M,
990
+ topk,
991
+ dtype=torch.float32,
992
+ device=hidden_states.device)
993
+ topk_ids = torch.empty(
994
+ M,
995
+ topk,
996
+ dtype=torch.int32 if indices_type is None else indices_type,
997
+ device=hidden_states.device)
998
+ token_expert_indices = torch.empty(M,
999
+ topk,
1000
+ dtype=torch.int32,
1001
+ device=hidden_states.device)
1002
+
1003
+ gating_output_float = gating_output.float() # TODO(woosuk): Optimize this.
1004
+
1005
+ topk_func = dispatch_topk_func()
1006
+ topk_weights, topk_ids = topk_func(topk_weights, topk_ids,
1007
+ token_expert_indices,
1008
+ gating_output_float, renormalize)
1009
+
1010
+ return topk_weights, topk_ids, token_expert_indices
1011
+
1012
+
1013
+ def fused_topk_bias(
1014
+ hidden_states: torch.Tensor,
1015
+ gating_output: torch.Tensor,
1016
+ e_score_correction_bias: torch.Tensor,
1017
+ topk: int,
1018
+ renormalize: bool,
1019
+ ):
1020
+ n_routed_experts = gating_output.shape[-1]
1021
+ scores = gating_output.softmax(dim=-1)
1022
+ scores_for_choice = scores.view(
1023
+ -1, n_routed_experts) + e_score_correction_bias.unsqueeze(0)
1024
+ topk_indices = torch.topk(scores_for_choice, k=topk, dim=-1,
1025
+ sorted=False)[1]
1026
+ topk_weights = scores.gather(1, topk_indices)
1027
+ if renormalize:
1028
+ topk_weights = topk_weights / topk_weights.sum(dim=-1, keepdim=True)
1029
+ return topk_weights.to(torch.float32), topk_indices.to(torch.int32)
1030
+
1031
+
1032
+ # This is used by the Deepseek-V2 and Deepseek-V3 model
1033
+ @torch.compile(dynamic=True, backend=current_platform.simple_compile_backend)
1034
+ def grouped_topk(
1035
+ hidden_states: torch.Tensor,
1036
+ gating_output: torch.Tensor,
1037
+ topk: int,
1038
+ renormalize: bool,
1039
+ num_expert_group: int = 0,
1040
+ topk_group: int = 0,
1041
+ scoring_func: str = "softmax",
1042
+ routed_scaling_factor: float = 1.0,
1043
+ e_score_correction_bias: Optional[torch.Tensor] = None,
1044
+ ) -> tuple[torch.Tensor, torch.Tensor]:
1045
+ if envs.VLLM_USE_FUSED_MOE_GROUPED_TOPK and \
1046
+ current_platform.is_cuda() and \
1047
+ num_expert_group <= 32 and topk <= 32 and \
1048
+ e_score_correction_bias is not None:
1049
+ return fused_grouped_topk(
1050
+ hidden_states=hidden_states,
1051
+ gating_output=gating_output,
1052
+ topk=topk,
1053
+ renormalize=renormalize,
1054
+ e_score_correction_bias=e_score_correction_bias,
1055
+ num_expert_group=num_expert_group,
1056
+ topk_group=topk_group,
1057
+ scoring_func=scoring_func,
1058
+ routed_scaling_factor=routed_scaling_factor)
1059
+
1060
+ assert hidden_states.size(0) == gating_output.size(0), (
1061
+ "Number of tokens mismatch")
1062
+
1063
+ if scoring_func == "softmax":
1064
+ scores = torch.softmax(gating_output, dim=-1)
1065
+ elif scoring_func == "sigmoid":
1066
+ scores = gating_output.sigmoid()
1067
+ else:
1068
+ raise ValueError(f"Unsupported scoring function: {scoring_func}")
1069
+
1070
+ num_token = scores.size(0)
1071
+ if e_score_correction_bias is not None:
1072
+ # Store original scores before applying correction bias. We use biased
1073
+ # scores for expert selection but original scores for routing weights
1074
+ original_scores = scores
1075
+ scores = scores + e_score_correction_bias.unsqueeze(0)
1076
+ group_scores = (scores.view(num_token, num_expert_group,
1077
+ -1).topk(2, dim=-1)[0].sum(dim=-1))
1078
+ else:
1079
+ group_scores = scores.view(num_token, num_expert_group,
1080
+ -1).max(dim=-1).values # [n, n_group]
1081
+ group_idx = torch.topk(group_scores, k=topk_group, dim=-1,
1082
+ sorted=False)[1] # [n, top_k_group]
1083
+ group_mask = torch.zeros_like(group_scores) # [n, n_group]
1084
+ group_mask.scatter_(1, group_idx, 1) # [n, n_group]
1085
+ score_mask = group_mask.unsqueeze(-1).expand(
1086
+ num_token, num_expert_group,
1087
+ scores.size(-1) // num_expert_group).reshape(num_token, -1) # [n, e]
1088
+ tmp_scores = scores.masked_fill(~score_mask.bool(),
1089
+ float("-inf")) # [n, e]
1090
+
1091
+ if e_score_correction_bias is not None:
1092
+ topk_ids = torch.topk(tmp_scores, k=topk, dim=-1, sorted=False)[1]
1093
+ # Use original unbiased scores for the routing weights
1094
+ topk_weights = original_scores.gather(1, topk_ids)
1095
+ else:
1096
+ topk_weights, topk_ids = torch.topk(tmp_scores,
1097
+ k=topk,
1098
+ dim=-1,
1099
+ sorted=False)
1100
+
1101
+ if renormalize:
1102
+ topk_weights = topk_weights / topk_weights.sum(dim=-1, keepdim=True)
1103
+
1104
+ if routed_scaling_factor != 1.0:
1105
+ topk_weights = topk_weights * routed_scaling_factor
1106
+ return topk_weights.to(torch.float32), topk_ids.to(torch.int32)
1107
+
1108
+
1109
+ @torch.compile(dynamic=True, backend=current_platform.simple_compile_backend)
1110
+ def eplb_map_to_physical_and_record(
1111
+ topk_ids: torch.Tensor,
1112
+ expert_load_view: torch.Tensor,
1113
+ logical_to_physical_map: torch.Tensor,
1114
+ logical_replica_count: torch.Tensor,
1115
+ indices_type: Optional[torch.dtype] = None) -> torch.Tensor:
1116
+ '''
1117
+ Map the logical expert ids to physical expert ids
1118
+ and record the expert load metrics.
1119
+
1120
+ This will select a pseudo-random replica for each logical expert.
1121
+ Only used for EPLB.
1122
+
1123
+ Args:
1124
+ topk_ids: The logical expert ids.
1125
+ expert_load_view: The expert load view.
1126
+ logical_to_physical_map: The logical to physical map.
1127
+ logical_replica_count: The logical replica count.
1128
+ indices_type: The indices type.
1129
+
1130
+ Returns:
1131
+ The physical expert ids.
1132
+ '''
1133
+
1134
+ # 1. Convert the logical expert ids to physical expert ids
1135
+ # Directly select a random replica for each logical expert
1136
+
1137
+ # In case `indices_type` is not `torch.long` or `torch.int`,
1138
+ # e.g. `torch.uint32` as required by dispatch/combine kernels
1139
+ topk_ids_long = topk_ids.long()
1140
+ # Use (token position) modulo (replica count)
1141
+ # to deterministically choose a replica
1142
+ replica_count = logical_replica_count[topk_ids_long]
1143
+ # Flatten-position based index, reshaped back to `topk_ids` shape
1144
+ pos_indices = torch.arange(topk_ids.numel(),
1145
+ device=topk_ids.device,
1146
+ dtype=torch.long).reshape_as(topk_ids)
1147
+ # Compute pseudo-random indices by modulo
1148
+ replica_indices = (pos_indices % replica_count).unsqueeze(-1)
1149
+ physical_ids = logical_to_physical_map[topk_ids_long].gather(
1150
+ -1, replica_indices).squeeze(-1)
1151
+
1152
+ topk_ids = physical_ids
1153
+
1154
+ # 2. Record expert load metrics.
1155
+
1156
+ # TODO(bowen): When using `FusedMoEModularKernel`, this
1157
+ # can be done in a more unified way, since
1158
+ # `FusedMoEPrepareAndFinalize` will return the expert
1159
+ # token count, in some cases directly from the kernel.
1160
+ # However, now there are many code paths not using
1161
+ # the modular kernel, e.g. calling `fused_experts`,
1162
+ # so we decide to keep the logic here.
1163
+ #
1164
+ # If later refactor moved all the MoE kernel calls
1165
+ # to the modular kernel, we can move this logic there
1166
+ # to achieve better efficiency.
1167
+
1168
+ # `expert_load_view`: (num_physical_experts,)
1169
+
1170
+ # `torch.bincount` is not compilable, so use `scatter_add_` instead.
1171
+ topk_ids_flatten = topk_ids.flatten()
1172
+ expert_load_view.scatter_add_(
1173
+ dim=0,
1174
+ index=topk_ids_flatten.long(),
1175
+ src=torch.ones_like(topk_ids_flatten).to(expert_load_view))
1176
+
1177
+ if indices_type is not None:
1178
+ topk_ids = topk_ids.to(dtype=indices_type)
1179
+ return topk_ids
1180
+
1181
+
1182
+ def fused_grouped_topk(
1183
+ hidden_states: torch.Tensor,
1184
+ gating_output: torch.Tensor,
1185
+ topk: int,
1186
+ renormalize: bool,
1187
+ e_score_correction_bias: torch.Tensor,
1188
+ num_expert_group: int = 0,
1189
+ topk_group: int = 0,
1190
+ scoring_func: str = "softmax",
1191
+ routed_scaling_factor: float = 1.0,
1192
+ ) -> tuple[torch.Tensor, torch.Tensor]:
1193
+ assert hidden_states.size(0) == gating_output.size(0), (
1194
+ "Number of tokens mismatch")
1195
+
1196
+ if scoring_func == "softmax":
1197
+ scores = torch.softmax(gating_output, dim=-1)
1198
+ elif scoring_func == "sigmoid":
1199
+ scores = gating_output.sigmoid()
1200
+ else:
1201
+ raise ValueError(f"Unsupported scoring function: {scoring_func}")
1202
+
1203
+ scores_with_bias = scores + e_score_correction_bias.unsqueeze(0)
1204
+ topk_values, topk_indices = ops.grouped_topk(
1205
+ scores, scores_with_bias.to(scores.dtype), num_expert_group,
1206
+ topk_group, topk, renormalize, routed_scaling_factor)
1207
+ return topk_values.to(torch.float32), topk_indices.to(torch.int32)
1208
+
1209
+
1210
+ def inplace_fused_experts(
1211
+ hidden_states: torch.Tensor,
1212
+ w1: torch.Tensor,
1213
+ w2: torch.Tensor,
1214
+ topk_weights: torch.Tensor,
1215
+ topk_ids: torch.Tensor,
1216
+ activation: str = "silu",
1217
+ apply_router_weight_on_input: bool = False,
1218
+ use_fp8_w8a8: bool = False,
1219
+ use_int8_w8a8: bool = False,
1220
+ use_int8_w8a16: bool = False,
1221
+ use_int4_w4a16: bool = False,
1222
+ use_mxfp4_w4a4: bool = False,
1223
+ per_channel_quant: bool = False,
1224
+ global_num_experts: int = -1,
1225
+ expert_map: Optional[torch.Tensor] = None,
1226
+ w1_scale: Optional[torch.Tensor] = None,
1227
+ w2_scale: Optional[torch.Tensor] = None,
1228
+ w1_zp: Optional[torch.Tensor] = None,
1229
+ w2_zp: Optional[torch.Tensor] = None,
1230
+ a1_scale: Optional[torch.Tensor] = None,
1231
+ a2_scale: Optional[torch.Tensor] = None,
1232
+ block_shape: Optional[List[int]] = None, #noqa: UP006
1233
+ w1_bias: Optional[torch.Tensor] = None,
1234
+ w2_bias: Optional[torch.Tensor] = None,
1235
+ ) -> None:
1236
+ fused_experts_impl(hidden_states, w1, w2, topk_weights, topk_ids, True,
1237
+ activation, apply_router_weight_on_input, use_fp8_w8a8,
1238
+ use_int8_w8a8, use_int8_w8a16, use_int4_w4a16,
1239
+ use_mxfp4_w4a4, per_channel_quant, global_num_experts,
1240
+ expert_map, w1_scale, w2_scale, w1_zp, w2_zp, a1_scale,
1241
+ a2_scale, block_shape, w1_bias, w2_bias)
1242
+
1243
+
1244
+ def inplace_fused_experts_fake(
1245
+ hidden_states: torch.Tensor,
1246
+ w1: torch.Tensor,
1247
+ w2: torch.Tensor,
1248
+ topk_weights: torch.Tensor,
1249
+ topk_ids: torch.Tensor,
1250
+ activation: str = "silu",
1251
+ apply_router_weight_on_input: bool = False,
1252
+ use_fp8_w8a8: bool = False,
1253
+ use_int8_w8a8: bool = False,
1254
+ use_int8_w8a16: bool = False,
1255
+ use_int4_w4a16: bool = False,
1256
+ use_mxfp4_w4a4: bool = False,
1257
+ per_channel_quant: bool = False,
1258
+ global_num_experts: int = -1,
1259
+ expert_map: Optional[torch.Tensor] = None,
1260
+ w1_scale: Optional[torch.Tensor] = None,
1261
+ w2_scale: Optional[torch.Tensor] = None,
1262
+ w1_zp: Optional[torch.Tensor] = None,
1263
+ w2_zp: Optional[torch.Tensor] = None,
1264
+ a1_scale: Optional[torch.Tensor] = None,
1265
+ a2_scale: Optional[torch.Tensor] = None,
1266
+ block_shape: Optional[List[int]] = None, #noqa: UP006
1267
+ w1_bias: Optional[torch.Tensor] = None,
1268
+ w2_bias: Optional[torch.Tensor] = None,
1269
+ ) -> None:
1270
+ pass
1271
+
1272
+
1273
+ direct_register_custom_op(
1274
+ op_name="inplace_fused_experts",
1275
+ op_func=inplace_fused_experts,
1276
+ mutates_args=["hidden_states"],
1277
+ fake_impl=inplace_fused_experts_fake,
1278
+ tags=(() if is_torch_equal_or_newer("2.7.0") else
1279
+ (torch.Tag.needs_fixed_stride_order, )),
1280
+ )
1281
+
1282
+
1283
+ def outplace_fused_experts(
1284
+ hidden_states: torch.Tensor,
1285
+ w1: torch.Tensor,
1286
+ w2: torch.Tensor,
1287
+ topk_weights: torch.Tensor,
1288
+ topk_ids: torch.Tensor,
1289
+ activation: str = "silu",
1290
+ apply_router_weight_on_input: bool = False,
1291
+ use_fp8_w8a8: bool = False,
1292
+ use_int8_w8a8: bool = False,
1293
+ use_int8_w8a16: bool = False,
1294
+ use_int4_w4a16: bool = False,
1295
+ use_mxfp4_w4a4: bool = False,
1296
+ per_channel_quant: bool = False,
1297
+ global_num_experts: int = -1,
1298
+ expert_map: Optional[torch.Tensor] = None,
1299
+ w1_scale: Optional[torch.Tensor] = None,
1300
+ w2_scale: Optional[torch.Tensor] = None,
1301
+ w1_zp: Optional[torch.Tensor] = None,
1302
+ w2_zp: Optional[torch.Tensor] = None,
1303
+ a1_scale: Optional[torch.Tensor] = None,
1304
+ a2_scale: Optional[torch.Tensor] = None,
1305
+ block_shape: Optional[List[int]] = None, #noqa: UP006
1306
+ w1_bias: Optional[torch.Tensor] = None,
1307
+ w2_bias: Optional[torch.Tensor] = None,
1308
+ ) -> torch.Tensor:
1309
+ return fused_experts_impl(
1310
+ hidden_states, w1, w2, topk_weights, topk_ids, False, activation,
1311
+ apply_router_weight_on_input, use_fp8_w8a8, use_int8_w8a8,
1312
+ use_int8_w8a16, use_int4_w4a16, use_mxfp4_w4a4, per_channel_quant,
1313
+ global_num_experts, expert_map, w1_scale, w2_scale, w1_zp, w2_zp,
1314
+ a1_scale, a2_scale, block_shape, w1_bias, w2_bias)
1315
+
1316
+
1317
+ def outplace_fused_experts_fake(
1318
+ hidden_states: torch.Tensor,
1319
+ w1: torch.Tensor,
1320
+ w2: torch.Tensor,
1321
+ topk_weights: torch.Tensor,
1322
+ topk_ids: torch.Tensor,
1323
+ activation: str = "silu",
1324
+ use_fp8_w8a8: bool = False,
1325
+ use_int8_w8a8: bool = False,
1326
+ use_int8_w8a16: bool = False,
1327
+ use_int4_w4a16: bool = False,
1328
+ use_mxfp4_w4a4: bool = False,
1329
+ per_channel_quant: bool = False,
1330
+ global_num_experts: int = -1,
1331
+ expert_map: Optional[torch.Tensor] = None,
1332
+ w1_scale: Optional[torch.Tensor] = None,
1333
+ w2_scale: Optional[torch.Tensor] = None,
1334
+ w1_zp: Optional[torch.Tensor] = None,
1335
+ w2_zp: Optional[torch.Tensor] = None,
1336
+ a1_scale: Optional[torch.Tensor] = None,
1337
+ a2_scale: Optional[torch.Tensor] = None,
1338
+ block_shape: Optional[list[int]] = None,
1339
+ w1_bias: Optional[torch.Tensor] = None,
1340
+ w2_bias: Optional[torch.Tensor] = None,
1341
+ ) -> torch.Tensor:
1342
+ return torch.empty_like(hidden_states)
1343
+
1344
+
1345
+ direct_register_custom_op(
1346
+ op_name="outplace_fused_experts",
1347
+ op_func=outplace_fused_experts,
1348
+ fake_impl=outplace_fused_experts_fake,
1349
+ tags=(() if is_torch_equal_or_newer("2.7.0") else
1350
+ (torch.Tag.needs_fixed_stride_order, )),
1351
+ )
1352
+
1353
+
1354
+ def torch_vllm_inplace_fused_experts(**kwargs) -> torch.Tensor:
1355
+ torch.ops.vllm.inplace_fused_experts(**kwargs)
1356
+ hidden_states = kwargs['hidden_states']
1357
+ return hidden_states
1358
+
1359
+
1360
+ def torch_vllm_outplace_fused_experts(**kwargs) -> torch.Tensor:
1361
+ return torch.ops.vllm.outplace_fused_experts(**kwargs)
1362
+
1363
+
1364
+ def dispatch_fused_experts_func(inplace: bool) -> Callable[..., torch.Tensor]:
1365
+ if inplace:
1366
+ return torch_vllm_inplace_fused_experts
1367
+ return torch_vllm_outplace_fused_experts
1368
+
1369
+
1370
+ # TODO (bnell): replace this with modular op. Can get rid of inplace/outplace
1371
+ # torch ops.
1372
+ def fused_experts(
1373
+ hidden_states: torch.Tensor,
1374
+ w1: torch.Tensor,
1375
+ w2: torch.Tensor,
1376
+ topk_weights: torch.Tensor,
1377
+ topk_ids: torch.Tensor,
1378
+ inplace: bool = False,
1379
+ activation: str = "silu",
1380
+ apply_router_weight_on_input: bool = False,
1381
+ global_num_experts: int = -1,
1382
+ expert_map: Optional[torch.Tensor] = None,
1383
+ quant_config: Optional[FusedMoEQuantConfig] = None,
1384
+ allow_deep_gemm: bool = False,
1385
+ allow_cutlass_block_scaled_grouped_gemm: bool = False,
1386
+ ) -> torch.Tensor:
1387
+
1388
+ if quant_config is None:
1389
+ quant_config = FUSED_MOE_UNQUANTIZED_CONFIG
1390
+ use_fp8_w8a8 = quant_config.use_fp8_w8a8
1391
+
1392
+ # For now, disable DeepGemm for small N (<= 512) until better
1393
+ # permute/unpermute ops are available.
1394
+ # However, on B200, we use DeepGemm for all cases because they only support
1395
+ # E8M0 scale, which means we requantize the weight and input to the specific
1396
+ # scale. Fallen back to cutlass or triton for some cases would cause
1397
+ # accuracy issue.
1398
+ if (allow_deep_gemm and quant_config.use_fp8_w8a8 and
1399
+ (is_deep_gemm_e8m0_used() or _valid_deep_gemm(hidden_states, w1, w2))):
1400
+ assert quant_config is not None
1401
+ assert apply_router_weight_on_input is False
1402
+ return deep_gemm_moe_fp8(
1403
+ hidden_states=hidden_states,
1404
+ w1=w1,
1405
+ w2=w2,
1406
+ topk_weights=topk_weights,
1407
+ topk_ids=topk_ids,
1408
+ inplace=inplace,
1409
+ activation=activation,
1410
+ global_num_experts=global_num_experts,
1411
+ expert_map=expert_map,
1412
+ w1_scale=quant_config.w1_scale,
1413
+ w2_scale=quant_config.w2_scale,
1414
+ a1_scale=quant_config.a1_scale,
1415
+ a2_scale=quant_config.a2_scale,
1416
+ apply_router_weight_on_input=apply_router_weight_on_input,
1417
+ )
1418
+ elif (allow_cutlass_block_scaled_grouped_gemm and use_fp8_w8a8
1419
+ and _valid_cutlass_block_scaled_grouped_gemm(
1420
+ w1, w2, inplace, activation, apply_router_weight_on_input,
1421
+ expert_map)):
1422
+ assert quant_config is not None
1423
+ return run_cutlass_block_scaled_fused_experts(
1424
+ a=hidden_states,
1425
+ w1=w1,
1426
+ w2=w2,
1427
+ w1_scale=quant_config.w1_scale,
1428
+ w2_scale=quant_config.w2_scale,
1429
+ topk_weights=topk_weights,
1430
+ topk_ids=topk_ids)
1431
+ else:
1432
+ return dispatch_fused_experts_func(inplace)(
1433
+ hidden_states=hidden_states,
1434
+ w1=w1,
1435
+ w2=w2,
1436
+ topk_weights=topk_weights,
1437
+ topk_ids=topk_ids,
1438
+ activation=activation,
1439
+ apply_router_weight_on_input=apply_router_weight_on_input,
1440
+ use_fp8_w8a8=quant_config.use_fp8_w8a8,
1441
+ use_int8_w8a8=quant_config.use_int8_w8a8,
1442
+ use_int8_w8a16=quant_config.use_int8_w8a16,
1443
+ use_int4_w4a16=quant_config.use_int4_w4a16,
1444
+ use_mxfp4_w4a4=quant_config.use_mxfp4_w4a4,
1445
+ per_channel_quant=quant_config.per_act_token_quant,
1446
+ global_num_experts=global_num_experts,
1447
+ expert_map=expert_map,
1448
+ w1_scale=quant_config.w1_scale,
1449
+ w2_scale=quant_config.w2_scale,
1450
+ w1_zp=quant_config.w1_zp,
1451
+ w2_zp=quant_config.w2_zp,
1452
+ a1_scale=quant_config.a1_scale,
1453
+ a2_scale=quant_config.a2_scale,
1454
+ block_shape=quant_config.block_shape,
1455
+ w1_bias=quant_config.w1_bias,
1456
+ w2_bias=quant_config.w2_bias)
1457
+
1458
+
1459
+ SILU_NO_MUL: str = activation_without_mul("silu")
1460
+ GELU_NO_MUL: str = activation_without_mul("gelu")
1461
+
1462
+
1463
+ def _get_config_quant_dtype(
1464
+ use_fp8_w8a8: bool,
1465
+ use_int8_w8a8: bool,
1466
+ use_mxfp4_w4a4: bool,
1467
+ ) -> Union[None, torch.dtype, str]:
1468
+ """
1469
+ Get the quantization type based on the quantization strategy flags.
1470
+ We don't have a quant_config at this point so we need to work backwards.
1471
+ A return type of None means no quantization is required because the
1472
+ input is unquantized or has been quantized prior to calling
1473
+ fused_experts_impl.
1474
+ """
1475
+ if use_fp8_w8a8:
1476
+ return torch.float8_e4m3fn
1477
+ elif use_int8_w8a8:
1478
+ return torch.int8
1479
+ elif use_mxfp4_w4a4:
1480
+ return "mxfp4"
1481
+ return None
1482
+
1483
+
1484
+ def fused_experts_impl(
1485
+ hidden_states: torch.Tensor,
1486
+ w1: torch.Tensor,
1487
+ w2: torch.Tensor,
1488
+ topk_weights: torch.Tensor,
1489
+ topk_ids: torch.Tensor,
1490
+ inplace: bool = False,
1491
+ activation: str = "silu",
1492
+ apply_router_weight_on_input: bool = False,
1493
+ use_fp8_w8a8: bool = False,
1494
+ use_int8_w8a8: bool = False,
1495
+ use_int8_w8a16: bool = False,
1496
+ use_int4_w4a16: bool = False,
1497
+ use_mxfp4_w4a4: bool = False,
1498
+ per_channel_quant: bool = False,
1499
+ global_num_experts: int = -1,
1500
+ expert_map: Optional[torch.Tensor] = None,
1501
+ w1_scale: Optional[torch.Tensor] = None,
1502
+ w2_scale: Optional[torch.Tensor] = None,
1503
+ w1_zp: Optional[torch.Tensor] = None,
1504
+ w2_zp: Optional[torch.Tensor] = None,
1505
+ a1_scale: Optional[torch.Tensor] = None,
1506
+ a2_scale: Optional[torch.Tensor] = None,
1507
+ block_shape: Optional[list[int]] = None,
1508
+ w1_bias: Optional[torch.Tensor] = None,
1509
+ w2_bias: Optional[torch.Tensor] = None,
1510
+ ) -> torch.Tensor:
1511
+ # Check constraints.
1512
+ if use_int4_w4a16:
1513
+ assert hidden_states.size(1) // 2 == w1.size(2), (
1514
+ "Hidden size mismatch")
1515
+ elif use_mxfp4_w4a4:
1516
+ # 16bit activation and fp4x2 packed weight
1517
+ assert hidden_states.size(1) // 2 == w1.size(2), "hidden size mismatch"
1518
+ else:
1519
+ assert hidden_states.size(1) == w1.size(2), (
1520
+ f"Hidden size mismatch {hidden_states.size(1)} != {w1.size(2)}")
1521
+
1522
+ assert topk_weights.size() == topk_ids.size(), "topk shape mismatch"
1523
+ assert hidden_states.is_contiguous(), "Hidden_states must be contiguous"
1524
+ assert w1.stride(-1) == 1, "Stride of last dimension must be 1"
1525
+ assert w2.stride(-1) == 1, "Stride of last dimension must be 1"
1526
+ assert hidden_states.dtype in [
1527
+ torch.float32, torch.float16, torch.bfloat16
1528
+ ]
1529
+
1530
+ num_tokens = hidden_states.size(0)
1531
+ E, N, _ = w1.size()
1532
+ K = w2.size(1)
1533
+ if global_num_experts == -1:
1534
+ global_num_experts = E
1535
+ top_k_num = topk_ids.size(1)
1536
+ # We execute the fused_moe kernel in chunks to circumvent this issue:
1537
+ # https://github.com/vllm-project/vllm/issues/5938
1538
+ CHUNK_SIZE = envs.VLLM_FUSED_MOE_CHUNK_SIZE
1539
+ M = min(num_tokens, CHUNK_SIZE)
1540
+
1541
+ config_dtype = _get_config_dtype_str(use_fp8_w8a8=use_fp8_w8a8,
1542
+ use_int8_w8a16=use_int8_w8a16,
1543
+ use_int4_w4a16=use_int4_w4a16,
1544
+ use_mxfp4_w4a4=use_mxfp4_w4a4,
1545
+ dtype=hidden_states.dtype)
1546
+
1547
+ # Note: for use_int8_w8a16 or use_int4_w4a16, the activations are
1548
+ # quantized prior to calling fused_experts.
1549
+ quant_dtype = _get_config_quant_dtype(use_fp8_w8a8=use_fp8_w8a8,
1550
+ use_int8_w8a8=use_int8_w8a8,
1551
+ use_mxfp4_w4a4=use_mxfp4_w4a4)
1552
+
1553
+ get_config_func = functools.partial(
1554
+ try_get_optimal_moe_config,
1555
+ w1.size(),
1556
+ w2.size(),
1557
+ top_k_num,
1558
+ config_dtype,
1559
+ block_shape=block_shape,
1560
+ )
1561
+
1562
+ config = get_config_func(M)
1563
+
1564
+ # We can reuse the memory between these because by the time we need
1565
+ # cache3, we're done with cache1
1566
+ cache13 = torch.empty(M * top_k_num * max(N, K),
1567
+ device=hidden_states.device,
1568
+ dtype=hidden_states.dtype)
1569
+ intermediate_cache1 = cache13[:M * top_k_num * N].view(M, top_k_num, N)
1570
+ intermediate_cache3 = cache13[:M * top_k_num * K].view(M, top_k_num, K)
1571
+
1572
+ # This needs separate memory since it's used concurrently with cache1
1573
+ intermediate_cache2 = torch.empty((M * top_k_num, N // 2),
1574
+ device=hidden_states.device,
1575
+ dtype=hidden_states.dtype)
1576
+
1577
+ if hidden_states.dtype == torch.bfloat16:
1578
+ compute_type = tl.bfloat16
1579
+ elif hidden_states.dtype == torch.float16:
1580
+ compute_type = tl.float16
1581
+ elif hidden_states.dtype == torch.float32:
1582
+ compute_type = tl.float32
1583
+ else:
1584
+ raise ValueError(f"Unsupported compute_type: {hidden_states.dtype}")
1585
+
1586
+ if inplace:
1587
+ out_hidden_states = hidden_states
1588
+ else:
1589
+ out_hidden_states = torch.empty_like(hidden_states)
1590
+
1591
+ if use_mxfp4_w4a4:
1592
+ # Weight has to be dequantized for mxfp4 emulation.
1593
+ w1 = dequant_mxfp4(w1, w1_scale, hidden_states.dtype)
1594
+ w1_scale = None
1595
+ w2 = dequant_mxfp4(w2, w2_scale, hidden_states.dtype)
1596
+ w2_scale = None
1597
+
1598
+ for chunk in range((num_tokens // CHUNK_SIZE) + 1):
1599
+ begin_chunk_idx, end_chunk_idx = (chunk * CHUNK_SIZE,
1600
+ min((chunk + 1) * CHUNK_SIZE,
1601
+ num_tokens))
1602
+ curr_hidden_states = hidden_states[begin_chunk_idx:end_chunk_idx]
1603
+ tokens_in_chunk, _ = curr_hidden_states.size()
1604
+
1605
+ if tokens_in_chunk == 0:
1606
+ break
1607
+
1608
+ if tokens_in_chunk < CHUNK_SIZE and chunk > 0:
1609
+ # Adjust the intermediate cache size and config for the last
1610
+ # chunk. Note that in most cases we only have one chunk
1611
+ # so the cache size and config are already set correctly and
1612
+ # do not need to be adjusted.
1613
+ intermediate_cache1 = intermediate_cache1[:tokens_in_chunk]
1614
+ intermediate_cache2 = intermediate_cache2[:tokens_in_chunk *
1615
+ topk_ids.size(1)]
1616
+ intermediate_cache3 = intermediate_cache3[:tokens_in_chunk]
1617
+ config = get_config_func(tokens_in_chunk)
1618
+
1619
+ curr_topk_ids = topk_ids[begin_chunk_idx:end_chunk_idx]
1620
+ curr_topk_weights = topk_weights[begin_chunk_idx:end_chunk_idx]
1621
+ qcurr_hidden_states, a1q_scale = moe_kernel_quantize_input(
1622
+ A=curr_hidden_states,
1623
+ A_scale=a1_scale,
1624
+ quant_dtype=quant_dtype,
1625
+ per_act_token_quant=per_channel_quant,
1626
+ block_shape=block_shape)
1627
+
1628
+ sorted_token_ids, expert_ids, num_tokens_post_padded = (
1629
+ moe_align_block_size(curr_topk_ids, config['BLOCK_SIZE_M'],
1630
+ global_num_experts, expert_map))
1631
+
1632
+ invoke_fused_moe_kernel(qcurr_hidden_states,
1633
+ w1,
1634
+ intermediate_cache1,
1635
+ a1q_scale,
1636
+ w1_scale,
1637
+ w1_zp,
1638
+ curr_topk_weights,
1639
+ sorted_token_ids,
1640
+ expert_ids,
1641
+ num_tokens_post_padded,
1642
+ apply_router_weight_on_input,
1643
+ top_k_num,
1644
+ config,
1645
+ compute_type=compute_type,
1646
+ use_fp8_w8a8=use_fp8_w8a8,
1647
+ use_int8_w8a8=use_int8_w8a8,
1648
+ use_int8_w8a16=use_int8_w8a16,
1649
+ use_int4_w4a16=use_int4_w4a16,
1650
+ per_channel_quant=per_channel_quant,
1651
+ block_shape=block_shape,
1652
+ B_bias=w1_bias)
1653
+
1654
+ # Activation function with multiplication
1655
+ if activation == "silu":
1656
+ torch.ops._C.silu_and_mul(intermediate_cache2,
1657
+ intermediate_cache1.view(-1, N))
1658
+ elif activation == "gelu":
1659
+ torch.ops._C.gelu_and_mul(intermediate_cache2,
1660
+ intermediate_cache1.view(-1, N))
1661
+ elif activation == "swigluoai":
1662
+ # alpha = 1.702, limit = 7.0
1663
+ torch.ops._C.swigluoai_and_mul(intermediate_cache2,
1664
+ intermediate_cache1.view(-1, N))
1665
+ # Activation function without multiplication
1666
+ elif activation == SILU_NO_MUL:
1667
+ intermediate_cache2 = F.silu(intermediate_cache1.view(-1, N))
1668
+ elif activation == GELU_NO_MUL:
1669
+ intermediate_cache2 = F.gelu(intermediate_cache1.view(-1, N))
1670
+
1671
+ else:
1672
+ raise ValueError(f"Unsupported FusedMoe activation: {activation}.")
1673
+
1674
+ qintermediate_cache2, a2q_scale = moe_kernel_quantize_input(
1675
+ A=intermediate_cache2,
1676
+ A_scale=a2_scale,
1677
+ quant_dtype=quant_dtype,
1678
+ per_act_token_quant=per_channel_quant,
1679
+ block_shape=block_shape)
1680
+
1681
+ invoke_fused_moe_kernel(qintermediate_cache2,
1682
+ w2,
1683
+ intermediate_cache3,
1684
+ a2q_scale,
1685
+ w2_scale,
1686
+ w2_zp,
1687
+ curr_topk_weights,
1688
+ sorted_token_ids,
1689
+ expert_ids,
1690
+ num_tokens_post_padded,
1691
+ not apply_router_weight_on_input,
1692
+ 1,
1693
+ config,
1694
+ compute_type=compute_type,
1695
+ use_fp8_w8a8=use_fp8_w8a8,
1696
+ use_int8_w8a8=use_int8_w8a8,
1697
+ use_int8_w8a16=use_int8_w8a16,
1698
+ use_int4_w4a16=use_int4_w4a16,
1699
+ per_channel_quant=per_channel_quant,
1700
+ block_shape=block_shape,
1701
+ B_bias=w2_bias)
1702
+
1703
+ ops.moe_sum(intermediate_cache3.view(*intermediate_cache3.size()),
1704
+ out_hidden_states[begin_chunk_idx:end_chunk_idx])
1705
+
1706
+ return out_hidden_states
1707
+
1708
+
1709
+ class TritonExperts(mk.FusedMoEPermuteExpertsUnpermute):
1710
+
1711
+ def __init__(
1712
+ self,
1713
+ quant_config: FusedMoEQuantConfig,
1714
+ ):
1715
+ super().__init__(quant_config)
1716
+
1717
+ @property
1718
+ def activation_formats(
1719
+ self
1720
+ ) -> tuple[mk.FusedMoEActivationFormat, mk.FusedMoEActivationFormat]:
1721
+ return (mk.FusedMoEActivationFormat.Standard,
1722
+ mk.FusedMoEActivationFormat.Standard)
1723
+
1724
+ def supports_chunking(self) -> bool:
1725
+ return True
1726
+
1727
+ def supports_expert_map(self) -> bool:
1728
+ return True
1729
+
1730
+ def finalize_weight_and_reduce_impl(self) -> mk.TopKWeightAndReduce:
1731
+ return TopKWeightAndReduceNoOP()
1732
+
1733
+ def workspace_shapes(
1734
+ self,
1735
+ a: torch.Tensor,
1736
+ aq: torch.Tensor,
1737
+ M: int,
1738
+ N: int,
1739
+ K: int,
1740
+ topk: int,
1741
+ global_num_experts: int,
1742
+ local_num_experts: int,
1743
+ expert_tokens_meta: Optional[mk.ExpertTokensMetadata],
1744
+ ) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...], torch.dtype]:
1745
+ workspace1 = (M, topk, max(N // 2, K))
1746
+ workspace2 = (M, topk, max(N, K))
1747
+ output = (M, K)
1748
+ return (workspace1, workspace2, output, a.dtype)
1749
+
1750
+ def apply(
1751
+ self,
1752
+ output: torch.Tensor,
1753
+ hidden_states: torch.Tensor,
1754
+ w1: torch.Tensor,
1755
+ w2: torch.Tensor,
1756
+ topk_weights: torch.Tensor,
1757
+ topk_ids: torch.Tensor,
1758
+ activation: str,
1759
+ global_num_experts: int,
1760
+ expert_map: Optional[torch.Tensor],
1761
+ a1q_scale: Optional[torch.Tensor],
1762
+ a2_scale: Optional[torch.Tensor],
1763
+ workspace13: torch.Tensor,
1764
+ workspace2: torch.Tensor,
1765
+ expert_tokens_meta: Optional[mk.ExpertTokensMetadata],
1766
+ apply_router_weight_on_input: bool,
1767
+ ):
1768
+ # Check constraints.
1769
+ if self.quant_config.use_int4_w4a16:
1770
+ assert hidden_states.size(-1) // 2 == w1.size(2), (
1771
+ "Hidden size mismatch")
1772
+ else:
1773
+ assert hidden_states.size(-1) == w1.size(2), \
1774
+ (f"Hidden size mismatch {hidden_states.size(-1)} "
1775
+ f"!= {w1.size(2)}")
1776
+
1777
+ assert hidden_states.is_contiguous(
1778
+ ), "Hidden_states must be contiguous"
1779
+ assert hidden_states.dim() == 2
1780
+ assert w1.stride(-1) == 1, "Stride of last dimension must be 1"
1781
+ assert w2.stride(-1) == 1, "Stride of last dimension must be 1"
1782
+ assert hidden_states.dtype in [
1783
+ torch.float32, torch.float16, torch.bfloat16, torch.float8_e4m3fn
1784
+ ]
1785
+
1786
+ E, num_tokens, N, K, top_k_num = mk._moe_problem_size(
1787
+ hidden_states, w1, w2, topk_ids)
1788
+
1789
+ if global_num_experts == -1:
1790
+ global_num_experts = E
1791
+
1792
+ config = try_get_optimal_moe_config(
1793
+ w1.size(),
1794
+ w2.size(),
1795
+ top_k_num,
1796
+ self.quant_config.config_name(hidden_states.dtype),
1797
+ num_tokens,
1798
+ block_shape=self.block_shape,
1799
+ )
1800
+
1801
+ if hidden_states.dtype == torch.bfloat16:
1802
+ compute_type = tl.bfloat16
1803
+ elif hidden_states.dtype == torch.float16:
1804
+ compute_type = tl.float16
1805
+ elif hidden_states.dtype == torch.float32:
1806
+ compute_type = tl.float32
1807
+ elif hidden_states.dtype == torch.float8_e4m3fn:
1808
+ compute_type = tl.bfloat16
1809
+ else:
1810
+ raise ValueError(
1811
+ f"Unsupported compute_type: {hidden_states.dtype}")
1812
+
1813
+ # Note that the output tensor might be in workspace1
1814
+ intermediate_cache1 = _resize_cache(workspace2,
1815
+ (num_tokens, top_k_num, N))
1816
+ intermediate_cache2 = _resize_cache(workspace13,
1817
+ (num_tokens * top_k_num, N // 2))
1818
+ intermediate_cache3 = _resize_cache(workspace2,
1819
+ (num_tokens, top_k_num, K))
1820
+
1821
+ sorted_token_ids, expert_ids, num_tokens_post_padded = (
1822
+ moe_align_block_size(topk_ids, config['BLOCK_SIZE_M'],
1823
+ global_num_experts, expert_map))
1824
+
1825
+ invoke_fused_moe_kernel(
1826
+ hidden_states,
1827
+ w1,
1828
+ intermediate_cache1,
1829
+ a1q_scale,
1830
+ self.w1_scale,
1831
+ self.w1_zp,
1832
+ None, # topk_weights
1833
+ sorted_token_ids,
1834
+ expert_ids,
1835
+ num_tokens_post_padded,
1836
+ False, # mul_routed_weights
1837
+ top_k_num,
1838
+ config,
1839
+ compute_type=compute_type,
1840
+ use_fp8_w8a8=self.quant_config.use_fp8_w8a8,
1841
+ use_int8_w8a8=self.quant_config.use_int8_w8a8,
1842
+ use_int8_w8a16=self.quant_config.use_int8_w8a16,
1843
+ use_int4_w4a16=self.quant_config.use_int4_w4a16,
1844
+ per_channel_quant=self.per_act_token_quant,
1845
+ block_shape=self.block_shape,
1846
+ B_bias=self.w1_bias,
1847
+ )
1848
+
1849
+ self.activation(activation, intermediate_cache2,
1850
+ intermediate_cache1.view(-1, N))
1851
+
1852
+ a2q_scale: Optional[torch.Tensor] = None
1853
+
1854
+ qintermediate_cache2, a2q_scale = moe_kernel_quantize_input(
1855
+ intermediate_cache2, a2_scale, self.quant_dtype,
1856
+ self.per_act_token_quant, self.block_shape)
1857
+
1858
+ invoke_fused_moe_kernel(
1859
+ qintermediate_cache2,
1860
+ w2,
1861
+ intermediate_cache3,
1862
+ a2q_scale,
1863
+ self.w2_scale,
1864
+ self.w2_zp,
1865
+ topk_weights,
1866
+ sorted_token_ids,
1867
+ expert_ids,
1868
+ num_tokens_post_padded,
1869
+ not apply_router_weight_on_input,
1870
+ 1,
1871
+ config,
1872
+ compute_type=compute_type,
1873
+ use_fp8_w8a8=self.quant_config.use_fp8_w8a8,
1874
+ use_int8_w8a8=self.quant_config.use_int8_w8a8,
1875
+ use_int8_w8a16=self.quant_config.use_int8_w8a16,
1876
+ use_int4_w4a16=self.quant_config.use_int4_w4a16,
1877
+ per_channel_quant=self.per_act_token_quant,
1878
+ block_shape=self.block_shape,
1879
+ B_bias=self.w2_bias,
1880
+ )
1881
+
1882
+ ops.moe_sum(intermediate_cache3, output)
1883
+
1884
+
1885
+ def modular_triton_fused_moe(
1886
+ quant_config: FusedMoEQuantConfig) -> mk.FusedMoEModularKernel:
1887
+ return mk.FusedMoEModularKernel(
1888
+ MoEPrepareAndFinalizeNoEP(),
1889
+ TritonExperts(quant_config),
1890
+ )