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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1398) hide show
  1. vllm/_C.abi3.so +0 -0
  2. vllm/__init__.py +220 -0
  3. vllm/_bc_linter.py +59 -0
  4. vllm/_custom_ops.py +2044 -0
  5. vllm/_ipex_ops.py +393 -0
  6. vllm/_version.py +34 -0
  7. vllm/assets/__init__.py +0 -0
  8. vllm/assets/audio.py +45 -0
  9. vllm/assets/base.py +41 -0
  10. vllm/assets/image.py +50 -0
  11. vllm/assets/video.py +145 -0
  12. vllm/attention/__init__.py +15 -0
  13. vllm/attention/backends/__init__.py +0 -0
  14. vllm/attention/backends/abstract.py +204 -0
  15. vllm/attention/backends/utils.py +33 -0
  16. vllm/attention/layer.py +645 -0
  17. vllm/attention/layers/__init__.py +0 -0
  18. vllm/attention/layers/chunked_local_attention.py +93 -0
  19. vllm/attention/layers/cross_attention.py +162 -0
  20. vllm/attention/layers/encoder_only_attention.py +86 -0
  21. vllm/attention/ops/__init__.py +0 -0
  22. vllm/attention/ops/chunked_prefill_paged_decode.py +405 -0
  23. vllm/attention/ops/common.py +345 -0
  24. vllm/attention/ops/flashmla.py +192 -0
  25. vllm/attention/ops/merge_attn_states.py +43 -0
  26. vllm/attention/ops/paged_attn.py +262 -0
  27. vllm/attention/ops/pallas_kv_cache_update.py +124 -0
  28. vllm/attention/ops/prefix_prefill.py +928 -0
  29. vllm/attention/ops/rocm_aiter_mla.py +104 -0
  30. vllm/attention/ops/rocm_aiter_paged_attn.py +102 -0
  31. vllm/attention/ops/triton_decode_attention.py +691 -0
  32. vllm/attention/ops/triton_flash_attention.py +984 -0
  33. vllm/attention/ops/triton_merge_attn_states.py +97 -0
  34. vllm/attention/ops/triton_reshape_and_cache_flash.py +175 -0
  35. vllm/attention/ops/triton_unified_attention.py +894 -0
  36. vllm/attention/selector.py +245 -0
  37. vllm/attention/utils/__init__.py +0 -0
  38. vllm/attention/utils/fa_utils.py +85 -0
  39. vllm/attention/utils/kv_sharing_utils.py +33 -0
  40. vllm/beam_search.py +87 -0
  41. vllm/benchmarks/__init__.py +0 -0
  42. vllm/benchmarks/datasets.py +2723 -0
  43. vllm/benchmarks/latency.py +170 -0
  44. vllm/benchmarks/lib/__init__.py +3 -0
  45. vllm/benchmarks/lib/endpoint_request_func.py +533 -0
  46. vllm/benchmarks/lib/ready_checker.py +73 -0
  47. vllm/benchmarks/lib/utils.py +80 -0
  48. vllm/benchmarks/serve.py +1358 -0
  49. vllm/benchmarks/throughput.py +696 -0
  50. vllm/collect_env.py +823 -0
  51. vllm/compilation/__init__.py +0 -0
  52. vllm/compilation/activation_quant_fusion.py +189 -0
  53. vllm/compilation/backends.py +650 -0
  54. vllm/compilation/base_static_graph.py +56 -0
  55. vllm/compilation/collective_fusion.py +1188 -0
  56. vllm/compilation/compiler_interface.py +573 -0
  57. vllm/compilation/counter.py +47 -0
  58. vllm/compilation/cuda_graph.py +199 -0
  59. vllm/compilation/cuda_piecewise_backend.py +117 -0
  60. vllm/compilation/decorators.py +400 -0
  61. vllm/compilation/fix_functionalization.py +205 -0
  62. vllm/compilation/fusion.py +383 -0
  63. vllm/compilation/fusion_attn.py +295 -0
  64. vllm/compilation/fx_utils.py +84 -0
  65. vllm/compilation/inductor_pass.py +136 -0
  66. vllm/compilation/monitor.py +57 -0
  67. vllm/compilation/noop_elimination.py +158 -0
  68. vllm/compilation/pass_manager.py +125 -0
  69. vllm/compilation/post_cleanup.py +20 -0
  70. vllm/compilation/sequence_parallelism.py +478 -0
  71. vllm/compilation/torch25_custom_graph_pass.py +42 -0
  72. vllm/compilation/vllm_inductor_pass.py +156 -0
  73. vllm/compilation/wrapper.py +136 -0
  74. vllm/config/__init__.py +814 -0
  75. vllm/config/cache.py +220 -0
  76. vllm/config/compilation.py +673 -0
  77. vllm/config/device.py +74 -0
  78. vllm/config/kv_events.py +50 -0
  79. vllm/config/kv_transfer.py +111 -0
  80. vllm/config/load.py +113 -0
  81. vllm/config/lora.py +132 -0
  82. vllm/config/model.py +1912 -0
  83. vllm/config/multimodal.py +129 -0
  84. vllm/config/observability.py +99 -0
  85. vllm/config/parallel.py +524 -0
  86. vllm/config/pooler.py +97 -0
  87. vllm/config/scheduler.py +287 -0
  88. vllm/config/speculative.py +568 -0
  89. vllm/config/speech_to_text.py +39 -0
  90. vllm/config/structured_outputs.py +64 -0
  91. vllm/config/utils.py +145 -0
  92. vllm/connections.py +186 -0
  93. vllm/device_allocator/__init__.py +0 -0
  94. vllm/device_allocator/cumem.py +311 -0
  95. vllm/distributed/__init__.py +6 -0
  96. vllm/distributed/communication_op.py +41 -0
  97. vllm/distributed/device_communicators/__init__.py +0 -0
  98. vllm/distributed/device_communicators/all2all.py +440 -0
  99. vllm/distributed/device_communicators/all_reduce_utils.py +317 -0
  100. vllm/distributed/device_communicators/base_device_communicator.py +295 -0
  101. vllm/distributed/device_communicators/cpu_communicator.py +201 -0
  102. vllm/distributed/device_communicators/cuda_communicator.py +323 -0
  103. vllm/distributed/device_communicators/cuda_wrapper.py +180 -0
  104. vllm/distributed/device_communicators/custom_all_reduce.py +311 -0
  105. vllm/distributed/device_communicators/mnnvl_compat.py +28 -0
  106. vllm/distributed/device_communicators/pynccl.py +340 -0
  107. vllm/distributed/device_communicators/pynccl_allocator.py +186 -0
  108. vllm/distributed/device_communicators/pynccl_wrapper.py +416 -0
  109. vllm/distributed/device_communicators/quick_all_reduce.py +278 -0
  110. vllm/distributed/device_communicators/ray_communicator.py +258 -0
  111. vllm/distributed/device_communicators/shm_broadcast.py +589 -0
  112. vllm/distributed/device_communicators/shm_object_storage.py +635 -0
  113. vllm/distributed/device_communicators/symm_mem.py +136 -0
  114. vllm/distributed/device_communicators/tpu_communicator.py +102 -0
  115. vllm/distributed/device_communicators/xpu_communicator.py +94 -0
  116. vllm/distributed/eplb/__init__.py +8 -0
  117. vllm/distributed/eplb/eplb_state.py +620 -0
  118. vllm/distributed/eplb/rebalance_algo.py +239 -0
  119. vllm/distributed/eplb/rebalance_execute.py +424 -0
  120. vllm/distributed/kv_events.py +362 -0
  121. vllm/distributed/kv_transfer/README.md +29 -0
  122. vllm/distributed/kv_transfer/__init__.py +13 -0
  123. vllm/distributed/kv_transfer/disagg_prefill_workflow.jpg +0 -0
  124. vllm/distributed/kv_transfer/kv_connector/__init__.py +0 -0
  125. vllm/distributed/kv_transfer/kv_connector/base.py +10 -0
  126. vllm/distributed/kv_transfer/kv_connector/factory.py +113 -0
  127. vllm/distributed/kv_transfer/kv_connector/utils.py +261 -0
  128. vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +6 -0
  129. vllm/distributed/kv_transfer/kv_connector/v1/base.py +388 -0
  130. vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +168 -0
  131. vllm/distributed/kv_transfer/kv_connector/v1/metrics.py +100 -0
  132. vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +328 -0
  133. vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +1473 -0
  134. vllm/distributed/kv_transfer/kv_connector/v1/offloading_connector.py +485 -0
  135. vllm/distributed/kv_transfer/kv_connector/v1/p2p/__init__.py +0 -0
  136. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_connector.py +488 -0
  137. vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py +550 -0
  138. vllm/distributed/kv_transfer/kv_connector/v1/p2p/tensor_memory_pool.py +267 -0
  139. vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py +418 -0
  140. vllm/distributed/kv_transfer/kv_lookup_buffer/__init__.py +0 -0
  141. vllm/distributed/kv_transfer/kv_lookup_buffer/base.py +175 -0
  142. vllm/distributed/kv_transfer/kv_lookup_buffer/mooncake_store.py +161 -0
  143. vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py +237 -0
  144. vllm/distributed/kv_transfer/kv_pipe/__init__.py +0 -0
  145. vllm/distributed/kv_transfer/kv_pipe/base.py +67 -0
  146. vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py +290 -0
  147. vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +280 -0
  148. vllm/distributed/kv_transfer/kv_transfer_state.py +73 -0
  149. vllm/distributed/parallel_state.py +1532 -0
  150. vllm/distributed/tpu_distributed_utils.py +178 -0
  151. vllm/distributed/utils.py +536 -0
  152. vllm/engine/__init__.py +0 -0
  153. vllm/engine/arg_utils.py +1778 -0
  154. vllm/engine/async_llm_engine.py +6 -0
  155. vllm/engine/llm_engine.py +6 -0
  156. vllm/engine/metrics.py +577 -0
  157. vllm/engine/metrics_types.py +84 -0
  158. vllm/engine/protocol.py +333 -0
  159. vllm/entrypoints/__init__.py +0 -0
  160. vllm/entrypoints/api_server.py +178 -0
  161. vllm/entrypoints/chat_utils.py +1705 -0
  162. vllm/entrypoints/cli/__init__.py +12 -0
  163. vllm/entrypoints/cli/benchmark/__init__.py +0 -0
  164. vllm/entrypoints/cli/benchmark/base.py +25 -0
  165. vllm/entrypoints/cli/benchmark/latency.py +21 -0
  166. vllm/entrypoints/cli/benchmark/main.py +55 -0
  167. vllm/entrypoints/cli/benchmark/serve.py +21 -0
  168. vllm/entrypoints/cli/benchmark/throughput.py +21 -0
  169. vllm/entrypoints/cli/collect_env.py +36 -0
  170. vllm/entrypoints/cli/main.py +60 -0
  171. vllm/entrypoints/cli/openai.py +233 -0
  172. vllm/entrypoints/cli/run_batch.py +67 -0
  173. vllm/entrypoints/cli/serve.py +232 -0
  174. vllm/entrypoints/cli/types.py +29 -0
  175. vllm/entrypoints/constants.py +10 -0
  176. vllm/entrypoints/context.py +481 -0
  177. vllm/entrypoints/harmony_utils.py +436 -0
  178. vllm/entrypoints/launcher.py +164 -0
  179. vllm/entrypoints/llm.py +1629 -0
  180. vllm/entrypoints/logger.py +79 -0
  181. vllm/entrypoints/openai/__init__.py +0 -0
  182. vllm/entrypoints/openai/api_server.py +1953 -0
  183. vllm/entrypoints/openai/cli_args.py +288 -0
  184. vllm/entrypoints/openai/logits_processors.py +90 -0
  185. vllm/entrypoints/openai/protocol.py +2757 -0
  186. vllm/entrypoints/openai/run_batch.py +491 -0
  187. vllm/entrypoints/openai/serving_chat.py +1597 -0
  188. vllm/entrypoints/openai/serving_classification.py +173 -0
  189. vllm/entrypoints/openai/serving_completion.py +692 -0
  190. vllm/entrypoints/openai/serving_embedding.py +631 -0
  191. vllm/entrypoints/openai/serving_engine.py +992 -0
  192. vllm/entrypoints/openai/serving_models.py +288 -0
  193. vllm/entrypoints/openai/serving_pooling.py +276 -0
  194. vllm/entrypoints/openai/serving_responses.py +1709 -0
  195. vllm/entrypoints/openai/serving_score.py +479 -0
  196. vllm/entrypoints/openai/serving_tokenization.py +196 -0
  197. vllm/entrypoints/openai/serving_transcription.py +136 -0
  198. vllm/entrypoints/openai/speech_to_text.py +388 -0
  199. vllm/entrypoints/openai/tool_parsers/__init__.py +55 -0
  200. vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +164 -0
  201. vllm/entrypoints/openai/tool_parsers/deepseekv31_tool_parser.py +367 -0
  202. vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py +370 -0
  203. vllm/entrypoints/openai/tool_parsers/glm4_moe_tool_parser.py +185 -0
  204. vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py +259 -0
  205. vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py +237 -0
  206. vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py +455 -0
  207. vllm/entrypoints/openai/tool_parsers/hunyuan_a13b_tool_parser.py +372 -0
  208. vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py +216 -0
  209. vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py +308 -0
  210. vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py +377 -0
  211. vllm/entrypoints/openai/tool_parsers/llama4_pythonic_tool_parser.py +316 -0
  212. vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +269 -0
  213. vllm/entrypoints/openai/tool_parsers/longcat_tool_parser.py +39 -0
  214. vllm/entrypoints/openai/tool_parsers/minimax_tool_parser.py +816 -0
  215. vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +369 -0
  216. vllm/entrypoints/openai/tool_parsers/openai_tool_parser.py +93 -0
  217. vllm/entrypoints/openai/tool_parsers/phi4mini_tool_parser.py +112 -0
  218. vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py +308 -0
  219. vllm/entrypoints/openai/tool_parsers/qwen3coder_tool_parser.py +707 -0
  220. vllm/entrypoints/openai/tool_parsers/qwen3xml_tool_parser.py +1137 -0
  221. vllm/entrypoints/openai/tool_parsers/seed_oss_tool_parser.py +679 -0
  222. vllm/entrypoints/openai/tool_parsers/step3_tool_parser.py +296 -0
  223. vllm/entrypoints/openai/tool_parsers/utils.py +124 -0
  224. vllm/entrypoints/openai/tool_parsers/xlam_tool_parser.py +524 -0
  225. vllm/entrypoints/renderer.py +395 -0
  226. vllm/entrypoints/score_utils.py +232 -0
  227. vllm/entrypoints/ssl.py +75 -0
  228. vllm/entrypoints/tool.py +139 -0
  229. vllm/entrypoints/tool_server.py +206 -0
  230. vllm/entrypoints/utils.py +233 -0
  231. vllm/env_override.py +23 -0
  232. vllm/envs.py +1590 -0
  233. vllm/executor/__init__.py +0 -0
  234. vllm/executor/executor_base.py +381 -0
  235. vllm/executor/msgspec_utils.py +35 -0
  236. vllm/executor/ray_distributed_executor.py +699 -0
  237. vllm/executor/ray_utils.py +410 -0
  238. vllm/executor/uniproc_executor.py +176 -0
  239. vllm/forward_context.py +402 -0
  240. vllm/inputs/__init__.py +30 -0
  241. vllm/inputs/data.py +356 -0
  242. vllm/inputs/parse.py +151 -0
  243. vllm/inputs/preprocess.py +664 -0
  244. vllm/logger.py +229 -0
  245. vllm/logging_utils/__init__.py +10 -0
  246. vllm/logging_utils/dump_input.py +81 -0
  247. vllm/logging_utils/formatter.py +79 -0
  248. vllm/logging_utils/log_time.py +32 -0
  249. vllm/logits_process.py +119 -0
  250. vllm/logprobs.py +28 -0
  251. vllm/lora/__init__.py +0 -0
  252. vllm/lora/layers/__init__.py +34 -0
  253. vllm/lora/layers/base.py +69 -0
  254. vllm/lora/layers/base_linear.py +185 -0
  255. vllm/lora/layers/column_parallel_linear.py +609 -0
  256. vllm/lora/layers/logits_processor.py +247 -0
  257. vllm/lora/layers/qkv_x_parallel_linear.py +8 -0
  258. vllm/lora/layers/replicated_linear.py +60 -0
  259. vllm/lora/layers/row_parallel_linear.py +196 -0
  260. vllm/lora/layers/utils.py +65 -0
  261. vllm/lora/layers/vocal_parallel_embedding.py +174 -0
  262. vllm/lora/lora_weights.py +199 -0
  263. vllm/lora/models.py +816 -0
  264. vllm/lora/ops/__init__.py +0 -0
  265. vllm/lora/ops/ipex_ops/__init__.py +7 -0
  266. vllm/lora/ops/ipex_ops/lora_ops.py +44 -0
  267. vllm/lora/ops/torch_ops/__init__.py +16 -0
  268. vllm/lora/ops/torch_ops/lora_ops.py +119 -0
  269. vllm/lora/ops/triton_ops/__init__.py +12 -0
  270. vllm/lora/ops/triton_ops/kernel_utils.py +243 -0
  271. vllm/lora/ops/triton_ops/lora_expand_op.py +289 -0
  272. vllm/lora/ops/triton_ops/lora_kernel_metadata.py +148 -0
  273. vllm/lora/ops/triton_ops/lora_shrink_op.py +243 -0
  274. vllm/lora/ops/triton_ops/utils.py +126 -0
  275. vllm/lora/ops/xla_ops/__init__.py +7 -0
  276. vllm/lora/ops/xla_ops/lora_ops.py +144 -0
  277. vllm/lora/peft_helper.py +127 -0
  278. vllm/lora/punica_wrapper/__init__.py +10 -0
  279. vllm/lora/punica_wrapper/punica_base.py +458 -0
  280. vllm/lora/punica_wrapper/punica_cpu.py +349 -0
  281. vllm/lora/punica_wrapper/punica_gpu.py +272 -0
  282. vllm/lora/punica_wrapper/punica_selector.py +20 -0
  283. vllm/lora/punica_wrapper/punica_tpu.py +391 -0
  284. vllm/lora/punica_wrapper/punica_xpu.py +276 -0
  285. vllm/lora/punica_wrapper/utils.py +136 -0
  286. vllm/lora/request.py +97 -0
  287. vllm/lora/resolver.py +85 -0
  288. vllm/lora/utils.py +246 -0
  289. vllm/lora/worker_manager.py +267 -0
  290. vllm/model_executor/__init__.py +12 -0
  291. vllm/model_executor/custom_op.py +194 -0
  292. vllm/model_executor/layers/__init__.py +0 -0
  293. vllm/model_executor/layers/activation.py +575 -0
  294. vllm/model_executor/layers/attention_layer_base.py +23 -0
  295. vllm/model_executor/layers/fla/__init__.py +8 -0
  296. vllm/model_executor/layers/fla/ops/__init__.py +17 -0
  297. vllm/model_executor/layers/fla/ops/chunk.py +225 -0
  298. vllm/model_executor/layers/fla/ops/chunk_delta_h.py +290 -0
  299. vllm/model_executor/layers/fla/ops/chunk_o.py +177 -0
  300. vllm/model_executor/layers/fla/ops/chunk_scaled_dot_kkt.py +140 -0
  301. vllm/model_executor/layers/fla/ops/cumsum.py +226 -0
  302. vllm/model_executor/layers/fla/ops/fused_recurrent.py +366 -0
  303. vllm/model_executor/layers/fla/ops/index.py +39 -0
  304. vllm/model_executor/layers/fla/ops/l2norm.py +143 -0
  305. vllm/model_executor/layers/fla/ops/layernorm_guard.py +337 -0
  306. vllm/model_executor/layers/fla/ops/op.py +39 -0
  307. vllm/model_executor/layers/fla/ops/solve_tril.py +365 -0
  308. vllm/model_executor/layers/fla/ops/utils.py +180 -0
  309. vllm/model_executor/layers/fla/ops/wy_fast.py +114 -0
  310. vllm/model_executor/layers/fused_moe/__init__.py +89 -0
  311. vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +322 -0
  312. vllm/model_executor/layers/fused_moe/batched_triton_or_deep_gemm_moe.py +141 -0
  313. vllm/model_executor/layers/fused_moe/config.py +804 -0
  314. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  315. vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  316. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  317. vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  318. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  319. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +218 -0
  320. vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
  321. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  322. vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  323. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  324. vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  325. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  326. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  327. vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H100,dtype=fp8_w8a8.json +123 -0
  328. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  329. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  330. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  331. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20.json +146 -0
  332. vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
  333. vllm/model_executor/layers/fused_moe/configs/E=128,N=352,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +122 -0
  334. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  335. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  336. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  337. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  338. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  339. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e.json +146 -0
  340. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20.json +146 -0
  341. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  342. vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
  343. vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  344. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +146 -0
  345. vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +114 -0
  346. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  347. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  348. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  349. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  350. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  351. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
  352. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  353. vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
  354. vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
  355. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
  356. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
  357. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200.json +146 -0
  358. vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
  359. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  360. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  361. vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  362. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  363. vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  364. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
  365. vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  366. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  367. vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  368. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  369. vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  370. vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  371. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  372. vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
  373. vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  374. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
  375. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  376. vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
  377. vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
  378. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  379. vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H20-3e.json +146 -0
  380. vllm/model_executor/layers/fused_moe/configs/E=160,N=320,device_name=NVIDIA_H20-3e.json +146 -0
  381. vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  382. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  383. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  384. vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  385. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  386. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  387. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  388. vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  389. vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
  390. vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  391. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  392. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  393. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  394. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
  395. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  396. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  397. vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  398. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  399. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  400. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  401. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  402. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  403. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  404. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  405. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  406. vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  407. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
  408. vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  409. vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  410. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  411. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  412. vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  413. vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  414. vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  415. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  416. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  417. vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  418. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200.json +146 -0
  419. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +147 -0
  420. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  421. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H20-3e.json +146 -0
  422. vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H200.json +146 -0
  423. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200.json +146 -0
  424. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
  425. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  426. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H20-3e.json +146 -0
  427. vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H200.json +146 -0
  428. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200.json +146 -0
  429. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
  430. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  431. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H20-3e.json +146 -0
  432. vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H200.json +146 -0
  433. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_B200.json +146 -0
  434. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H20-3e.json +146 -0
  435. vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H200.json +146 -0
  436. vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
  437. vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
  438. vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
  439. vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
  440. vllm/model_executor/layers/fused_moe/configs/E=62,N=128,device_name=AMD_Instinct_MI300X.json +200 -0
  441. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=AMD_Instinct_MI300X.json +200 -0
  442. vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  443. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=AMD_Instinct_MI300X.json +200 -0
  444. vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  445. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  446. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  447. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  448. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  449. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  450. vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
  451. vllm/model_executor/layers/fused_moe/configs/E=64,N=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  452. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  453. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  454. vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
  455. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  456. vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20.json +146 -0
  457. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  458. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  459. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  460. vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
  461. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  462. vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20.json +146 -0
  463. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  464. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
  465. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  466. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  467. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  468. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  469. vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
  470. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
  471. vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20.json +146 -0
  472. vllm/model_executor/layers/fused_moe/configs/E=64,N=896,device_name=NVIDIA_H20.json +146 -0
  473. vllm/model_executor/layers/fused_moe/configs/E=72,N=192,device_name=AMD_Instinct_MI300X.json +200 -0
  474. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=AMD_Instinct_MI300X.json +200 -0
  475. vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  476. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=AMD_Instinct_MI300X.json +200 -0
  477. vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  478. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  479. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
  480. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  481. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
  482. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
  483. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  484. vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
  485. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  486. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
  487. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  488. vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
  489. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  490. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
  491. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  492. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
  493. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  494. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  495. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  496. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  497. vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
  498. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  499. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
  500. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  501. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
  502. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  503. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  504. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  505. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +154 -0
  506. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  507. vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
  508. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  509. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
  510. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  511. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
  512. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
  513. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  514. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
  515. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  516. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  517. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  518. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
  519. vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
  520. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  521. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
  522. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  523. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
  524. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  525. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  526. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  527. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  528. vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
  529. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  530. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
  531. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  532. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
  533. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
  534. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  535. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
  536. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  537. vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
  538. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
  539. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
  540. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
  541. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
  542. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
  543. vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
  544. vllm/model_executor/layers/fused_moe/configs/README +12 -0
  545. vllm/model_executor/layers/fused_moe/cpu_fused_moe.py +300 -0
  546. vllm/model_executor/layers/fused_moe/cutlass_moe.py +957 -0
  547. vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +362 -0
  548. vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +413 -0
  549. vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +361 -0
  550. vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +274 -0
  551. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_moe.py +268 -0
  552. vllm/model_executor/layers/fused_moe/flashinfer_cutlass_prepare_finalize.py +300 -0
  553. vllm/model_executor/layers/fused_moe/flashinfer_trtllm_moe.py +184 -0
  554. vllm/model_executor/layers/fused_moe/fused_batched_moe.py +993 -0
  555. vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +239 -0
  556. vllm/model_executor/layers/fused_moe/fused_moe.py +1890 -0
  557. vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py +307 -0
  558. vllm/model_executor/layers/fused_moe/layer.py +2195 -0
  559. vllm/model_executor/layers/fused_moe/modular_kernel.py +1038 -0
  560. vllm/model_executor/layers/fused_moe/moe_align_block_size.py +87 -0
  561. vllm/model_executor/layers/fused_moe/moe_pallas.py +80 -0
  562. vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +205 -0
  563. vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
  564. vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +341 -0
  565. vllm/model_executor/layers/fused_moe/prepare_finalize.py +70 -0
  566. vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +424 -0
  567. vllm/model_executor/layers/fused_moe/routing_simulator.py +291 -0
  568. vllm/model_executor/layers/fused_moe/topk_weight_and_reduce.py +146 -0
  569. vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +143 -0
  570. vllm/model_executor/layers/fused_moe/trtllm_moe.py +191 -0
  571. vllm/model_executor/layers/fused_moe/utils.py +274 -0
  572. vllm/model_executor/layers/layernorm.py +395 -0
  573. vllm/model_executor/layers/lightning_attn.py +661 -0
  574. vllm/model_executor/layers/linear.py +1603 -0
  575. vllm/model_executor/layers/logits_processor.py +106 -0
  576. vllm/model_executor/layers/mamba/__init__.py +0 -0
  577. vllm/model_executor/layers/mamba/abstract.py +42 -0
  578. vllm/model_executor/layers/mamba/linear_attn.py +403 -0
  579. vllm/model_executor/layers/mamba/mamba_mixer.py +466 -0
  580. vllm/model_executor/layers/mamba/mamba_mixer2.py +764 -0
  581. vllm/model_executor/layers/mamba/mamba_utils.py +186 -0
  582. vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
  583. vllm/model_executor/layers/mamba/ops/causal_conv1d.py +1092 -0
  584. vllm/model_executor/layers/mamba/ops/layernorm_gated.py +168 -0
  585. vllm/model_executor/layers/mamba/ops/mamba_ssm.py +414 -0
  586. vllm/model_executor/layers/mamba/ops/ssd_bmm.py +242 -0
  587. vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +527 -0
  588. vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +724 -0
  589. vllm/model_executor/layers/mamba/ops/ssd_combined.py +238 -0
  590. vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +200 -0
  591. vllm/model_executor/layers/mamba/short_conv.py +253 -0
  592. vllm/model_executor/layers/mla.py +173 -0
  593. vllm/model_executor/layers/pooler.py +719 -0
  594. vllm/model_executor/layers/quantization/__init__.py +157 -0
  595. vllm/model_executor/layers/quantization/auto_round.py +388 -0
  596. vllm/model_executor/layers/quantization/awq.py +228 -0
  597. vllm/model_executor/layers/quantization/awq_marlin.py +554 -0
  598. vllm/model_executor/layers/quantization/awq_triton.py +320 -0
  599. vllm/model_executor/layers/quantization/base_config.py +170 -0
  600. vllm/model_executor/layers/quantization/bitblas.py +464 -0
  601. vllm/model_executor/layers/quantization/bitsandbytes.py +627 -0
  602. vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +0 -0
  603. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +797 -0
  604. vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +2074 -0
  605. vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +27 -0
  606. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +366 -0
  607. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +55 -0
  608. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +160 -0
  609. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_nvfp4.py +105 -0
  610. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +185 -0
  611. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_fp8.py +169 -0
  612. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_int.py +135 -0
  613. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +121 -0
  614. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +157 -0
  615. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +111 -0
  616. vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +201 -0
  617. vllm/model_executor/layers/quantization/compressed_tensors/transform/__init__.py +0 -0
  618. vllm/model_executor/layers/quantization/compressed_tensors/transform/linear.py +238 -0
  619. vllm/model_executor/layers/quantization/compressed_tensors/transform/module.py +153 -0
  620. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/__init__.py +0 -0
  621. vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/linear_qutlass_nvfp4.py +46 -0
  622. vllm/model_executor/layers/quantization/compressed_tensors/transform/utils.py +13 -0
  623. vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +206 -0
  624. vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
  625. vllm/model_executor/layers/quantization/deepspeedfp.py +196 -0
  626. vllm/model_executor/layers/quantization/experts_int8.py +223 -0
  627. vllm/model_executor/layers/quantization/fbgemm_fp8.py +172 -0
  628. vllm/model_executor/layers/quantization/fp8.py +1098 -0
  629. vllm/model_executor/layers/quantization/gguf.py +599 -0
  630. vllm/model_executor/layers/quantization/gptq.py +340 -0
  631. vllm/model_executor/layers/quantization/gptq_bitblas.py +448 -0
  632. vllm/model_executor/layers/quantization/gptq_marlin.py +751 -0
  633. vllm/model_executor/layers/quantization/gptq_marlin_24.py +297 -0
  634. vllm/model_executor/layers/quantization/hqq_marlin.py +333 -0
  635. vllm/model_executor/layers/quantization/inc.py +61 -0
  636. vllm/model_executor/layers/quantization/input_quant_fp8.py +156 -0
  637. vllm/model_executor/layers/quantization/ipex_quant.py +415 -0
  638. vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
  639. vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +91 -0
  640. vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +93 -0
  641. vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +116 -0
  642. vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +302 -0
  643. vllm/model_executor/layers/quantization/kernels/mixed_precision/conch.py +92 -0
  644. vllm/model_executor/layers/quantization/kernels/mixed_precision/cutlass.py +117 -0
  645. vllm/model_executor/layers/quantization/kernels/mixed_precision/dynamic_4bit.py +92 -0
  646. vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +143 -0
  647. vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +144 -0
  648. vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +139 -0
  649. vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +67 -0
  650. vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +89 -0
  651. vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +161 -0
  652. vllm/model_executor/layers/quantization/kernels/scaled_mm/cpu.py +206 -0
  653. vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +137 -0
  654. vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +41 -0
  655. vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +104 -0
  656. vllm/model_executor/layers/quantization/kv_cache.py +143 -0
  657. vllm/model_executor/layers/quantization/modelopt.py +1596 -0
  658. vllm/model_executor/layers/quantization/moe_wna16.py +484 -0
  659. vllm/model_executor/layers/quantization/mxfp4.py +988 -0
  660. vllm/model_executor/layers/quantization/petit.py +306 -0
  661. vllm/model_executor/layers/quantization/ptpc_fp8.py +129 -0
  662. vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
  663. vllm/model_executor/layers/quantization/quark/quark.py +432 -0
  664. vllm/model_executor/layers/quantization/quark/quark_moe.py +561 -0
  665. vllm/model_executor/layers/quantization/quark/schemes/__init__.py +9 -0
  666. vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +55 -0
  667. vllm/model_executor/layers/quantization/quark/schemes/quark_w4a4_mxfp4.py +239 -0
  668. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +163 -0
  669. vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +122 -0
  670. vllm/model_executor/layers/quantization/quark/utils.py +105 -0
  671. vllm/model_executor/layers/quantization/rtn.py +466 -0
  672. vllm/model_executor/layers/quantization/schema.py +86 -0
  673. vllm/model_executor/layers/quantization/torchao.py +214 -0
  674. vllm/model_executor/layers/quantization/tpu_int8.py +125 -0
  675. vllm/model_executor/layers/quantization/utils/__init__.py +6 -0
  676. vllm/model_executor/layers/quantization/utils/allspark_utils.py +52 -0
  677. vllm/model_executor/layers/quantization/utils/bitblas_utils.py +210 -0
  678. vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  679. vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  680. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  681. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  682. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  683. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  684. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  685. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  686. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  687. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  688. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  689. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  690. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  691. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  692. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  693. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  694. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  695. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  696. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  697. vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  698. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  699. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  700. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  701. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  702. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  703. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  704. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  705. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  706. vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  707. vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  708. vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  709. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  710. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  711. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  712. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  713. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  714. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  715. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  716. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  717. vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  718. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  719. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  720. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  721. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  722. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  723. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  724. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  725. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  726. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  727. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  728. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  729. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  730. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  731. vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  732. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  733. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  734. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  735. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  736. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  737. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  738. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  739. vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  740. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  741. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  742. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  743. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  744. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  745. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  746. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  747. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  748. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  749. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  750. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  751. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  752. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  753. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  754. vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  755. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  756. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  757. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  758. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  759. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  760. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  761. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  762. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  763. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  764. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  765. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  766. vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  767. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  768. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  769. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  770. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  771. vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  772. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  773. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  774. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  775. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  776. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  777. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  778. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  779. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  780. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  781. vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  782. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  783. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  784. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  785. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  786. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  787. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  788. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  789. vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  790. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  791. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  792. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  793. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  794. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  795. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  796. vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  797. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  798. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  799. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  800. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  801. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  802. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  803. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  804. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  805. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  806. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  807. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +18 -0
  808. vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  809. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  810. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  811. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  812. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  813. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  814. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  815. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  816. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  817. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  818. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  819. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  820. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  821. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  822. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  823. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  824. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  825. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  826. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  827. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  828. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  829. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  830. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  831. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  832. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  833. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  834. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  835. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  836. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  837. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  838. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  839. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  840. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  841. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  842. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  843. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  844. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  845. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  846. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  847. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  848. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  849. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  850. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  851. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  852. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  853. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  854. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  855. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  856. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  857. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  858. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  859. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  860. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  861. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  862. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  863. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  864. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  865. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  866. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  867. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  868. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  869. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  870. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  871. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  872. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  873. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  874. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  875. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  876. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  877. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  878. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  879. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
  880. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
  881. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
  882. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  883. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  884. vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  885. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  886. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  887. vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
  888. vllm/model_executor/layers/quantization/utils/configs/README.md +3 -0
  889. vllm/model_executor/layers/quantization/utils/flashinfer_fp4_moe.py +79 -0
  890. vllm/model_executor/layers/quantization/utils/flashinfer_utils.py +248 -0
  891. vllm/model_executor/layers/quantization/utils/fp8_utils.py +949 -0
  892. vllm/model_executor/layers/quantization/utils/gptq_utils.py +146 -0
  893. vllm/model_executor/layers/quantization/utils/int8_utils.py +492 -0
  894. vllm/model_executor/layers/quantization/utils/layer_utils.py +40 -0
  895. vllm/model_executor/layers/quantization/utils/machete_utils.py +50 -0
  896. vllm/model_executor/layers/quantization/utils/marlin_utils.py +479 -0
  897. vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +396 -0
  898. vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +345 -0
  899. vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +165 -0
  900. vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +464 -0
  901. vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +141 -0
  902. vllm/model_executor/layers/quantization/utils/mxfp8_utils.py +20 -0
  903. vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +137 -0
  904. vllm/model_executor/layers/quantization/utils/nvfp4_moe_support.py +59 -0
  905. vllm/model_executor/layers/quantization/utils/petit_utils.py +122 -0
  906. vllm/model_executor/layers/quantization/utils/quant_utils.py +641 -0
  907. vllm/model_executor/layers/quantization/utils/w8a8_utils.py +458 -0
  908. vllm/model_executor/layers/resampler.py +270 -0
  909. vllm/model_executor/layers/rotary_embedding/__init__.py +204 -0
  910. vllm/model_executor/layers/rotary_embedding/base.py +177 -0
  911. vllm/model_executor/layers/rotary_embedding/common.py +150 -0
  912. vllm/model_executor/layers/rotary_embedding/deepseek_scaling_rope.py +138 -0
  913. vllm/model_executor/layers/rotary_embedding/dual_chunk_rope.py +197 -0
  914. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_alpha_rope.py +41 -0
  915. vllm/model_executor/layers/rotary_embedding/dynamic_ntk_scaling_rope.py +67 -0
  916. vllm/model_executor/layers/rotary_embedding/ernie45_vl_rope.py +80 -0
  917. vllm/model_executor/layers/rotary_embedding/linear_scaling_rope.py +115 -0
  918. vllm/model_executor/layers/rotary_embedding/llama3_rope.py +54 -0
  919. vllm/model_executor/layers/rotary_embedding/llama4_vision_rope.py +81 -0
  920. vllm/model_executor/layers/rotary_embedding/mrope.py +1321 -0
  921. vllm/model_executor/layers/rotary_embedding/ntk_scaling_rope.py +42 -0
  922. vllm/model_executor/layers/rotary_embedding/phi3_long_rope_scaled_rope.py +129 -0
  923. vllm/model_executor/layers/rotary_embedding/rocm_aiter_rope_ops.py +86 -0
  924. vllm/model_executor/layers/rotary_embedding/yarn_scaling_rope.py +68 -0
  925. vllm/model_executor/layers/shared_fused_moe/__init__.py +6 -0
  926. vllm/model_executor/layers/shared_fused_moe/shared_fused_moe.py +56 -0
  927. vllm/model_executor/layers/utils.py +195 -0
  928. vllm/model_executor/layers/vocab_parallel_embedding.py +487 -0
  929. vllm/model_executor/model_loader/__init__.py +138 -0
  930. vllm/model_executor/model_loader/base_loader.py +52 -0
  931. vllm/model_executor/model_loader/bitsandbytes_loader.py +788 -0
  932. vllm/model_executor/model_loader/default_loader.py +277 -0
  933. vllm/model_executor/model_loader/dummy_loader.py +28 -0
  934. vllm/model_executor/model_loader/gguf_loader.py +155 -0
  935. vllm/model_executor/model_loader/runai_streamer_loader.py +104 -0
  936. vllm/model_executor/model_loader/sharded_state_loader.py +199 -0
  937. vllm/model_executor/model_loader/tensorizer.py +738 -0
  938. vllm/model_executor/model_loader/tensorizer_loader.py +143 -0
  939. vllm/model_executor/model_loader/tpu.py +114 -0
  940. vllm/model_executor/model_loader/utils.py +292 -0
  941. vllm/model_executor/model_loader/weight_utils.py +990 -0
  942. vllm/model_executor/models/__init__.py +33 -0
  943. vllm/model_executor/models/adapters.py +542 -0
  944. vllm/model_executor/models/aimv2.py +246 -0
  945. vllm/model_executor/models/apertus.py +579 -0
  946. vllm/model_executor/models/arcee.py +422 -0
  947. vllm/model_executor/models/arctic.py +558 -0
  948. vllm/model_executor/models/aria.py +650 -0
  949. vllm/model_executor/models/aya_vision.py +468 -0
  950. vllm/model_executor/models/baichuan.py +474 -0
  951. vllm/model_executor/models/bailing_moe.py +642 -0
  952. vllm/model_executor/models/bamba.py +514 -0
  953. vllm/model_executor/models/bert.py +665 -0
  954. vllm/model_executor/models/bert_with_rope.py +687 -0
  955. vllm/model_executor/models/blip.py +339 -0
  956. vllm/model_executor/models/blip2.py +712 -0
  957. vllm/model_executor/models/bloom.py +374 -0
  958. vllm/model_executor/models/chameleon.py +1139 -0
  959. vllm/model_executor/models/chatglm.py +476 -0
  960. vllm/model_executor/models/clip.py +407 -0
  961. vllm/model_executor/models/cohere2_vision.py +481 -0
  962. vllm/model_executor/models/commandr.py +465 -0
  963. vllm/model_executor/models/config.py +445 -0
  964. vllm/model_executor/models/dbrx.py +471 -0
  965. vllm/model_executor/models/deepseek.py +497 -0
  966. vllm/model_executor/models/deepseek_eagle.py +240 -0
  967. vllm/model_executor/models/deepseek_mtp.py +289 -0
  968. vllm/model_executor/models/deepseek_v2.py +1444 -0
  969. vllm/model_executor/models/deepseek_vl2.py +658 -0
  970. vllm/model_executor/models/dots1.py +546 -0
  971. vllm/model_executor/models/dots_ocr.py +873 -0
  972. vllm/model_executor/models/ernie45.py +43 -0
  973. vllm/model_executor/models/ernie45_moe.py +607 -0
  974. vllm/model_executor/models/ernie45_vl.py +1527 -0
  975. vllm/model_executor/models/ernie45_vl_moe.py +727 -0
  976. vllm/model_executor/models/ernie_mtp.py +268 -0
  977. vllm/model_executor/models/exaone.py +550 -0
  978. vllm/model_executor/models/exaone4.py +533 -0
  979. vllm/model_executor/models/fairseq2_llama.py +154 -0
  980. vllm/model_executor/models/falcon.py +509 -0
  981. vllm/model_executor/models/falcon_h1.py +674 -0
  982. vllm/model_executor/models/fuyu.py +399 -0
  983. vllm/model_executor/models/gemma.py +425 -0
  984. vllm/model_executor/models/gemma2.py +422 -0
  985. vllm/model_executor/models/gemma3.py +555 -0
  986. vllm/model_executor/models/gemma3_mm.py +721 -0
  987. vllm/model_executor/models/gemma3n.py +1113 -0
  988. vllm/model_executor/models/gemma3n_mm.py +761 -0
  989. vllm/model_executor/models/glm.py +23 -0
  990. vllm/model_executor/models/glm4.py +304 -0
  991. vllm/model_executor/models/glm4_1v.py +1690 -0
  992. vllm/model_executor/models/glm4_moe.py +727 -0
  993. vllm/model_executor/models/glm4_moe_mtp.py +301 -0
  994. vllm/model_executor/models/glm4v.py +654 -0
  995. vllm/model_executor/models/gpt2.py +380 -0
  996. vllm/model_executor/models/gpt_bigcode.py +344 -0
  997. vllm/model_executor/models/gpt_j.py +339 -0
  998. vllm/model_executor/models/gpt_neox.py +330 -0
  999. vllm/model_executor/models/gpt_oss.py +712 -0
  1000. vllm/model_executor/models/granite.py +489 -0
  1001. vllm/model_executor/models/granite_speech.py +794 -0
  1002. vllm/model_executor/models/granitemoe.py +550 -0
  1003. vllm/model_executor/models/granitemoehybrid.py +614 -0
  1004. vllm/model_executor/models/granitemoeshared.py +332 -0
  1005. vllm/model_executor/models/gritlm.py +262 -0
  1006. vllm/model_executor/models/grok1.py +547 -0
  1007. vllm/model_executor/models/h2ovl.py +536 -0
  1008. vllm/model_executor/models/hunyuan_v1.py +1042 -0
  1009. vllm/model_executor/models/hyperclovax_vision.py +1192 -0
  1010. vllm/model_executor/models/idefics2_vision_model.py +417 -0
  1011. vllm/model_executor/models/idefics3.py +756 -0
  1012. vllm/model_executor/models/interfaces.py +959 -0
  1013. vllm/model_executor/models/interfaces_base.py +192 -0
  1014. vllm/model_executor/models/intern_vit.py +441 -0
  1015. vllm/model_executor/models/internlm2.py +450 -0
  1016. vllm/model_executor/models/internlm2_ve.py +148 -0
  1017. vllm/model_executor/models/interns1.py +838 -0
  1018. vllm/model_executor/models/interns1_vit.py +418 -0
  1019. vllm/model_executor/models/internvl.py +1423 -0
  1020. vllm/model_executor/models/jais.py +373 -0
  1021. vllm/model_executor/models/jamba.py +591 -0
  1022. vllm/model_executor/models/jina_vl.py +144 -0
  1023. vllm/model_executor/models/keye.py +1680 -0
  1024. vllm/model_executor/models/keye_vl1_5.py +602 -0
  1025. vllm/model_executor/models/kimi_vl.py +618 -0
  1026. vllm/model_executor/models/lfm2.py +548 -0
  1027. vllm/model_executor/models/llama.py +669 -0
  1028. vllm/model_executor/models/llama4.py +746 -0
  1029. vllm/model_executor/models/llama4_eagle.py +239 -0
  1030. vllm/model_executor/models/llama_eagle.py +179 -0
  1031. vllm/model_executor/models/llama_eagle3.py +296 -0
  1032. vllm/model_executor/models/llava.py +870 -0
  1033. vllm/model_executor/models/llava_next.py +571 -0
  1034. vllm/model_executor/models/llava_next_video.py +476 -0
  1035. vllm/model_executor/models/llava_onevision.py +942 -0
  1036. vllm/model_executor/models/longcat_flash.py +715 -0
  1037. vllm/model_executor/models/longcat_flash_mtp.py +352 -0
  1038. vllm/model_executor/models/mamba.py +275 -0
  1039. vllm/model_executor/models/mamba2.py +291 -0
  1040. vllm/model_executor/models/medusa.py +169 -0
  1041. vllm/model_executor/models/midashenglm.py +792 -0
  1042. vllm/model_executor/models/mimo.py +188 -0
  1043. vllm/model_executor/models/mimo_mtp.py +280 -0
  1044. vllm/model_executor/models/minicpm.py +631 -0
  1045. vllm/model_executor/models/minicpm3.py +230 -0
  1046. vllm/model_executor/models/minicpm_eagle.py +389 -0
  1047. vllm/model_executor/models/minicpmo.py +770 -0
  1048. vllm/model_executor/models/minicpmv.py +1784 -0
  1049. vllm/model_executor/models/minimax_text_01.py +986 -0
  1050. vllm/model_executor/models/minimax_vl_01.py +426 -0
  1051. vllm/model_executor/models/mistral3.py +628 -0
  1052. vllm/model_executor/models/mixtral.py +606 -0
  1053. vllm/model_executor/models/mllama4.py +1076 -0
  1054. vllm/model_executor/models/mlp_speculator.py +206 -0
  1055. vllm/model_executor/models/modernbert.py +374 -0
  1056. vllm/model_executor/models/module_mapping.py +72 -0
  1057. vllm/model_executor/models/molmo.py +1567 -0
  1058. vllm/model_executor/models/moonvit.py +673 -0
  1059. vllm/model_executor/models/motif.py +345 -0
  1060. vllm/model_executor/models/mpt.py +329 -0
  1061. vllm/model_executor/models/nano_nemotron_vl.py +1394 -0
  1062. vllm/model_executor/models/nemotron.py +507 -0
  1063. vllm/model_executor/models/nemotron_h.py +565 -0
  1064. vllm/model_executor/models/nemotron_nas.py +481 -0
  1065. vllm/model_executor/models/nemotron_vl.py +652 -0
  1066. vllm/model_executor/models/nvlm_d.py +203 -0
  1067. vllm/model_executor/models/olmo.py +404 -0
  1068. vllm/model_executor/models/olmo2.py +439 -0
  1069. vllm/model_executor/models/olmoe.py +483 -0
  1070. vllm/model_executor/models/opt.py +412 -0
  1071. vllm/model_executor/models/orion.py +348 -0
  1072. vllm/model_executor/models/ovis.py +559 -0
  1073. vllm/model_executor/models/ovis2_5.py +642 -0
  1074. vllm/model_executor/models/paligemma.py +411 -0
  1075. vllm/model_executor/models/persimmon.py +343 -0
  1076. vllm/model_executor/models/phi.py +356 -0
  1077. vllm/model_executor/models/phi3.py +19 -0
  1078. vllm/model_executor/models/phi3v.py +698 -0
  1079. vllm/model_executor/models/phi4_multimodal.py +1475 -0
  1080. vllm/model_executor/models/phi4mm.py +1279 -0
  1081. vllm/model_executor/models/phi4mm_audio.py +1254 -0
  1082. vllm/model_executor/models/phi4mm_utils.py +1875 -0
  1083. vllm/model_executor/models/phimoe.py +679 -0
  1084. vllm/model_executor/models/pixtral.py +1345 -0
  1085. vllm/model_executor/models/plamo2.py +978 -0
  1086. vllm/model_executor/models/qwen.py +361 -0
  1087. vllm/model_executor/models/qwen2.py +523 -0
  1088. vllm/model_executor/models/qwen2_5_omni_thinker.py +984 -0
  1089. vllm/model_executor/models/qwen2_5_vl.py +1481 -0
  1090. vllm/model_executor/models/qwen2_audio.py +489 -0
  1091. vllm/model_executor/models/qwen2_moe.py +558 -0
  1092. vllm/model_executor/models/qwen2_rm.py +122 -0
  1093. vllm/model_executor/models/qwen2_vl.py +1670 -0
  1094. vllm/model_executor/models/qwen3.py +341 -0
  1095. vllm/model_executor/models/qwen3_moe.py +692 -0
  1096. vllm/model_executor/models/qwen3_next.py +1266 -0
  1097. vllm/model_executor/models/qwen3_next_mtp.py +281 -0
  1098. vllm/model_executor/models/qwen3_vl.py +1613 -0
  1099. vllm/model_executor/models/qwen3_vl_moe.py +358 -0
  1100. vllm/model_executor/models/qwen_vl.py +795 -0
  1101. vllm/model_executor/models/radio.py +576 -0
  1102. vllm/model_executor/models/registry.py +990 -0
  1103. vllm/model_executor/models/roberta.py +252 -0
  1104. vllm/model_executor/models/rvl.py +103 -0
  1105. vllm/model_executor/models/seed_oss.py +485 -0
  1106. vllm/model_executor/models/siglip.py +540 -0
  1107. vllm/model_executor/models/siglip2navit.py +689 -0
  1108. vllm/model_executor/models/skyworkr1v.py +911 -0
  1109. vllm/model_executor/models/smolvlm.py +44 -0
  1110. vllm/model_executor/models/solar.py +504 -0
  1111. vllm/model_executor/models/stablelm.py +341 -0
  1112. vllm/model_executor/models/starcoder2.py +354 -0
  1113. vllm/model_executor/models/step3_text.py +510 -0
  1114. vllm/model_executor/models/step3_vl.py +1072 -0
  1115. vllm/model_executor/models/swin.py +475 -0
  1116. vllm/model_executor/models/tarsier.py +639 -0
  1117. vllm/model_executor/models/telechat2.py +151 -0
  1118. vllm/model_executor/models/teleflm.py +79 -0
  1119. vllm/model_executor/models/terratorch.py +294 -0
  1120. vllm/model_executor/models/transformers.py +948 -0
  1121. vllm/model_executor/models/ultravox.py +654 -0
  1122. vllm/model_executor/models/utils.py +808 -0
  1123. vllm/model_executor/models/vision.py +404 -0
  1124. vllm/model_executor/models/voxtral.py +786 -0
  1125. vllm/model_executor/models/whisper.py +963 -0
  1126. vllm/model_executor/models/zamba2.py +960 -0
  1127. vllm/model_executor/parameter.py +620 -0
  1128. vllm/model_executor/utils.py +86 -0
  1129. vllm/model_executor/warmup/__init__.py +0 -0
  1130. vllm/model_executor/warmup/deep_gemm_warmup.py +230 -0
  1131. vllm/model_executor/warmup/kernel_warmup.py +83 -0
  1132. vllm/multimodal/__init__.py +33 -0
  1133. vllm/multimodal/audio.py +116 -0
  1134. vllm/multimodal/base.py +27 -0
  1135. vllm/multimodal/cache.py +697 -0
  1136. vllm/multimodal/evs.py +273 -0
  1137. vllm/multimodal/hasher.py +102 -0
  1138. vllm/multimodal/image.py +130 -0
  1139. vllm/multimodal/inputs.py +987 -0
  1140. vllm/multimodal/parse.py +511 -0
  1141. vllm/multimodal/processing.py +2148 -0
  1142. vllm/multimodal/profiling.py +284 -0
  1143. vllm/multimodal/registry.py +345 -0
  1144. vllm/multimodal/utils.py +503 -0
  1145. vllm/multimodal/video.py +319 -0
  1146. vllm/outputs.py +324 -0
  1147. vllm/platforms/__init__.py +263 -0
  1148. vllm/platforms/cpu.py +340 -0
  1149. vllm/platforms/cuda.py +668 -0
  1150. vllm/platforms/interface.py +620 -0
  1151. vllm/platforms/rocm.py +497 -0
  1152. vllm/platforms/tpu.py +233 -0
  1153. vllm/platforms/xpu.py +243 -0
  1154. vllm/plugins/__init__.py +72 -0
  1155. vllm/plugins/io_processors/__init__.py +68 -0
  1156. vllm/plugins/io_processors/interface.py +67 -0
  1157. vllm/plugins/lora_resolvers/README.md +16 -0
  1158. vllm/plugins/lora_resolvers/__init__.py +0 -0
  1159. vllm/plugins/lora_resolvers/filesystem_resolver.py +50 -0
  1160. vllm/pooling_params.py +191 -0
  1161. vllm/profiler/__init__.py +0 -0
  1162. vllm/profiler/layerwise_profile.py +375 -0
  1163. vllm/profiler/utils.py +148 -0
  1164. vllm/py.typed +2 -0
  1165. vllm/ray/__init__.py +0 -0
  1166. vllm/ray/lazy_utils.py +22 -0
  1167. vllm/ray/ray_env.py +72 -0
  1168. vllm/reasoning/__init__.py +29 -0
  1169. vllm/reasoning/abs_reasoning_parsers.py +202 -0
  1170. vllm/reasoning/basic_parsers.py +156 -0
  1171. vllm/reasoning/deepseek_r1_reasoning_parser.py +67 -0
  1172. vllm/reasoning/glm4_moe_reasoning_parser.py +151 -0
  1173. vllm/reasoning/gptoss_reasoning_parser.py +87 -0
  1174. vllm/reasoning/granite_reasoning_parser.py +363 -0
  1175. vllm/reasoning/hunyuan_a13b_reasoning_parser.py +245 -0
  1176. vllm/reasoning/mistral_reasoning_parser.py +56 -0
  1177. vllm/reasoning/qwen3_reasoning_parser.py +72 -0
  1178. vllm/reasoning/seedoss_reasoning_parser.py +28 -0
  1179. vllm/reasoning/step3_reasoning_parser.py +109 -0
  1180. vllm/sampling_params.py +593 -0
  1181. vllm/scalar_type.py +349 -0
  1182. vllm/scripts.py +15 -0
  1183. vllm/sequence.py +103 -0
  1184. vllm/tasks.py +11 -0
  1185. vllm/test_utils.py +129 -0
  1186. vllm/third_party/__init__.py +0 -0
  1187. vllm/third_party/pynvml.py +6140 -0
  1188. vllm/tracing.py +136 -0
  1189. vllm/transformers_utils/__init__.py +24 -0
  1190. vllm/transformers_utils/chat_templates/__init__.py +5 -0
  1191. vllm/transformers_utils/chat_templates/registry.py +70 -0
  1192. vllm/transformers_utils/chat_templates/template_basic.jinja +3 -0
  1193. vllm/transformers_utils/chat_templates/template_blip2.jinja +11 -0
  1194. vllm/transformers_utils/chat_templates/template_chatml.jinja +10 -0
  1195. vllm/transformers_utils/chat_templates/template_deepseek_vl2.jinja +23 -0
  1196. vllm/transformers_utils/chat_templates/template_fuyu.jinja +3 -0
  1197. vllm/transformers_utils/chat_templates/template_minicpmv45.jinja +93 -0
  1198. vllm/transformers_utils/config.py +1102 -0
  1199. vllm/transformers_utils/config_parser_base.py +20 -0
  1200. vllm/transformers_utils/configs/__init__.py +63 -0
  1201. vllm/transformers_utils/configs/arctic.py +207 -0
  1202. vllm/transformers_utils/configs/chatglm.py +72 -0
  1203. vllm/transformers_utils/configs/deepseek_v3.py +101 -0
  1204. vllm/transformers_utils/configs/deepseek_vl2.py +216 -0
  1205. vllm/transformers_utils/configs/dotsocr.py +69 -0
  1206. vllm/transformers_utils/configs/eagle.py +84 -0
  1207. vllm/transformers_utils/configs/falcon.py +90 -0
  1208. vllm/transformers_utils/configs/jais.py +237 -0
  1209. vllm/transformers_utils/configs/kimi_vl.py +37 -0
  1210. vllm/transformers_utils/configs/medusa.py +63 -0
  1211. vllm/transformers_utils/configs/midashenglm.py +101 -0
  1212. vllm/transformers_utils/configs/mistral.py +165 -0
  1213. vllm/transformers_utils/configs/mlp_speculator.py +68 -0
  1214. vllm/transformers_utils/configs/moonvit.py +33 -0
  1215. vllm/transformers_utils/configs/nemotron.py +205 -0
  1216. vllm/transformers_utils/configs/nemotron_h.py +259 -0
  1217. vllm/transformers_utils/configs/nemotron_vl.py +56 -0
  1218. vllm/transformers_utils/configs/olmo3.py +80 -0
  1219. vllm/transformers_utils/configs/ovis.py +176 -0
  1220. vllm/transformers_utils/configs/qwen3_next.py +275 -0
  1221. vllm/transformers_utils/configs/radio.py +91 -0
  1222. vllm/transformers_utils/configs/speculators/__init__.py +2 -0
  1223. vllm/transformers_utils/configs/speculators/algos.py +32 -0
  1224. vllm/transformers_utils/configs/speculators/base.py +111 -0
  1225. vllm/transformers_utils/configs/step3_vl.py +123 -0
  1226. vllm/transformers_utils/configs/ultravox.py +116 -0
  1227. vllm/transformers_utils/detokenizer_utils.py +199 -0
  1228. vllm/transformers_utils/dynamic_module.py +60 -0
  1229. vllm/transformers_utils/processor.py +299 -0
  1230. vllm/transformers_utils/processors/__init__.py +16 -0
  1231. vllm/transformers_utils/processors/deepseek_vl2.py +362 -0
  1232. vllm/transformers_utils/processors/ovis.py +420 -0
  1233. vllm/transformers_utils/processors/ovis2_5.py +458 -0
  1234. vllm/transformers_utils/runai_utils.py +104 -0
  1235. vllm/transformers_utils/s3_utils.py +93 -0
  1236. vllm/transformers_utils/tokenizer.py +292 -0
  1237. vllm/transformers_utils/tokenizer_base.py +154 -0
  1238. vllm/transformers_utils/tokenizers/__init__.py +10 -0
  1239. vllm/transformers_utils/tokenizers/mistral.py +521 -0
  1240. vllm/transformers_utils/utils.py +108 -0
  1241. vllm/triton_utils/__init__.py +16 -0
  1242. vllm/triton_utils/importing.py +96 -0
  1243. vllm/usage/__init__.py +0 -0
  1244. vllm/usage/usage_lib.py +259 -0
  1245. vllm/utils/__init__.py +3566 -0
  1246. vllm/utils/deep_gemm.py +319 -0
  1247. vllm/utils/flashinfer.py +443 -0
  1248. vllm/utils/jsontree.py +178 -0
  1249. vllm/utils/tensor_schema.py +235 -0
  1250. vllm/v1/__init__.py +0 -0
  1251. vllm/v1/attention/__init__.py +0 -0
  1252. vllm/v1/attention/backends/__init__.py +0 -0
  1253. vllm/v1/attention/backends/cpu_attn.py +919 -0
  1254. vllm/v1/attention/backends/flash_attn.py +795 -0
  1255. vllm/v1/attention/backends/flashinfer.py +1181 -0
  1256. vllm/v1/attention/backends/flex_attention.py +861 -0
  1257. vllm/v1/attention/backends/gdn_attn.py +332 -0
  1258. vllm/v1/attention/backends/linear_attn.py +67 -0
  1259. vllm/v1/attention/backends/mamba1_attn.py +81 -0
  1260. vllm/v1/attention/backends/mamba2_attn.py +232 -0
  1261. vllm/v1/attention/backends/mamba_attn.py +52 -0
  1262. vllm/v1/attention/backends/mla/__init__.py +0 -0
  1263. vllm/v1/attention/backends/mla/common.py +1783 -0
  1264. vllm/v1/attention/backends/mla/cutlass_mla.py +248 -0
  1265. vllm/v1/attention/backends/mla/flashattn_mla.py +271 -0
  1266. vllm/v1/attention/backends/mla/flashinfer_mla.py +114 -0
  1267. vllm/v1/attention/backends/mla/flashmla.py +203 -0
  1268. vllm/v1/attention/backends/mla/flashmla_sparse.py +544 -0
  1269. vllm/v1/attention/backends/mla/indexer.py +342 -0
  1270. vllm/v1/attention/backends/mla/rocm_aiter_mla.py +255 -0
  1271. vllm/v1/attention/backends/mla/triton_mla.py +177 -0
  1272. vllm/v1/attention/backends/pallas.py +409 -0
  1273. vllm/v1/attention/backends/rocm_aiter_fa.py +549 -0
  1274. vllm/v1/attention/backends/rocm_attn.py +426 -0
  1275. vllm/v1/attention/backends/short_conv_attn.py +94 -0
  1276. vllm/v1/attention/backends/tree_attn.py +451 -0
  1277. vllm/v1/attention/backends/triton_attn.py +361 -0
  1278. vllm/v1/attention/backends/utils.py +990 -0
  1279. vllm/v1/attention/backends/xformers.py +438 -0
  1280. vllm/v1/core/__init__.py +0 -0
  1281. vllm/v1/core/block_pool.py +416 -0
  1282. vllm/v1/core/encoder_cache_manager.py +333 -0
  1283. vllm/v1/core/kv_cache_coordinator.py +440 -0
  1284. vllm/v1/core/kv_cache_manager.py +399 -0
  1285. vllm/v1/core/kv_cache_utils.py +1291 -0
  1286. vllm/v1/core/sched/__init__.py +0 -0
  1287. vllm/v1/core/sched/async_scheduler.py +47 -0
  1288. vllm/v1/core/sched/interface.py +158 -0
  1289. vllm/v1/core/sched/output.py +166 -0
  1290. vllm/v1/core/sched/request_queue.py +224 -0
  1291. vllm/v1/core/sched/scheduler.py +1296 -0
  1292. vllm/v1/core/sched/utils.py +69 -0
  1293. vllm/v1/core/single_type_kv_cache_manager.py +671 -0
  1294. vllm/v1/cudagraph_dispatcher.py +125 -0
  1295. vllm/v1/engine/__init__.py +203 -0
  1296. vllm/v1/engine/async_llm.py +742 -0
  1297. vllm/v1/engine/coordinator.py +357 -0
  1298. vllm/v1/engine/core.py +1235 -0
  1299. vllm/v1/engine/core_client.py +1334 -0
  1300. vllm/v1/engine/detokenizer.py +349 -0
  1301. vllm/v1/engine/exceptions.py +17 -0
  1302. vllm/v1/engine/llm_engine.py +370 -0
  1303. vllm/v1/engine/logprobs.py +201 -0
  1304. vllm/v1/engine/output_processor.py +576 -0
  1305. vllm/v1/engine/parallel_sampling.py +133 -0
  1306. vllm/v1/engine/processor.py +545 -0
  1307. vllm/v1/engine/utils.py +860 -0
  1308. vllm/v1/executor/__init__.py +0 -0
  1309. vllm/v1/executor/abstract.py +137 -0
  1310. vllm/v1/executor/multiproc_executor.py +726 -0
  1311. vllm/v1/executor/ray_distributed_executor.py +108 -0
  1312. vllm/v1/executor/utils.py +23 -0
  1313. vllm/v1/kv_cache_interface.py +375 -0
  1314. vllm/v1/kv_offload/__init__.py +0 -0
  1315. vllm/v1/kv_offload/abstract.py +165 -0
  1316. vllm/v1/kv_offload/backend.py +96 -0
  1317. vllm/v1/kv_offload/backends/__init__.py +0 -0
  1318. vllm/v1/kv_offload/backends/cpu.py +61 -0
  1319. vllm/v1/kv_offload/cpu.py +75 -0
  1320. vllm/v1/kv_offload/factory.py +56 -0
  1321. vllm/v1/kv_offload/lru_manager.py +132 -0
  1322. vllm/v1/kv_offload/mediums.py +39 -0
  1323. vllm/v1/kv_offload/spec.py +61 -0
  1324. vllm/v1/kv_offload/worker/__init__.py +0 -0
  1325. vllm/v1/kv_offload/worker/cpu_gpu.py +171 -0
  1326. vllm/v1/kv_offload/worker/worker.py +142 -0
  1327. vllm/v1/metrics/__init__.py +0 -0
  1328. vllm/v1/metrics/loggers.py +741 -0
  1329. vllm/v1/metrics/prometheus.py +82 -0
  1330. vllm/v1/metrics/ray_wrappers.py +152 -0
  1331. vllm/v1/metrics/reader.py +246 -0
  1332. vllm/v1/metrics/stats.py +257 -0
  1333. vllm/v1/outputs.py +161 -0
  1334. vllm/v1/pool/__init__.py +0 -0
  1335. vllm/v1/pool/metadata.py +77 -0
  1336. vllm/v1/request.py +241 -0
  1337. vllm/v1/sample/__init__.py +0 -0
  1338. vllm/v1/sample/logits_processor/__init__.py +294 -0
  1339. vllm/v1/sample/logits_processor/builtin.py +275 -0
  1340. vllm/v1/sample/logits_processor/interface.py +97 -0
  1341. vllm/v1/sample/logits_processor/state.py +161 -0
  1342. vllm/v1/sample/metadata.py +43 -0
  1343. vllm/v1/sample/ops/__init__.py +0 -0
  1344. vllm/v1/sample/ops/bad_words.py +39 -0
  1345. vllm/v1/sample/ops/logprobs.py +26 -0
  1346. vllm/v1/sample/ops/penalties.py +43 -0
  1347. vllm/v1/sample/ops/topk_topp_sampler.py +292 -0
  1348. vllm/v1/sample/rejection_sampler.py +623 -0
  1349. vllm/v1/sample/sampler.py +285 -0
  1350. vllm/v1/sample/tpu/__init__.py +0 -0
  1351. vllm/v1/sample/tpu/metadata.py +124 -0
  1352. vllm/v1/sample/tpu/sampler.py +213 -0
  1353. vllm/v1/serial_utils.py +423 -0
  1354. vllm/v1/spec_decode/__init__.py +0 -0
  1355. vllm/v1/spec_decode/eagle.py +1011 -0
  1356. vllm/v1/spec_decode/medusa.py +66 -0
  1357. vllm/v1/spec_decode/metadata.py +62 -0
  1358. vllm/v1/spec_decode/metrics.py +211 -0
  1359. vllm/v1/spec_decode/ngram_proposer.py +276 -0
  1360. vllm/v1/spec_decode/utils.py +14 -0
  1361. vllm/v1/structured_output/__init__.py +295 -0
  1362. vllm/v1/structured_output/backend_guidance.py +245 -0
  1363. vllm/v1/structured_output/backend_lm_format_enforcer.py +167 -0
  1364. vllm/v1/structured_output/backend_outlines.py +320 -0
  1365. vllm/v1/structured_output/backend_types.py +134 -0
  1366. vllm/v1/structured_output/backend_xgrammar.py +327 -0
  1367. vllm/v1/structured_output/request.py +86 -0
  1368. vllm/v1/structured_output/utils.py +454 -0
  1369. vllm/v1/utils.py +396 -0
  1370. vllm/v1/worker/__init__.py +0 -0
  1371. vllm/v1/worker/block_table.py +210 -0
  1372. vllm/v1/worker/cpu_model_runner.py +175 -0
  1373. vllm/v1/worker/cpu_worker.py +156 -0
  1374. vllm/v1/worker/gpu_input_batch.py +863 -0
  1375. vllm/v1/worker/gpu_model_runner.py +4160 -0
  1376. vllm/v1/worker/gpu_ubatch_wrapper.py +399 -0
  1377. vllm/v1/worker/gpu_worker.py +710 -0
  1378. vllm/v1/worker/kv_connector_model_runner_mixin.py +132 -0
  1379. vllm/v1/worker/lora_model_runner_mixin.py +183 -0
  1380. vllm/v1/worker/tpu_input_batch.py +587 -0
  1381. vllm/v1/worker/tpu_model_runner.py +1946 -0
  1382. vllm/v1/worker/tpu_worker.py +346 -0
  1383. vllm/v1/worker/ubatch_splitting.py +192 -0
  1384. vllm/v1/worker/ubatch_utils.py +27 -0
  1385. vllm/v1/worker/ubatching.py +224 -0
  1386. vllm/v1/worker/utils.py +344 -0
  1387. vllm/v1/worker/worker_base.py +65 -0
  1388. vllm/v1/worker/xpu_model_runner.py +57 -0
  1389. vllm/v1/worker/xpu_worker.py +179 -0
  1390. vllm/version.py +41 -0
  1391. vllm/vllm_flash_attn/.gitkeep +0 -0
  1392. vllm/worker/__init__.py +0 -0
  1393. vllm/worker/worker_base.py +279 -0
  1394. vllm_cpu-0.11.0.post2.dist-info/METADATA +348 -0
  1395. vllm_cpu-0.11.0.post2.dist-info/RECORD +1398 -0
  1396. vllm_cpu-0.11.0.post2.dist-info/WHEEL +5 -0
  1397. vllm_cpu-0.11.0.post2.dist-info/entry_points.txt +5 -0
  1398. vllm_cpu-0.11.0.post2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1875 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+ # Copyright (c) Microsoft Corporation.
