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

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

Potentially problematic release.


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

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