4
+ # Licensed under the MIT license.
5
+ # Code copied from Microsoft/MoE by Jacob Platin (jacobplatin@microsoft.com)
6
+ # but implemented by the Phi-Speech team
7
+ #!/usr/bin/env python3
8
+ import math
9
+ from typing import Optional, Union
10
+
11
+ import torch
12
+ import torch.nn.functional as F
13
+ from torch import Tensor, nn
14
+
15
+
16
+ class BlockBase(nn.Module):
17
+ """Block abstract module"""
18
+
19
+ def __init__(self, input_size: int, output_size: int) -> None:
20
+ super().__init__()
21
+ self.input_size = input_size
22
+ self.output_size = output_size
23
+
24
+
25
+ def get_activation(name: str = "relu") -> torch.nn.Module:
26
+ """Select an activation function by name
27
+
28
+ Args:
29
+ name: str
30
+ activation function name,
31
+ one of ["relu", "gelu", "swish", "sigmoid"],
32
+ default "relu".
33
+ """
34
+ name = name.lower()
35
+ if name == "relu":
36
+ return nn.ReLU(inplace=True)
37
+ if name == "gelu":
38
+ return nn.GELU()
39
+ if name == "swish":
40
+ return Swish()
41
+ if name == "sigmoid":
42
+ return torch.nn.Sigmoid()
43
+ return nn.Identity()
44
+
45
+
46
+ def adaptive_enc_mask(x_len: int,
47
+ chunk_start_idx: list[int],
48
+ left_window: int = 0,
49
+ right_window: int = 0) -> torch.Tensor:
50
+ """
51
+ The function is very important for Transformer Transducer Streaming mode
52
+ Args:
53
+ x_len: sequence length
54
+ chunk_start_idx: first idx of each chunk, such as [0,18,36,48].
55
+ It also supports adaptive chunk size [0,10,15,45]
56
+ left_window: how many left chunks can be seen
57
+ right_window: how many right chunks can be seen. It is used for
58
+ chunk overlap model.
59
+ Returns:
60
+ mask (torch.Tensor): a mask tensor for streaming model
61
+ Torch 1.0.1
62
+ tensor([[1., 1., 0., 0.],
63
+ [0., 1., 1., 0.],
64
+ [0., 0., 1., 1.]])
65
+ Torch 1.4.1
66
+ tensor([[True., True., False., False.],
67
+ [False., True., True., False.],
68
+ [False., False., True., True.]])
69
+ """
70
+ chunk_start_idx = torch.Tensor(chunk_start_idx).long(
71
+ ) # first idx of each chunk, such as [0,18,36,48].
72
+ start_pad = torch.nn.functional.pad(
73
+ chunk_start_idx,
74
+ (1, 0)) # append 0 to the beginning, so it becomes [0, 0, 18, 36, 48]
75
+ end_pad = torch.nn.functional.pad(
76
+ chunk_start_idx, (0, 1), value=x_len
77
+ ) # append x_len to the end, so it becomes [0,18,36,48, x_len]
78
+ seq_range = torch.arange(0,
79
+ x_len).unsqueeze(-1) # seq_range size: [x_len, 1]
80
+ idx = ((seq_range < end_pad) &
81
+ (seq_range >= start_pad)).nonzero()[:, 1] # idx size: [x_len]
82
+ # boundary = end_pad[idx] # boundary size: [x_len]
83
+ seq_range_expand = (torch.arange(0, x_len).unsqueeze(0).expand(x_len, -1)
84
+ ) # seq_range_expand size [x_len, x_len]
85
+ idx_left = idx - left_window
86
+ idx_left[idx_left < 0] = 0
87
+ boundary_left = start_pad[idx_left]
88
+ mask_left = seq_range_expand >= boundary_left.unsqueeze(-1)
89
+ idx_right = idx + right_window
90
+ idx_right[idx_right > len(chunk_start_idx)] = len(chunk_start_idx)
91
+ boundary_right = end_pad[idx_right]
92
+ mask_right = seq_range_expand < boundary_right.unsqueeze(-1)
93
+ return mask_left & mask_right
94
+
95
+
96
+ class Swish(nn.Module):
97
+ """Implement Swish activation module.
98
+ From https://arxiv.org/pdf/2005.03191.pdf
99
+
100
+ """
101
+
102
+ def __init__(self) -> None:
103
+ super().__init__()
104
+ self.act_fn = nn.Sigmoid()
105
+
106
+ def forward(self, x: Tensor) -> Tensor:
107
+ """Apply Swish function
108
+
109
+ Args:
110
+ x: torch.Tensor
111
+ Input.
112
+ """
113
+ return x * self.act_fn(x)
114
+
115
+
116
+ class GLU(nn.Module):
117
+ """Implement Gated Linear Unit (GLU) module"""
118
+
119
+ def __init__(self, dim: int = -1, act_name: str = "sigmoid") -> None:
120
+ super().__init__()
121
+ self.dim = dim
122
+ self.act_name = act_name.lower()
123
+
124
+ if self.act_name == "relu":
125
+ self.act_fn = nn.ReLU(inplace=True)
126
+ elif self.act_name == "gelu":
127
+ self.act_fn = nn.GELU()
128
+ elif self.act_name == "swish":
129
+ self.act_fn = Swish()
130
+ elif self.act_name == "sigmoid":
131
+ self.act_fn = nn.Sigmoid()
132
+ else:
133
+ self.act_fn = nn.Identity()
134
+
135
+ def forward(self, x: Tensor) -> Tensor:
136
+ """GLU forward
137
+ Apply Swish function on the first half of input matrices
138
+ with sigmoid of the second half.
139
+
140
+ Args:
141
+ x: torch.Tensor
142
+ Input.
143
+
144
+ """
145
+ half_x, gate = x.chunk(2, dim=self.dim)
146
+ return half_x * self.act_fn(gate)
147
+
148
+
149
+ # TODO: Abdel, this can be improved using GLU module
150
+ class GLUPointWiseConv(nn.Module):
151
+ """GLUPointWiseConv module
152
+ used for conformer architecture,
153
+ for more details see:
154
+ https://arxiv.org/pdf/2005.08100v1.pdf
155
+
156
+ Args:
157
+ input_dim: int
158
+ input channel size.
159
+ output_dim: int
160
+ output channel size.
161
+ kernel_size: int
162
+ kernel size
163
+ glu_type: str, optional
164
+ activation function one of
165
+ ["sigmoid", "relu", "gelu"]
166
+ default "sigmoid".
167
+ bias_in_glu: bool, optional
168
+ use addtive bias in glu
169
+ causal: bool, optional
170
+ if set to True, padding is set to the half of
171
+ kernel size, ie, convolution can't see future frames.
172
+ default False.
173
+
174
+ """
175
+
176
+ def __init__(
177
+ self,
178
+ input_dim: int,
179
+ output_dim: int,
180
+ kernel_size: int,
181
+ glu_type: str = "sigmoid",
182
+ bias_in_glu: bool = True,
183
+ causal: bool = False,
184
+ ) -> None:
185
+ super().__init__()
186
+
187
+ self.glu_type = glu_type
188
+ self.output_dim = output_dim
189
+ self.bias_in_glu = bias_in_glu
190
+ if causal:
191
+ self.ext_pw_conv_1d = nn.Conv1d(
192
+ input_dim,
193
+ output_dim * 2,
194
+ kernel_size,
195
+ 1,
196
+ padding=(kernel_size - 1),
197
+ )
198
+ else:
199
+ self.ext_pw_conv_1d = nn.Conv1d(
200
+ input_dim,
201
+ output_dim * 2,
202
+ kernel_size,
203
+ 1,
204
+ padding=(kernel_size - 1) // 2,
205
+ )
206
+
207
+ if glu_type == "sigmoid":
208
+ self.glu_act = nn.Sigmoid()
209
+ elif glu_type == "relu":
210
+ self.glu_act = nn.ReLU()
211
+ elif glu_type == "gelu":
212
+ self.glu_act = nn.GELU()
213
+ elif glu_type == "swish":
214
+ self.glu_act = Swish()
215
+ else:
216
+ raise ValueError(f"Unsupported activation type {self.glu_act}")
217
+
218
+ if bias_in_glu:
219
+ self.b1 = nn.Parameter(torch.zeros(1, output_dim, 1))
220
+ self.b2 = nn.Parameter(torch.zeros(1, output_dim, 1))
221
+
222
+ def forward(self, x: Tensor) -> Tensor:
223
+ """
224
+ Args:
225
+ x: input tensor
226
+ """
227
+ # to be consistent with GLULinear, we assume the input always has the
228
+ # #channel (#dim) in the last dimension of the tensor, so need to
229
+ # switch the dimension first for 1D-Conv case
230
+ x = x.permute([0, 2, 1])
231
+ x = self.ext_pw_conv_1d(x)
232
+ if self.glu_type == "bilinear":
233
+ if self.bias_in_glu:
234
+ x = (x[:, 0:self.output_dim, :] + self.b1) * (
235
+ x[:, self.output_dim:self.output_dim * 2, :] + self.b2)
236
+ else:
237
+ x = (x[:, 0:self.output_dim, :]) * (
238
+ x[:, self.output_dim:self.output_dim * 2, :])
239
+ else:
240
+ if self.bias_in_glu:
241
+ x = (x[:, 0:self.output_dim, :] + self.b1) * self.glu_act(
242
+ x[:, self.output_dim:self.output_dim * 2, :] + self.b2)
243
+ else:
244
+ x = (x[:, 0:self.output_dim, :]) * self.glu_act(
245
+ x[:, self.output_dim:self.output_dim * 2, :])
246
+
247
+ x = x.permute([0, 2, 1])
248
+ return x
249
+
250
+
251
+ class DepthWiseSeperableConv1d(nn.Module):
252
+ """DepthWiseSeperableConv1d module used in Convnet module
253
+ for the conformer, for more details see:
254
+ https://arxiv.org/pdf/2005.08100v1.pdf
255
+
256
+ Args:
257
+ input_dim: int
258
+ input channel size.
259
+ depthwise_seperable_out_channel: int
260
+ if set different to 0, the number of
261
+ depthwise_seperable_out_channel will be used as a channel_out
262
+ of the second conv1d layer.
263
+ otherwise, it equals to 0, the second conv1d layer is skipped.
264
+ kernel_size: int
265
+ kernel_size
266
+ depthwise_multiplier: int
267
+ number of input_dim channels duplication. this value
268
+ will be used to compute the hidden channels of the Conv1D.
269
+ padding: int, optional
270
+ padding for the conv1d,
271
+ default: 0.
272
+
273
+ """
274
+
275
+ def __init__(
276
+ self,
277
+ input_dim: int,
278
+ depthwise_seperable_out_channel: int,
279
+ kernel_size: int,
280
+ depthwise_multiplier: int,
281
+ padding: int = 0,
282
+ ) -> None:
283
+ super().__init__()
284
+
285
+ self.dw_conv = nn.Conv1d(
286
+ input_dim,
287
+ input_dim * depthwise_multiplier,
288
+ kernel_size,
289
+ 1,
290
+ padding=padding,
291
+ groups=input_dim,
292
+ )
293
+
294
+ if depthwise_seperable_out_channel != 0:
295
+ self.pw_conv = nn.Conv1d(
296
+ input_dim * depthwise_multiplier,
297
+ depthwise_seperable_out_channel,
298
+ 1,
299
+ 1,
300
+ 0,
301
+ )
302
+ else:
303
+ self.pw_conv = nn.Identity()
304
+ self.depthwise_seperable_out_channel = depthwise_seperable_out_channel
305
+
306
+ def forward(self, x: Tensor) -> Tensor:
307
+ """
308
+
309
+ Args:
310
+ x: input tensor
311
+ """
312
+ x = self.dw_conv(x)
313
+ if self.depthwise_seperable_out_channel != 0:
314
+ x = self.pw_conv(x)
315
+ return x
316
+
317
+
318
+ class ConvModule(nn.Module):
319
+ """ConvModule Module for the conformer block.
320
+ for more details see:
321
+ https://arxiv.org/pdf/2005.08100v1.pdf
322
+
323
+ Args:
324
+ input_dim: int
325
+ input channel size.
326
+ ext_pw_out_channel: int
327
+ if > 0, ext_pw_out_channel is a dim channel size
328
+ for the last pointwise conv after swish activation.
329
+ depthwise_seperable_out_channel: int
330
+ if set different to 0, the number of
331
+ depthwise_seperable_out_channel
332
+ will be used as a channel_out of the second conv1d layer.
333
+ otherwise, it equal to 0, the second conv1d layer is skipped.
334
+ ext_pw_kernel_size: int
335
+ kernel size of the conv pointwise of the conformer.
336
+ kernel_size: int
337
+ kernel size.
338
+ depthwise_multiplier: int
339
+ number of input_dim channels duplication. this value
340
+ will be used to compute the hidden channels of the Conv1D.
341
+ dropout_rate: float
342
+ dropout rate.
343
+ causal: bool, optional
344
+ if set to True, convolution have no access
345
+ to future frames. default False.
346
+ batch_norm: bool, optional
347
+ if set to True, apply batchnorm before activation.
348
+ default False
349
+ chunk_se: int, optional
350
+ 0 for offline SE.
351
+ 1 for streaming SE, where mean is computed
352
+ by accumulated history until current chunk_se.
353
+ 2 for streaming SE, where mean is computed
354
+ by only the current chunk.
355
+ chunk_size: int, optional
356
+ chunk size for cnn. default 18
357
+ activation: str, optional
358
+ activation function used in ConvModule,
359
+ default: "relu".
360
+ glu_type: str, optional
361
+ activation function used for the glu,
362
+ default: "sigmoid".
363
+ bias_in_glu: bool, optional
364
+ if set to True, use additive bias in the weight module
365
+ before GLU.
366
+ linear_glu_in_convm: bool, optional
367
+ if set to True, use GLULinear module,
368
+ otherwise, used GLUPointWiseConv module.
369
+ default to False.
370
+ export: bool, optional,
371
+ if set to True, padding is equal to 0. This is for inference,
372
+ or onnx export. Typically this is set by the export program or
373
+ the decoder program, and it isn't present in your config file.
374
+ default False
375
+ """
376
+
377
+ def __init__(
378
+ self,
379
+ input_dim: int,
380
+ ext_pw_out_channel: int,
381
+ depthwise_seperable_out_channel: int,
382
+ ext_pw_kernel_size: int,
383
+ kernel_size: int,
384
+ depthwise_multiplier: int,
385
+ dropout_rate: float,
386
+ causal: bool = False,
387
+ batch_norm: bool = False,
388
+ chunk_se: int = 0,
389
+ chunk_size: int = 18,
390
+ activation: str = "relu",
391
+ glu_type: str = "sigmoid",
392
+ bias_in_glu: bool = True,
393
+ linear_glu_in_convm: bool = False,
394
+ export: bool = False,
395
+ ) -> None:
396
+ super().__init__()
397
+ self.layer_norm = nn.LayerNorm(input_dim)
398
+ self.input_dim = input_dim
399
+ self.ext_pw_out_channel = ext_pw_out_channel
400
+ self.ext_pw_kernel_size = ext_pw_kernel_size
401
+ self.depthwise_seperable_out_channel = depthwise_seperable_out_channel
402
+ self.glu_type = glu_type
403
+ self.bias_in_glu = bias_in_glu
404
+ self.linear_glu_in_convm = linear_glu_in_convm
405
+ self.causal = causal
406
+
407
+ self._add_ext_pw_layer()
408
+
409
+ self.batch_norm = batch_norm
410
+ self.kernel_size = kernel_size
411
+
412
+ if batch_norm:
413
+ self.bn_layer = nn.BatchNorm1d(input_dim)
414
+
415
+ self.act = get_activation(activation)
416
+ self.dropout = nn.Dropout(dropout_rate)
417
+ self.export = export
418
+
419
+ if causal:
420
+ padding = 0 if export else kernel_size - 1
421
+ else:
422
+ padding = (kernel_size - 1) // 2
423
+
424
+ self.dw_sep_conv_1d = DepthWiseSeperableConv1d(
425
+ input_dim,
426
+ depthwise_seperable_out_channel,
427
+ kernel_size,
428
+ depthwise_multiplier,
429
+ padding=padding,
430
+ )
431
+
432
+ if depthwise_seperable_out_channel != 0:
433
+ if input_dim != depthwise_seperable_out_channel:
434
+ self.ln2 = nn.Linear(depthwise_seperable_out_channel,
435
+ input_dim)
436
+ else:
437
+ if depthwise_multiplier != 1:
438
+ self.ln2 = nn.Linear(input_dim * depthwise_multiplier,
439
+ input_dim)
440
+
441
+ def _add_ext_pw_layer(self) -> None:
442
+ """
443
+ This function is an extension of __init__ function
444
+ and dedicated to the convolution module creation
445
+ of the conformer.
446
+ """
447
+ self.ln1 = self.glu = self.bn_layer = self.ext_pw_conv_1d = (
448
+ nn.Identity()) # jit hacks.
449
+ self.squeeze_excitation = nn.Identity() # jit.
450
+ self.apply_ln1 = self.fix_len1 = False # jit.
451
+
452
+ if self.ext_pw_out_channel != 0:
453
+ if self.causal:
454
+ self.ext_pw_conv_1d = nn.Conv1d(
455
+ self.input_dim,
456
+ self.ext_pw_out_channel,
457
+ self.ext_pw_kernel_size,
458
+ 1,
459
+ padding=(self.ext_pw_kernel_size - 1),
460
+ )
461
+ if self.ext_pw_kernel_size > 1:
462
+ self.fix_len1 = True
463
+ else:
464
+ self.fix_len1 = False
465
+ else:
466
+ self.ext_pw_conv_1d = nn.Conv1d(
467
+ self.input_dim,
468
+ self.ext_pw_out_channel,
469
+ self.ext_pw_kernel_size,
470
+ 1,
471
+ padding=(self.ext_pw_kernel_size - 1) // 2,
472
+ )
473
+ self.fix_len1 = False
474
+
475
+ if self.linear_glu_in_convm:
476
+ self.glu = GLULinear(
477
+ self.input_dim,
478
+ self.ext_pw_out_channel,
479
+ self.glu_type,
480
+ self.bias_in_glu,
481
+ )
482
+ else:
483
+ self.glu = GLUPointWiseConv(
484
+ self.input_dim,
485
+ self.ext_pw_out_channel,
486
+ self.ext_pw_kernel_size,
487
+ self.glu_type,
488
+ self.bias_in_glu,
489
+ self.causal,
490
+ )
491
+
492
+ if self.input_dim != self.ext_pw_out_channel:
493
+ self.apply_ln1 = True
494
+ self.ln1 = nn.Linear(self.ext_pw_out_channel, self.input_dim)
495
+ else:
496
+ self.apply_ln1 = False
497
+ else:
498
+ self.pw_conv_simplify_w = torch.nn.Parameter(torch.ones(3))
499
+ self.pw_conv_simplify_b = torch.nn.Parameter(torch.zeros(3))
500
+
501
+ def forward(self, x: Tensor) -> Tensor:
502
+ """ConvModule Forward.
503
+
504
+ Args:
505
+ x: input tensor.
506
+ """
507
+ x = self.layer_norm(x)
508
+
509
+ if self.ext_pw_out_channel != 0:
510
+ x = self.glu(x)
511
+ if self.causal and self.ext_pw_kernel_size > 1:
512
+ x = x[:, :-(self.ext_pw_kernel_size - 1), :]
513
+ if self.apply_ln1:
514
+ x = self.ln1(x)
515
+ else:
516
+ x_0 = x * self.pw_conv_simplify_w[0] + self.pw_conv_simplify_b[0]
517
+ x_1 = x * self.pw_conv_simplify_w[1] + self.pw_conv_simplify_b[1]
518
+ x = x_0 + x_1
519
+
520
+ x = x.permute([0, 2, 1])
521
+
522
+ x = self.dw_sep_conv_1d(x)
523
+ if self.causal and self.kernel_size > 1:
524
+ x = x[:, :, :-(self.kernel_size - 1)]
525
+ if hasattr(self, "ln2"):
526
+ x = x.permute([0, 2, 1])
527
+ x = self.ln2(x)
528
+ x = x.permute([0, 2, 1])
529
+ if self.batch_norm:
530
+ x = self.bn_layer(x)
531
+ x = self.act(x)
532
+
533
+ if self.ext_pw_out_channel != 0:
534
+ x = self.ext_pw_conv_1d(x)
535
+ if self.fix_len1:
536
+ x = x[:, :, :-(self.ext_pw_kernel_size - 1)]
537
+
538
+ if self.apply_ln1:
539
+ x = x.permute([0, 2, 1])
540
+ x = self.ln1(x)
541
+ x = x.permute([0, 2, 1])
542
+
543
+ x = x.permute([0, 2, 1])
544
+ else:
545
+ x = x.unsqueeze(1).permute([0, 1, 3, 2])
546
+ x = x * self.pw_conv_simplify_w[2] + self.pw_conv_simplify_b[2]
547
+ x = x.squeeze(1)
548
+
549
+ x = self.dropout(x)
550
+ return x
551
+
552
+
553
+ class GLULinear(nn.Module):
554
+ """Linear + GLU module
555
+
556
+ Args:
557
+ input_dim: int
558
+ input size
559
+ output_dim: int
560
+ output size.
561
+ glu_type:
562
+ activation function name used in glu module.
563
+ default "sigmoid" (swish function).
564
+ bias_in_glu: bool, optional
565
+ If True, the addtive bias is added. Default False.
566
+ """
567
+
568
+ def __init__(
569
+ self,
570
+ input_dim: int,
571
+ output_dim: int,
572
+ glu_type: str = "sigmoid",
573
+ bias_in_glu: bool = True,
574
+ ) -> None:
575
+ super().__init__()
576
+ self.linear = nn.Linear(input_dim, output_dim * 2, bias_in_glu)
577
+ self.glu_act = GLU(-1, glu_type)
578
+
579
+ def forward(self, x: Tensor) -> Tensor:
580
+ """GLULinear forward
581
+
582
+ Args:
583
+ x: input tensor.
584
+ """
585
+ x = self.linear(x)
586
+ return self.glu_act(x)
587
+
588
+
589
+ class FeedForward(nn.Module):
590
+ """FeedForward Module.
591
+ For more details see Conformer paper:
592
+ https://arxiv.org/pdf/2005.08100.pdf
593
+
594
+ Args:
595
+ d_model: int
596
+ input size.
597
+ d_inner: int
598
+ output size.
599
+ dropout_rate: float,
600
+ dropout rate.
601
+ activation: str,
602
+ activation function name,
603
+ one of ["relu", "swish", "sigmoid"],
604
+ sigmoid activation is only used with "glu_in_fnn=True",
605
+ default "sigmoid".
606
+ bias_in_glu: bool, optional
607
+ """
608
+
609
+ def __init__(
610
+ self,
611
+ d_model: int,
612
+ d_inner: int,
613
+ dropout_rate: float,
614
+ activation: str = "sigmoid",
615
+ bias_in_glu: bool = True,
616
+ ) -> None:
617
+ super().__init__()
618
+ self.d_model = d_model
619
+ self.d_inner = d_inner
620
+
621
+ self.layer_norm = nn.LayerNorm(d_model)
622
+ module = GLULinear(d_model, d_inner, activation, bias_in_glu)
623
+ self.net = nn.Sequential(
624
+ module,
625
+ nn.Dropout(dropout_rate),
626
+ nn.Linear(d_inner, d_model),
627
+ nn.Dropout(dropout_rate),
628
+ )
629
+
630
+ def forward(self, x: Tensor) -> Tensor:
631
+ """FeedForward forward function.
632
+
633
+ Args:
634
+ x: input tensor.
635
+ """
636
+ out = self.net(self.layer_norm(x))
637
+
638
+ return out
639
+
640
+
641
+ #### positional encoding starts here
642
+ def _pre_hook(
643
+ state_dict: dict,
644
+ prefix: str,
645
+ local_metadata: dict,
646
+ strict: bool,
647
+ missing_keys: list[str],
648
+ unexpected_keys: list[str],
649
+ error_msgs: list[str],
650
+ ) -> None:
651
+ """Perform pre-hook in load_state_dict for backward compatibility.
652
+
653
+ Note:
654
+ We saved self.pe until v.0.5.2 but we have omitted it later.
655
+ Therefore, we remove the item "pe" from `state_dict` for backward
656
+ compatibility.
657
+
658
+ """
659
+ k = prefix + "pe"
660
+ if k in state_dict:
661
+ state_dict.pop(k)
662
+
663
+
664
+ class T5RelativeAttentionLogitBias(nn.Module):
665
+ """
666
+ This module implements the relative position bias described in Section
667
+ 2.1 of the T5 paper: https://arxiv.org/pdf/1910.10683.pdf
668
+
669
+ The Huggingface implementation is used as a reference
670
+ https://github.com/huggingface/transformers/blob/v4.30.0/src/
671
+ transformers/models/t5/modeling_t5.py#L435
672
+
673
+ Modifies attention as Q*K^T + B, where B is a learned scalar bias based
674
+ on relative position of the query and key. It is HxNxN, where H is the
675
+ number of heads, N is the sequence length.
676
+
677
+ I've made these modifications to the original T5 bias:
678
+ - Skipping of the bucketing step. Original T5 bias converted rel
679
+ position distances into logarithmically increasing buckets. This is
680
+ supposed to help with length generalization.
681
+ - I just directly use rel position index as bias values, as we don't
682
+ need length generalization (40s max is good enough for ASR encoder),
683
+ and it keeps ONNX export simple.
684
+ - I've also extended it so that biases can be asymmetric, the default
685
+ implementation treats L->R and R->L the same. Asymmetric was found to
686
+ yield better results in my experiments.
687
+
688
+ Args:
689
+ num_heads: int
690
+ Number of attention heads
691
+ num_buckets: int
692
+ Number of buckets to use for relative attention bias. This is the
693
+ size of the learnable bias parameter. Bucketing is not yet
694
+ supported, so this defaults to -1 which means no bucketing is
695
+ used (max_distance determines size of bias param).
696
+ max_distance: int
697
+ Maximum distance to use for relative attention bias. With
698
+ num_buckets=-1, this directly controls the max size of the bias
699
+ parameter. When num_buckets > 0 is supported, this will control
700
+ the maximum distance for logarithmic bucketing after which all
701
+ positions are in the same bucket.
702
+ symmetric: bool
703
+ Whether to use symmetric or asymmetric biases. symmetric=False uses
704
+ 2x number of bias params to distinguish L->R from R->L. This was
705
+ found to be better for the encoder.
706
+ """
707
+
708
+ def __init__(self,
709
+ num_heads: int,
710
+ num_buckets: int = -1,
711
+ max_distance: int = 1000,
712
+ symmetric: bool = False) -> None:
713
+ super().__init__()
714
+ self.num_heads = num_heads
715
+ self.num_buckets = num_buckets
716
+ self.max_distance = max_distance
717
+ self.symmetric = symmetric
718
+ self._skip_bucketing = self.num_buckets < 0
719
+ if self._skip_bucketing:
720
+ self.num_buckets = max_distance
721
+ else:
722
+ raise NotImplementedError(
723
+ "T5 attention bias with bucketed positions is not yet tested")
724
+ if not self.symmetric:
725
+ self.num_buckets *= 2
726
+ self.bias_values = nn.Embedding(self.num_buckets, self.num_heads)
727
+
728
+ def forward(self, x: Tensor) -> Tensor:
729
+ # instantiate bias compatible with shape of x
730
+ maxpos = x.size(1)
731
+ context_position = torch.arange(maxpos,
732
+ device=x.device,
733
+ dtype=torch.long)[:, None]
734
+ memory_position = torch.arange(maxpos,
735
+ device=x.device,
736
+ dtype=torch.long)[None, :]
737
+ relative_position = memory_position - context_position
738
+ # clipping to a maximum distance using ops that play well with ONNX
739
+ # export
740
+ relative_position = relative_position.masked_fill(
741
+ relative_position < -self.max_distance, -self.max_distance)
742
+ relative_position = relative_position.masked_fill(
743
+ relative_position > self.max_distance - 1, self.max_distance - 1)
744
+
745
+ # mapping from relative position to index in the bias parameter
746
+ if self._skip_bucketing:
747
+ bias_idx = relative_position
748
+ else:
749
+ bias_idx = self._bucket_relative_position(relative_position)
750
+ if self.symmetric:
751
+ bias_idx = bias_idx.abs()
752
+ else:
753
+ bias_idx += self.num_buckets // 2
754
+
755
+ t5_rel_att_bias = self.bias_values(bias_idx) # [L, L, H]
756
+ t5_rel_att_bias = t5_rel_att_bias.permute(2, 0, 1).unsqueeze(
757
+ 0) # [1, H, L, L]
758
+
759
+ return t5_rel_att_bias
760
+
761
+ def _bucket_relative_position(self, relative_position: Tensor) -> Tensor:
762
+ # this is a placeholder (isn't tested, likely buggy) using HuggingFace
763
+ # implem as a reference this also needs to be extended to support
764
+ # asymmetric +/- ve positions
765
+ relative_buckets = 0
766
+ if not self.causal:
767
+ self.num_buckets //= 2
768
+ relative_buckets += (relative_position > 0).to(
769
+ torch.long) * self.num_buckets
770
+ relative_position = torch.abs(relative_position)
771
+ else:
772
+ relative_position = -torch.min(relative_position,
773
+ torch.zeros_like(relative_position))
774
+ # now relative_position is in the range [0, inf)
775
+
776
+ # half of the buckets are for exact increments in positions
777
+ max_exact = self.num_buckets // 2
778
+ is_small = relative_position < max_exact
779
+
780
+ # The other half of the buckets are for logarithmically bigger bins in
781
+ # positions up to max_distance
782
+ relative_position_if_large = max_exact + (
783
+ torch.log(relative_position.float() / max_exact) /
784
+ math.log(self.max_distance / max_exact) *
785
+ (self.num_buckets - max_exact)).to(torch.long)
786
+ relative_position_if_large = torch.min(
787
+ relative_position_if_large,
788
+ torch.full_like(relative_position_if_large, self.num_buckets - 1),
789
+ )
790
+
791
+ relative_buckets += torch.where(is_small, relative_position,
792
+ relative_position_if_large)
793
+ return relative_buckets
794
+
795
+
796
+ class AbsolutePositionalEncoding(nn.Module):
797
+ """Absolute Positional encoding module.
798
+ This module implement Absolute sinusoidal positional encoding
799
+ from: https://arxiv.org/pdf/1706.03762.pdf
800
+
801
+ Args:
802
+ d_model: int
803
+ Input embedding size.
804
+ dropout_rate: float
805
+ dropout rate
806
+ max_len: int, optional
807
+ Maximum input length sequence, Default 5000
808
+
809
+ """
810
+
811
+ def __init__(self,
812
+ d_model: int,
813
+ dropout_rate: float,
814
+ max_len: int = 5000) -> None:
815
+ """Construct an PositionalEncoding object."""
816
+ super().__init__()
817
+ self.d_model = d_model
818
+ self.xscale = math.sqrt(self.d_model)
819
+ self.dropout = torch.nn.Dropout(p=dropout_rate)
820
+ self.pe = None
821
+ self.extend_pe(torch.tensor(0.0).expand(1, max_len))
822
+ self._register_load_state_dict_pre_hook(_pre_hook)
823
+
824
+ def extend_pe(self, x: torch.Tensor) -> None:
825
+ """Reset the positional encodings.
826
+
827
+ Args:
828
+ x: input tensor
829
+ """
830
+ if self.pe is not None and self.pe.size(1) >= x.size(1):
831
+ if self.pe.dtype != x.dtype or self.pe.device != x.device:
832
+ self.pe = self.pe.to(dtype=x.dtype, device=x.device)
833
+ return
834
+ pe = torch.zeros(x.size(1), self.d_model)
835
+ position = torch.arange(0, x.size(1), dtype=torch.float32).unsqueeze(1)
836
+ div_term = torch.exp(
837
+ torch.arange(0, self.d_model, 2, dtype=torch.float32) *
838
+ -(math.log(10000.0) / self.d_model))
839
+ pe[:, 0::2] = torch.sin(position * div_term)
840
+ pe[:, 1::2] = torch.cos(position * div_term)
841
+ pe = pe.unsqueeze(0)
842
+ self.pe = pe.to(device=x.device, dtype=x.dtype)
843
+
844
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
845
+ """Add positional encoding.
846
+
847
+ Args:
848
+ x: Input tensor. shape is (batch, time, ...)
849
+
850
+ Returns:
851
+ Encoded tensor. Its shape is (batch, time, ...)
852
+
853
+ """
854
+ self.extend_pe(x)
855
+ x = x * self.xscale + self.pe[:, :x.size(1)]
856
+ return self.dropout(x)
857
+
858
+
859
+ #### forward embedding layers starts here
860
+ class MeanVarianceNormLayer(nn.Module):
861
+ """Mean/variance normalization layer.
862
+
863
+ Will subtract mean and multiply input by inverted standard deviation.
864
+ Typically used as a very first layer in a model.
865
+
866
+ Args:
867
+ input_size: int
868
+ layer input size.
869
+ """
870
+
871
+ def __init__(self, input_size: int) -> None:
872
+ super().__init__()
873
+ self.input_size = input_size
874
+ self.global_mean = nn.Parameter(torch.zeros(input_size))
875
+ self.global_invstd = nn.Parameter(torch.ones(input_size))
876
+
877
+ def forward(self, input_: Tensor) -> Tensor:
878
+ """MeanVarianceNormLayer Forward
879
+
880
+ Args:
881
+ input_: input tensor.
882
+ """
883
+ return (input_ - self.global_mean) * self.global_invstd
884
+
885
+
886
+ class CausalConv1D(nn.Conv1d):
887
+ """
888
+ A causal version of nn.Conv1d where each step would have limited access to
889
+ locations on its right or left
890
+ All arguments are the same as nn.Conv1d except padding.
891
+
892
+ If padding is set None, then paddings are set automatically to make it a
893
+ causal convolution where each location would not see any steps on its right.
894
+
895
+ If padding is set as a list (size of 2), then padding[0] would be used as
896
+ left padding and padding[1] as right padding.
897
+ It would make it possible to control the number of steps to be accessible
898
+ on the right and left.
899
+ This mode is not supported when stride > 1. padding[0]+padding[1] should
900
+ be equal to (kernel_size - 1).
901
+ """
902
+
903
+ def __init__(
904
+ self,
905
+ in_channels: int,
906
+ out_channels: int,
907
+ kernel_size: int,
908
+ stride: int = 1,
909
+ padding: Union[str, int] = 0,
910
+ dilation: int = 1,
911
+ groups: int = 1,
912
+ bias: bool = True,
913
+ padding_mode: str = "zeros",
914
+ device=None,
915
+ dtype=None,
916
+ ) -> None:
917
+ self.cache_drop_size = None
918
+ if padding is None:
919
+ self._left_padding = kernel_size - 1
920
+ self._right_padding = stride - 1
921
+ else:
922
+ if stride != 1 and padding != kernel_size - 1:
923
+ raise ValueError(
924
+ "No striding allowed for non-symmetric convolutions!")
925
+ if isinstance(padding, int):
926
+ self._left_padding = padding
927
+ self._right_padding = padding
928
+ elif (isinstance(padding, list) and len(padding) == 2
929
+ and padding[0] + padding[1] == kernel_size - 1):
930
+ self._left_padding = padding[0]
931
+ self._right_padding = padding[1]
932
+ else:
933
+ raise ValueError(f"Invalid padding param: {padding}!")
934
+
935
+ self._max_cache_len = self._left_padding
936
+
937
+ super().__init__(
938
+ in_channels=in_channels,
939
+ out_channels=out_channels,
940
+ kernel_size=kernel_size,
941
+ stride=stride,
942
+ padding=0,
943
+ dilation=dilation,
944
+ groups=groups,
945
+ bias=bias,
946
+ padding_mode=padding_mode,
947
+ device=device,
948
+ dtype=dtype,
949
+ )
950
+
951
+ def update_cache(
952
+ self,
953
+ x: Tensor,
954
+ cache: Optional[Tensor] = None) -> tuple[Tensor, Optional[Tensor]]:
955
+ if cache is None:
956
+ new_x = F.pad(x, pad=(self._left_padding, self._right_padding))
957
+ next_cache = cache
958
+ else:
959
+ new_x = F.pad(x, pad=(0, self._right_padding))
960
+ new_x = torch.cat([cache, new_x], dim=-1)
961
+ if self.cache_drop_size > 0:
962
+ next_cache = new_x[:, :, :-self.cache_drop_size]
963
+ else:
964
+ next_cache = new_x
965
+ next_cache = next_cache[:, :, -cache.size(-1):]
966
+ return new_x, next_cache
967
+
968
+ def forward(
969
+ self,
970
+ x: Tensor,
971
+ cache: Optional[Tensor] = None
972
+ ) -> Union[Tensor, tuple[Tensor, Optional[Tensor]]]:
973
+ x, cache = self.update_cache(x, cache=cache)
974
+ x = super().forward(x)
975
+ if cache is None:
976
+ return x
977
+ else:
978
+ return x, cache
979
+
980
+
981
+ class CausalConv2D(nn.Conv2d):
982
+ """
983
+ A causal version of nn.Conv2d where each location in the 2D matrix would
984
+ have no access to locations on its right or down
985
+ All arguments are the same as nn.Conv2d except padding which should be
986
+ set as None
987
+ """
988
+
989
+ def __init__(
990
+ self,
991
+ in_channels: int,
992
+ out_channels: int,
993
+ kernel_size: int,
994
+ stride: int = 1,
995
+ padding: Union[str, int] = 0,
996
+ dilation: int = 1,
997
+ groups: int = 1,
998
+ bias: bool = True,
999
+ padding_mode: str = "zeros",
1000
+ device=None,
1001
+ dtype=None,
1002
+ ) -> None:
1003
+ if padding is not None:
1004
+ raise ValueError(
1005
+ "Argument padding should be set to None for CausalConv2D.")
1006
+ self._left_padding = kernel_size - 1
1007
+ self._right_padding = stride - 1
1008
+
1009
+ padding = 0
1010
+ super().__init__(
1011
+ in_channels,
1012
+ out_channels,
1013
+ kernel_size,
1014
+ stride,
1015
+ padding,
1016
+ dilation,
1017
+ groups,
1018
+ bias,
1019
+ padding_mode,
1020
+ device,
1021
+ dtype,
1022
+ )
1023
+
1024
+ def forward(
1025
+ self,
1026
+ x: Tensor,
1027
+ ) -> Tensor:
1028
+ x = F.pad(
1029
+ x,
1030
+ pad=(self._left_padding, self._right_padding, 0, 0),
1031
+ )
1032
+ x = super().forward(x)
1033
+ return x
1034
+
1035
+
1036
+ class NemoConvSubsampling(torch.nn.Module):
1037
+ """Convlutional subsampling module, taken from NeMo ASR
1038
+ (https://github.com/NVIDIA/NeMo/blob/b367413645d5c72db3c2c96e46e95a
1039
+ 34501479cf/nemo/collections/asr/parts/submodules/subsampling.py)
1040
+
1041
+ Striding Subsampling: "Speech-Transformer: A No-Recurrence
1042
+ Sequence-to-Sequence Model for Speech Recognition" by Linhao Dong
1043
+ et al. (https://ieeexplore.ieee.org/document/8462506)
1044
+
1045
+
1046
+ Compared with the EncoderConv2D (`input_layer: custom`), this is a
1047
+ much simplified approach, and uses no LayerNorm and far fewer Conv2Ds.
1048
+ Moreover, depthwise convolutions are used to reduce FLOPs, but the first
1049
+ layer is kept as a regular convolution so as not to degrade accuracy.
1050
+
1051
+ `Striding` and `dw_striding` are the same except that the latter uses
1052
+ depthwise convolutions after the first layer, whereas the former does not.
1053
+
1054
+ Args:
1055
+ subsampling_factor (int): Time reduction factor
1056
+ feat_in (int): size of the input features
1057
+ feat_out (int): size of the output features
1058
+ subsampling (str): The subsampling technique, choose from
1059
+ {"striding", "dw-striding", "striding_conv1d",
1060
+ "dw_striding_conv1d"}
1061
+ conv_channels (int): Number of channels for the convolution layers,
1062
+ default is 256.
1063
+ subsampling_conv_chunking_factor (int): Input chunking factor which
1064
+ can be -1 (no chunking) 1 (auto) or a power of 2. Default is 1
1065
+ activation (Module): activation function, default is nn.ReLU()
1066
+ is_causal (bool): whether to use causal Conv1/2D, where each step will
1067
+ have limited access to locations on its right or left
1068
+ """
1069
+
1070
+ def __init__(
1071
+ self,
1072
+ feat_in: int,
1073
+ feat_out: int,
1074
+ subsampling_factor: int = 4,
1075
+ subsampling: str = "dw_striding",
1076
+ conv_channels: int = 256,
1077
+ subsampling_conv_chunking_factor: int = 1,
1078
+ activation: torch.nn.Module = nn.ReLU(), # noqa: B008
1079
+ is_causal: bool = False,
1080
+ ) -> None:
1081
+ super().__init__()
1082
+ self._subsampling = subsampling
1083
+ self._conv_channels = conv_channels
1084
+ self._feat_in = feat_in
1085
+ self._feat_out = feat_out
1086
+
1087
+ if subsampling_factor % 2 != 0:
1088
+ raise ValueError("Sampling factor should be a multiply of 2!")
1089
+ self._sampling_num = int(math.log(subsampling_factor, 2))
1090
+ self.subsampling_factor = subsampling_factor
1091
+ self.is_causal = is_causal
1092
+ self.subsampling_causal_cond = subsampling in (
1093
+ "dw_striding",
1094
+ "striding",
1095
+ "striding_conv1d",
1096
+ )
1097
+
1098
+ if (subsampling_conv_chunking_factor != -1
1099
+ and subsampling_conv_chunking_factor != 1
1100
+ and subsampling_conv_chunking_factor % 2 != 0):
1101
+ raise ValueError(
1102
+ "subsampling_conv_chunking_factor should be -1, 1, or a "\
1103
+ "power of 2"
1104
+ )
1105
+ self.subsampling_conv_chunking_factor = \
1106
+ subsampling_conv_chunking_factor
1107
+
1108
+ in_channels = 1
1109
+ layers = []
1110
+
1111
+ if subsampling == "dw_striding":
1112
+ self._stride = 2
1113
+ self._kernel_size = 3
1114
+ self._ceil_mode = False
1115
+
1116
+ if self.is_causal:
1117
+ self._left_padding = self._kernel_size - 1
1118
+ self._right_padding = self._stride - 1
1119
+ self._max_cache_len = subsampling_factor + 1
1120
+ else:
1121
+ self._left_padding = (self._kernel_size - 1) // 2
1122
+ self._right_padding = (self._kernel_size - 1) // 2
1123
+ self._max_cache_len = 0
1124
+
1125
+ # Layer 1
1126
+ if self.is_causal:
1127
+ layers.append(
1128
+ CausalConv2D(
1129
+ in_channels=in_channels,
1130
+ out_channels=conv_channels,
1131
+ kernel_size=self._kernel_size,
1132
+ stride=self._stride,
1133
+ padding=None,
1134
+ ))
1135
+ else:
1136
+ layers.append(
1137
+ torch.nn.Conv2d(
1138
+ in_channels=in_channels,
1139
+ out_channels=conv_channels,
1140
+ kernel_size=self._kernel_size,
1141
+ stride=self._stride,
1142
+ padding=self._left_padding,
1143
+ ))
1144
+ in_channels = conv_channels
1145
+ layers.append(activation)
1146
+
1147
+ for i in range(self._sampling_num - 1):
1148
+ if self.is_causal:
1149
+ layers.append(
1150
+ CausalConv2D(
1151
+ in_channels=in_channels,
1152
+ out_channels=in_channels,
1153
+ kernel_size=self._kernel_size,
1154
+ stride=self._stride,
1155
+ padding=None,
1156
+ groups=in_channels,
1157
+ ))
1158
+ else:
1159
+ layers.append(
1160
+ torch.nn.Conv2d(
1161
+ in_channels=in_channels,
1162
+ out_channels=in_channels,
1163
+ kernel_size=self._kernel_size,
1164
+ stride=self._stride,
1165
+ padding=self._left_padding,
1166
+ groups=in_channels,
1167
+ ))
1168
+
1169
+ layers.append(
1170
+ torch.nn.Conv2d(
1171
+ in_channels=in_channels,
1172
+ out_channels=conv_channels,
1173
+ kernel_size=1,
1174
+ stride=1,
1175
+ padding=0,
1176
+ groups=1,
1177
+ ))
1178
+ layers.append(activation)
1179
+ in_channels = conv_channels
1180
+
1181
+ elif subsampling == "striding":
1182
+ self._stride = 2
1183
+ self._kernel_size = 3
1184
+ self._ceil_mode = False
1185
+
1186
+ if self.is_causal:
1187
+ self._left_padding = self._kernel_size - 1
1188
+ self._right_padding = self._stride - 1
1189
+ self._max_cache_len = subsampling_factor + 1
1190
+ else:
1191
+ self._left_padding = (self._kernel_size - 1) // 2
1192
+ self._right_padding = (self._kernel_size - 1) // 2
1193
+ self._max_cache_len = 0
1194
+
1195
+ for i in range(self._sampling_num):
1196
+ if self.is_causal:
1197
+ layers.append(
1198
+ CausalConv2D(
1199
+ in_channels=in_channels,
1200
+ out_channels=conv_channels,
1201
+ kernel_size=self._kernel_size,
1202
+ stride=self._stride,
1203
+ padding=None,
1204
+ ))
1205
+ else:
1206
+ layers.append(
1207
+ torch.nn.Conv2d(
1208
+ in_channels=in_channels,
1209
+ out_channels=conv_channels,
1210
+ kernel_size=self._kernel_size,
1211
+ stride=self._stride,
1212
+ padding=self._left_padding,
1213
+ ))
1214
+ layers.append(activation)
1215
+ in_channels = conv_channels
1216
+
1217
+ elif subsampling == "striding_conv1d":
1218
+ in_channels = feat_in
1219
+
1220
+ self._stride = 2
1221
+ self._kernel_size = 5
1222
+ self._ceil_mode = False
1223
+
1224
+ if self.is_causal:
1225
+ self._left_padding = self._kernel_size - 1
1226
+ self._right_padding = self._stride - 1
1227
+ self._max_cache_len = subsampling_factor + 1
1228
+ else:
1229
+ self._left_padding = (self._kernel_size - 1) // 2
1230
+ self._right_padding = (self._kernel_size - 1) // 2
1231
+ self._max_cache_len = 0
1232
+
1233
+ for i in range(self._sampling_num):
1234
+ if self.is_causal:
1235
+ layers.append(
1236
+ CausalConv1D(
1237
+ in_channels=in_channels,
1238
+ out_channels=(feat_out if self._sampling_num == i +
1239
+ 1 else conv_channels),
1240
+ kernel_size=self._kernel_size,
1241
+ stride=self._stride,
1242
+ padding=None,
1243
+ ))
1244
+ else:
1245
+ layers.append(
1246
+ torch.nn.Conv1d(
1247
+ in_channels=in_channels,
1248
+ out_channels=(feat_out if self._sampling_num == i +
1249
+ 1 else conv_channels),
1250
+ kernel_size=self._kernel_size,
1251
+ stride=self._stride,
1252
+ padding=self._left_padding,
1253
+ ))
1254
+ layers.append(activation)
1255
+ in_channels = conv_channels
1256
+
1257
+ elif subsampling == "dw_striding_conv1d":
1258
+ in_channels = feat_in
1259
+
1260
+ self._stride = 2
1261
+ self._kernel_size = 5
1262
+ self._ceil_mode = False
1263
+
1264
+ self._left_padding = (self._kernel_size - 1) // 2
1265
+ self._right_padding = (self._kernel_size - 1) // 2
1266
+
1267
+ # Layer 1
1268
+ layers.extend([
1269
+ torch.nn.Conv1d(
1270
+ in_channels=in_channels,
1271
+ out_channels=in_channels,
1272
+ kernel_size=self._kernel_size,
1273
+ stride=self._stride,
1274
+ padding=self._left_padding,
1275
+ groups=in_channels,
1276
+ ),
1277
+ torch.nn.Conv1d(
1278
+ in_channels=in_channels,
1279
+ out_channels=(feat_out if self._sampling_num == 1 else
1280
+ conv_channels),
1281
+ kernel_size=1,
1282
+ stride=1,
1283
+ padding=0,
1284
+ groups=1,
1285
+ ),
1286
+ ])
1287
+ in_channels = conv_channels
1288
+ layers.append(activation)
1289
+
1290
+ for i in range(self._sampling_num - 1):
1291
+ layers.extend([
1292
+ torch.nn.Conv1d(
1293
+ in_channels=in_channels,
1294
+ out_channels=in_channels,
1295
+ kernel_size=self._kernel_size,
1296
+ stride=self._stride,
1297
+ padding=self._left_padding,
1298
+ groups=in_channels,
1299
+ ),
1300
+ torch.nn.Conv1d(
1301
+ in_channels=in_channels,
1302
+ out_channels=(feat_out if self._sampling_num == i +
1303
+ 2 else conv_channels),
1304
+ kernel_size=1,
1305
+ stride=1,
1306
+ padding=0,
1307
+ groups=1,
1308
+ ),
1309
+ ])
1310
+ layers.append(activation)
1311
+ in_channels = conv_channels
1312
+
1313
+ else:
1314
+ raise ValueError(f"Not valid sub-sampling: {subsampling}!")
1315
+
1316
+ if subsampling in ["dw_striding", "striding"]:
1317
+ in_length = torch.tensor(feat_in, dtype=torch.float)
1318
+ out_length = calc_length(
1319
+ lengths=in_length,
1320
+ all_paddings=self._left_padding + self._right_padding,
1321
+ kernel_size=self._kernel_size,
1322
+ stride=self._stride,
1323
+ ceil_mode=self._ceil_mode,
1324
+ repeat_num=self._sampling_num,
1325
+ )
1326
+ self.out = torch.nn.Linear(conv_channels * int(out_length),
1327
+ feat_out)
1328
+ self.conv2d_subsampling = True
1329
+ elif subsampling in ["striding_conv1d", "dw_striding_conv1d"]:
1330
+ self.out = None
1331
+ self.conv2d_subsampling = False
1332
+ else:
1333
+ raise ValueError(f"Not valid sub-sampling: {subsampling}!")
1334
+
1335
+ self.conv = torch.nn.Sequential(*layers)
1336
+
1337
+ def get_sampling_frames(self) -> list[int]:
1338
+ return [1, self.subsampling_factor]
1339
+
1340
+ def get_streaming_cache_size(self) -> list[int]:
1341
+ return [0, self.subsampling_factor + 1]
1342
+
1343
+ def forward(self, x: Tensor,
1344
+ mask: Optional[Tensor]) -> tuple[Tensor, Optional[Tensor]]:
1345
+ """
1346
+ Forward method for NeMo subsampling.
1347
+
1348
+ Args:
1349
+ x: input tensor
1350
+ mask: input mask
1351
+
1352
+ Returns:
1353
+ x: Resulting tensor from subsampling (B, T //
1354
+ time_reduction_factor, feat_out)
1355
+ pad_mask: tensor of padded hidden state sequences (B, 1, T //
1356
+ time_reduction_factor)
1357
+ """
1358
+ x = x.unsqueeze(1) if self.conv2d_subsampling else x.transpose(1, 2)
1359
+
1360
+ # split inputs if chunking_factor is set
1361
+ if (self.subsampling_conv_chunking_factor != -1
1362
+ and self.conv2d_subsampling):
1363
+ if self.subsampling_conv_chunking_factor == 1:
1364
+ # if subsampling_conv_chunking_factor is 1, we split only
1365
+ # if needed.
1366
+ # avoiding a bug / feature limiting indexing of tensors
1367
+ # to 2**31.
1368
+ # see https://github.com/pytorch/pytorch/issues/80020
1369
+ x_ceil = (2**31 / self._conv_channels * self._stride *
1370
+ self._stride)
1371
+ need_to_split = torch.numel(x) > x_ceil
1372
+ else:
1373
+ # if subsampling_conv_chunking_factor > 1 we always split
1374
+ need_to_split = True
1375
+
1376
+ if need_to_split:
1377
+ x, success = self.conv_split_by_batch(x)
1378
+ if not success: # if unable to split by batch, try by channel
1379
+ if self._subsampling == "dw_striding":
1380
+ x = self.conv_split_by_channel(x)
1381
+ else:
1382
+ x = self.conv(x) # try anyway
1383
+ else:
1384
+ x = self.conv(x)
1385
+ else:
1386
+ x = self.conv(x)
1387
+
1388
+ # Flatten Channel and Frequency Axes
1389
+ if self.conv2d_subsampling:
1390
+ b, c, t, f = x.size()
1391
+ x = self.out(x.transpose(1, 2).reshape(b, t, -1))
1392
+ # Transpose to Channel Last mode
1393
+ else:
1394
+ x = x.transpose(1, 2)
1395
+
1396
+ if mask is None:
1397
+ return x, None
1398
+
1399
+ max_audio_length = x.shape[1]
1400
+ feature_lens = mask.sum(1)
1401
+ padding_length = torch.ceil(feature_lens / self.subsampling_factor)
1402
+ if self.is_causal and self.subsampling_causal_cond:
1403
+ feature_lens_remainder = feature_lens % self.subsampling_factor
1404
+ padding_length[feature_lens_remainder != 1] += 1
1405
+ pad_mask = torch.arange(0, max_audio_length, device=x.device).expand(
1406
+ padding_length.size(0), -1) < padding_length.unsqueeze(1)
1407
+ return x, pad_mask.unsqueeze(1)
1408
+
1409
+ def reset_parameters(self) -> None:
1410
+ # initialize weights
1411
+ if self._subsampling == "dw_striding":
1412
+ with torch.no_grad():
1413
+ # init conv
1414
+ scale = 1.0 / self._kernel_size
1415
+ dw_max = (self._kernel_size**2)**-0.5
1416
+ pw_max = self._conv_channels**-0.5
1417
+
1418
+ torch.nn.init.uniform_(self.conv[0].weight, -scale, scale)
1419
+ torch.nn.init.uniform_(self.conv[0].bias, -scale, scale)
1420
+
1421
+ for idx in range(2, len(self.conv), 3):
1422
+ torch.nn.init.uniform_(self.conv[idx].weight, -dw_max,
1423
+ dw_max)
1424
+ torch.nn.init.uniform_(self.conv[idx].bias, -dw_max,
1425
+ dw_max)
1426
+ torch.nn.init.uniform_(self.conv[idx + 1].weight, -pw_max,
1427
+ pw_max)
1428
+ torch.nn.init.uniform_(self.conv[idx + 1].bias, -pw_max,
1429
+ pw_max)
1430
+
1431
+ # init fc (80 * 64 = 5120 from https://github.com/kssteven418/
1432
+ # Squeezeformer/blob/13c97d6cf92f2844d2cb3142b4c5bfa9ad1a8951/
1433
+ # src/models/conformer_encoder.py#L487
1434
+ fc_scale = (self._feat_out * self._feat_in /
1435
+ self._sampling_num)**-0.5
1436
+ torch.nn.init.uniform_(self.out.weight, -fc_scale, fc_scale)
1437
+ torch.nn.init.uniform_(self.out.bias, -fc_scale, fc_scale)
1438
+
1439
+ def conv_split_by_batch(self, x: Tensor) -> tuple[Tensor, bool]:
1440
+ """Tries to split input by batch, run conv and concat results"""
1441
+ b, _, _, _ = x.size()
1442
+ if b == 1: # can't split if batch size is 1
1443
+ return x, False
1444
+
1445
+ if self.subsampling_conv_chunking_factor > 1:
1446
+ cf = self.subsampling_conv_chunking_factor
1447
+ else:
1448
+ # avoiding a bug / feature limiting indexing of tensors to 2**31
1449
+ # see https://github.com/pytorch/pytorch/issues/80020
1450
+ x_ceil = 2**31 / self._conv_channels * self._stride * self._stride
1451
+ p = math.ceil(math.log(torch.numel(x) / x_ceil, 2))
1452
+ cf = 2**p
1453
+
1454
+ new_batch_size = b // cf
1455
+ if new_batch_size == 0: # input is too big
1456
+ return x, False
1457
+
1458
+ return (
1459
+ torch.cat([
1460
+ self.conv(chunk)
1461
+ for chunk in torch.split(x, new_batch_size, 0)
1462
+ ]),
1463
+ True,
1464
+ )
1465
+
1466
+ def conv_split_by_channel(self, x: Tensor) -> Tensor:
1467
+ """For dw convs, tries to split input by time, run conv and concat
1468
+ results"""
1469
+ x = self.conv[0](x) # full conv2D
1470
+ x = self.conv[1](x) # activation
1471
+
1472
+ for i in range(self._sampling_num - 1):
1473
+ _, c, t, _ = x.size()
1474
+
1475
+ if self.subsampling_conv_chunking_factor > 1:
1476
+ cf = self.subsampling_conv_chunking_factor
1477
+ else:
1478
+ # avoiding a bug / feature limiting indexing of tensors
1479
+ # to 2**31
1480
+ # see https://github.com/pytorch/pytorch/issues/80020
1481
+ p = math.ceil(math.log(torch.numel(x) / 2**31, 2))
1482
+ cf = 2**p
1483
+
1484
+ new_c = int(c // cf)
1485
+ if new_c == 0:
1486
+ new_c = 1
1487
+
1488
+ new_t = int(t // cf)
1489
+ if new_t == 0:
1490
+ new_t = 1
1491
+
1492
+ x = self.channel_chunked_conv(self.conv[i * 3 + 2], new_c,
1493
+ x) # conv2D, depthwise
1494
+
1495
+ # splitting pointwise convs by time
1496
+ x = torch.cat(
1497
+ [
1498
+ self.conv[i * 3 + 3](chunk)
1499
+ for chunk in torch.split(x, new_t, 2)
1500
+ ],
1501
+ 2,
1502
+ ) # conv2D, pointwise
1503
+ x = self.conv[i * 3 + 4](x) # activation
1504
+ return x
1505
+
1506
+ def channel_chunked_conv(self, conv: torch.nn.Module, chunk_size: int,
1507
+ x: Tensor) -> Tensor:
1508
+ """Performs channel chunked convolution"""
1509
+
1510
+ ind = 0
1511
+ out_chunks = []
1512
+ for chunk in torch.split(x, chunk_size, 1):
1513
+ step = chunk.size()[1]
1514
+
1515
+ if self.is_causal:
1516
+ chunk = nn.functional.pad(
1517
+ chunk,
1518
+ pad=(
1519
+ self._kernel_size - 1,
1520
+ self._stride - 1,
1521
+ self._kernel_size - 1,
1522
+ self._stride - 1,
1523
+ ),
1524
+ )
1525
+ ch_out = nn.functional.conv2d(
1526
+ chunk,
1527
+ conv.weight[ind:ind + step, :, :, :],
1528
+ bias=conv.bias[ind:ind + step],
1529
+ stride=self._stride,
1530
+ padding=0,
1531
+ groups=step,
1532
+ )
1533
+ else:
1534
+ ch_out = nn.functional.conv2d(
1535
+ chunk,
1536
+ conv.weight[ind:ind + step, :, :, :],
1537
+ bias=conv.bias[ind:ind + step],
1538
+ stride=self._stride,
1539
+ padding=self._left_padding,
1540
+ groups=step,
1541
+ )
1542
+ out_chunks.append(ch_out)
1543
+ ind += step
1544
+
1545
+ return torch.cat(out_chunks, 1)
1546
+
1547
+ def change_subsampling_conv_chunking_factor(
1548
+ self, subsampling_conv_chunking_factor: int) -> None:
1549
+ if (subsampling_conv_chunking_factor != -1
1550
+ and subsampling_conv_chunking_factor != 1
1551
+ and subsampling_conv_chunking_factor % 2 != 0):
1552
+ raise ValueError(
1553
+ "subsampling_conv_chunking_factor should be -1, 1, or a "\
1554
+ "power of 2"
1555
+ )
1556
+ self.subsampling_conv_chunking_factor = subsampling_conv_chunking_factor
1557
+
1558
+
1559
+ def calc_length(lengths: Tensor,
1560
+ all_paddings: int,
1561
+ kernel_size: int,
1562
+ stride: int,
1563
+ ceil_mode: bool,
1564
+ repeat_num: int = 1) -> Tensor:
1565
+ """Calculates the output length of a Tensor passed through a convolution or
1566
+ max pooling layer"""
1567
+ add_pad: float = all_paddings - kernel_size
1568
+ one: float = 1.0
1569
+ for i in range(repeat_num):
1570
+ lengths = (torch.div(lengths.to(dtype=torch.float) + add_pad, stride) +
1571
+ one)
1572
+ lengths = torch.ceil(lengths) if ceil_mode else torch.floor(lengths)
1573
+ return lengths.to(dtype=torch.int)
1574
+
1575
+
1576
+ #### multihead attention starts here
1577
+ class AttModule(nn.Module):
1578
+ """Attention abstraction module"""
1579
+
1580
+ def __init__(self) -> None:
1581
+ super().__init__()
1582
+ self.export_mode = False
1583
+
1584
+ def set_export(self, mode: bool = True) -> None:
1585
+ """set the export mode"""
1586
+ self.export_mode = mode
1587
+
1588
+ def forward(
1589
+ self,
1590
+ x: Tensor,
1591
+ memory: Optional[Tensor] = None,
1592
+ pos_emb: Optional[Tensor] = None,
1593
+ att_mask: Optional[Tensor] = None,
1594
+ ) -> tuple[Tensor, Tensor, Optional[Tensor], Optional[Tensor]]:
1595
+ """AttModule forward
1596
+
1597
+ Args:
1598
+ x: input tensor.
1599
+ memory: memory tensor.
1600
+ pos_emb: positional encoder embedding.
1601
+ att_mask: attention mask tensor.
1602
+ """
1603
+ return x, memory, pos_emb, att_mask
1604
+
1605
+
1606
+ class AttBlock(BlockBase, AttModule):
1607
+ """Attention Block module to support both Attention and Block module."""
1608
+
1609
+ def memory_dims(self, max_len: bool = False) -> tuple[int, int]:
1610
+ """memory dimensions"""
1611
+ return (1, self.input_size)
1612
+
1613
+
1614
+ def masked_softmax(
1615
+ scores: Tensor,
1616
+ mask: Optional[Tensor],
1617
+ ) -> Tensor:
1618
+ if mask is not None:
1619
+ mask = mask.unsqueeze(1).eq(0) # (batch, 1, time1, time2)
1620
+ scores = scores.masked_fill(mask, -torch.inf)
1621
+ attn = torch.softmax(scores, dim=-1).masked_fill(
1622
+ mask, 0.0) # (batch, head, time1, time2)
1623
+ else:
1624
+ attn = torch.softmax(scores, dim=-1) # (batch, head, time1, time2)
1625
+ return attn
1626
+
1627
+
1628
+ class MultiHeadedAttention(nn.Module):
1629
+ """Multi-Head Attention layer with optional relative position embedding
1630
+ and GLU.
1631
+
1632
+ Args:
1633
+ n_head: int
1634
+ the number of heads.
1635
+ n_feat: int
1636
+ input size features.
1637
+ dropout_rate: float
1638
+ dropout rate.
1639
+ attention_inner_dim: int, optional
1640
+ the attention dimension used in the class,
1641
+ it can be different from the input dimension n_feat.
1642
+ default: -1 (equal to n_feat).
1643
+ use_pt_scaled_dot_product_attention: bool, optional
1644
+ if set True, use pytorch scaled dot product attention in training.
1645
+ NOTE: this will NOT be used in ONNX decoding due to a lack of
1646
+ support. In that case, we use the original attention
1647
+ implementation, which shows no regression.
1648
+ default: False.
1649
+ n_value: int, optional
1650
+ if set to values other than -1, use a different dimension for
1651
+ value. With the default value (i.e. -1), it is backward compatible.
1652
+ group_size: int, optional. must divide `n_head`
1653
+ if group_size > 1: GQA
1654
+ if group_size = 1: MHA
1655
+ if group_size = n_head: MQA
1656
+ """
1657
+
1658
+ inv_sqrt_d_k: torch.jit.Final[float]
1659
+ h: torch.jit.Final[int]
1660
+ h_k: torch.jit.Final[int]
1661
+ g: torch.jit.Final[int]
1662
+
1663
+ def __init__(
1664
+ self,
1665
+ n_head: int,
1666
+ n_feat: int,
1667
+ dropout_rate: float,
1668
+ attention_inner_dim: int = -1,
1669
+ glu_type: str = "swish",
1670
+ bias_in_glu: bool = True,
1671
+ use_pt_scaled_dot_product_attention: bool = False,
1672
+ n_value: int = -1,
1673
+ group_size: int = 1,
1674
+ ) -> None:
1675
+ super().__init__()
1676
+ if n_value == -1:
1677
+ n_value = n_feat
1678
+ if attention_inner_dim == -1:
1679
+ attention_inner_dim = n_feat
1680
+ assert attention_inner_dim % n_head == 0
1681
+
1682
+ # We assume d_v always equals d_k
1683
+ self.d_k = attention_inner_dim // n_head
1684
+ self.inv_sqrt_d_k = 1.0 / math.sqrt(self.d_k)
1685
+ self.h = n_head
1686
+ assert n_head % group_size == 0, "group_size must divide n_head"
1687
+ self.g = group_size
1688
+ self.h_k = n_head // group_size
1689
+
1690
+ self.linear_q = nn.Linear(n_feat, attention_inner_dim)
1691
+ self.linear_k = nn.Linear(n_feat, attention_inner_dim // group_size)
1692
+ self.linear_v = nn.Linear(n_value, attention_inner_dim // group_size)
1693
+ self.linear_out = nn.Linear(attention_inner_dim // group_size, n_value)
1694
+
1695
+ self.attn = torch.jit.Attribute(None, Optional[Tensor])
1696
+ self.dropout = nn.Dropout(p=dropout_rate)
1697
+ self.dropout_rate = dropout_rate
1698
+ self.use_pt_scaled_dot_product_attention = (
1699
+ use_pt_scaled_dot_product_attention)
1700
+
1701
+ if use_pt_scaled_dot_product_attention and group_size > 1:
1702
+ raise ValueError("Cannot use PT Scaled Attention with GQA")
1703
+
1704
+ # Torchscript eager quantization. Note that these functions below are
1705
+ # NOOPs and have very little impact on performance unless quantization
1706
+ # is enabled.
1707
+ self.quant_q = torch.ao.quantization.QuantStub()
1708
+ self.quant_x = torch.ao.quantization.QuantStub()
1709
+ self.dequant = torch.ao.quantization.DeQuantStub()
1710
+ self.ffunc = torch.ao.nn.quantized.FloatFunctional()
1711
+
1712
+ def forward(
1713
+ self,
1714
+ query: Tensor,
1715
+ key: Tensor,
1716
+ value: Tensor,
1717
+ pos_k: Optional[Tensor],
1718
+ pos_v: Optional[Tensor],
1719
+ mask: Optional[Tensor],
1720
+ relative_attention_bias: Optional[Tensor] = None,
1721
+ ) -> Tensor:
1722
+ """Compute 'Scaled Dot Product Attention'.
1723
+
1724
+ Args:
1725
+ query: query tensor (batch, time1, size)
1726
+ key: key tensor (batch, time2, size)
1727
+ value: value tensor (batch, time1, size)
1728
+ pos_k: key tensor used for relative positional embedding.
1729
+ pos_v: value tensor used for relative positional embedding.
1730
+ mask: mask tensor (batch, time1, time2)
1731
+ relative_attention_bias: bias added to attention logits w.r.t.
1732
+ relative positions
1733
+ (1, n_head, time1, time2)
1734
+ """
1735
+ n_batch = query.size(0)
1736
+
1737
+ q = self.linear_q(query).view(n_batch, -1, self.h,
1738
+ self.d_k) # (b, t, d)
1739
+ k = self.linear_k(key).view(n_batch, -1, self.h_k,
1740
+ self.d_k) # (b, t, d)
1741
+ v = self.linear_v(value).view(n_batch, -1, self.h_k, self.d_k)
1742
+ q = (q.transpose(1, 2) if self.use_pt_scaled_dot_product_attention
1743
+ and not torch.jit.is_scripting() else q.transpose(1, 2) *
1744
+ self.inv_sqrt_d_k)
1745
+ k = k.transpose(1, 2) # (batch, head_k, time2, d_k)
1746
+ v = v.transpose(1, 2) # (batch, head_k, time2, d_k)
1747
+
1748
+ if (self.use_pt_scaled_dot_product_attention
1749
+ and not torch.jit.is_scripting()):
1750
+ attn_mask = None
1751
+ if mask is not None:
1752
+ mask = mask.unsqueeze(1)
1753
+ if relative_attention_bias is not None:
1754
+ attn_mask = mask + relative_attention_bias
1755
+ else:
1756
+ attn_mask = mask
1757
+ if mask.dtype != q.dtype:
1758
+ attn_mask = attn_mask.to(q.dtype)
1759
+
1760
+ with torch.nn.attention.sdpa_kernel([
1761
+ torch.nn.attention.SDPBackend.FLASH_ATTENTION,
1762
+ torch.nn.attention.SDPBackend.EFFICIENT_ATTENTION,
1763
+ torch.nn.attention.SDPBackend.MATH,
1764
+ torch.nn.attention.SDPBackend.CUDNN_ATTENTION,
1765
+ ]):
1766
+ x = torch.nn.functional.scaled_dot_product_attention(
1767
+ q,
1768
+ k,
1769
+ v,
1770
+ attn_mask=attn_mask,
1771
+ dropout_p=self.dropout_rate,
1772
+ )
1773
+ else:
1774
+ if self.h != self.h_k:
1775
+ q = q.reshape(n_batch, self.g, self.h_k, -1, self.d_k)
1776
+ A = torch.einsum("b g h t d, b h s d -> b h t s", q, k)
1777
+ else:
1778
+ A = torch.matmul(q, k.transpose(-2, -1))
1779
+ if pos_k is not None:
1780
+ if self.h != self.h_k:
1781
+ B = torch.einsum("b g h t d, t s d -> b h t s", q, pos_k)
1782
+ else:
1783
+ reshape_q = (q.contiguous().view(n_batch * self.h, -1,
1784
+ self.d_k).transpose(0, 1)
1785
+ ) # (t1,nh,dk)
1786
+ B = torch.matmul(reshape_q,
1787
+ pos_k.transpose(-2,
1788
+ -1)) # pos_k: (t1,dk,t2)
1789
+ B = B.transpose(0, 1).view(n_batch, self.h, pos_k.size(0),
1790
+ pos_k.size(1))
1791
+ scores = A + B
1792
+ else:
1793
+ scores = A
1794
+
1795
+ if relative_attention_bias is not None:
1796
+ scores = scores + relative_attention_bias
1797
+
1798
+ attn = masked_softmax(scores, mask) # (batch, head, time1, time2)
1799
+
1800
+ self.attn = attn
1801
+
1802
+ p_attn = self.dropout(attn)
1803
+ x = torch.matmul(p_attn.to(v.dtype),
1804
+ v) # (batch, head, time1, d_k)
1805
+ if pos_v is not None:
1806
+ reshape_attn = (p_attn.contiguous().view(
1807
+ n_batch * self.h, pos_v.size(0),
1808
+ pos_v.size(1)).transpose(0, 1)) # (t1, bh, t2)
1809
+
1810
+ attn_v = (torch.matmul(reshape_attn, pos_v).transpose(
1811
+ 0, 1).contiguous().view(n_batch, self.h, pos_v.size(0),
1812
+ self.d_k))
1813
+ x = x + attn_v
1814
+ x = (x.transpose(1, 2).contiguous().view(n_batch, -1,
1815
+ self.h_k * self.d_k)
1816
+ ) # (batch, time1, d_model)
1817
+
1818
+ return self.linear_out(x) # (batch, time1, d_model)
1819
+
1820
+
1821
+ class MultiSequential(torch.nn.Sequential):
1822
+ """Multi-input multi-output torch.nn.Sequential"""
1823
+
1824
+ @torch.jit.ignore
1825
+ def forward(self, *args) -> tuple:
1826
+ """Forward method implementation."""
1827
+ for m in self:
1828
+ args = m(*args)
1829
+ return args
1830
+
1831
+
1832
+ def get_offset(input_layer: str, time_reduction: int) -> int:
1833
+ """Get an offset. We will use the offset for determining #frames of a
1834
+ subsampled feature.
1835
+
1836
+ Args:
1837
+ input_layer: Type of an input layer
1838
+ time_reduction: time reduction factor for downsampling a feature
1839
+ Returns:
1840
+ int: offset
1841
+ """
1842
+ if input_layer in ("conv2d", "nemo_conv") and time_reduction == 4:
1843
+ return 3
1844
+ if input_layer in ("conv2d", ) and time_reduction == 6:
1845
+ return 1
1846
+ if input_layer in ("conv2d", "nemo_conv") and time_reduction == 8:
1847
+ return 7
1848
+ return 0
1849
+
1850
+
1851
+ def unfold_tensor(xs_pad: Tensor, max_seq_len: int) -> Tensor:
1852
+ """
1853
+ For a given tensor with shape of (N, T, D), if sequence length T is
1854
+ longer than max_seq_len, this function unfold it to a
1855
+ (NT', max_seq_len, D) where T' is T // max_seq_len.
1856
+ Args:
1857
+ xs_pad: input tensor with shape (N, T, D)
1858
+ max_seq_len: maximum sequence length
1859
+ """
1860
+ _, _, D = xs_pad.shape
1861
+ xs_pad = xs_pad.transpose(-1, -2) # convert to N, D, T
1862
+ # N x D x 1 x T => N x (D x max_seq_len) x T'
1863
+ xs_pad = F.unfold(
1864
+ xs_pad[..., None, :],
1865
+ kernel_size=(1, max_seq_len),
1866
+ stride=(1, max_seq_len),
1867
+ )
1868
+ new_bsz, _, slen = xs_pad.shape
1869
+ # N x D x max_seq_len x T'
1870
+ xs_pad = xs_pad.view(new_bsz, -1, max_seq_len, slen)
1871
+ # N x T' x max_seq_len x D
1872
+ xs_pad = xs_pad.permute(0, 3, 2, 1).contiguous()
1873
+ # NT' x max_seq_len x D
1874
+ xs_pad = xs_pad.view(-1, max_seq_len, D)
1875
+ return xs_pad