vllm-cpu-amxbf16 0.11.2.post2__cp310-cp310-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.
- vllm/_C.abi3.so +0 -0
- vllm/__init__.py +225 -0
- vllm/_aiter_ops.py +983 -0
- vllm/_bc_linter.py +54 -0
- vllm/_custom_ops.py +2863 -0
- vllm/_ipex_ops.py +457 -0
- vllm/_version.py +34 -0
- vllm/assets/__init__.py +0 -0
- vllm/assets/audio.py +43 -0
- vllm/assets/base.py +40 -0
- vllm/assets/image.py +59 -0
- vllm/assets/video.py +149 -0
- vllm/attention/__init__.py +18 -0
- vllm/attention/backends/__init__.py +0 -0
- vllm/attention/backends/abstract.py +391 -0
- vllm/attention/backends/registry.py +195 -0
- vllm/attention/backends/utils.py +33 -0
- vllm/attention/layer.py +1052 -0
- vllm/attention/layers/__init__.py +0 -0
- vllm/attention/layers/chunked_local_attention.py +121 -0
- vllm/attention/layers/cross_attention.py +178 -0
- vllm/attention/layers/encoder_only_attention.py +103 -0
- vllm/attention/ops/__init__.py +0 -0
- vllm/attention/ops/chunked_prefill_paged_decode.py +401 -0
- vllm/attention/ops/common.py +414 -0
- vllm/attention/ops/flashmla.py +251 -0
- vllm/attention/ops/merge_attn_states.py +47 -0
- vllm/attention/ops/paged_attn.py +262 -0
- vllm/attention/ops/pallas_kv_cache_update.py +130 -0
- vllm/attention/ops/prefix_prefill.py +814 -0
- vllm/attention/ops/rocm_aiter_paged_attn.py +123 -0
- vllm/attention/ops/triton_decode_attention.py +712 -0
- vllm/attention/ops/triton_merge_attn_states.py +105 -0
- vllm/attention/ops/triton_reshape_and_cache_flash.py +184 -0
- vllm/attention/ops/triton_unified_attention.py +941 -0
- vllm/attention/ops/vit_attn_wrappers.py +178 -0
- vllm/attention/selector.py +231 -0
- vllm/attention/utils/__init__.py +0 -0
- vllm/attention/utils/fa_utils.py +109 -0
- vllm/attention/utils/kv_sharing_utils.py +33 -0
- vllm/attention/utils/kv_transfer_utils.py +60 -0
- vllm/beam_search.py +88 -0
- vllm/benchmarks/__init__.py +0 -0
- vllm/benchmarks/datasets.py +3222 -0
- vllm/benchmarks/latency.py +172 -0
- vllm/benchmarks/lib/__init__.py +3 -0
- vllm/benchmarks/lib/endpoint_request_func.py +777 -0
- vllm/benchmarks/lib/ready_checker.py +72 -0
- vllm/benchmarks/lib/utils.py +79 -0
- vllm/benchmarks/serve.py +1531 -0
- vllm/benchmarks/sweep/__init__.py +0 -0
- vllm/benchmarks/sweep/cli.py +38 -0
- vllm/benchmarks/sweep/param_sweep.py +91 -0
- vllm/benchmarks/sweep/plot.py +580 -0
- vllm/benchmarks/sweep/serve.py +416 -0
- vllm/benchmarks/sweep/serve_sla.py +492 -0
- vllm/benchmarks/sweep/server.py +114 -0
- vllm/benchmarks/sweep/sla_sweep.py +132 -0
- vllm/benchmarks/sweep/utils.py +4 -0
- vllm/benchmarks/throughput.py +799 -0
- vllm/collect_env.py +857 -0
- vllm/compilation/__init__.py +0 -0
- vllm/compilation/activation_quant_fusion.py +209 -0
- vllm/compilation/backends.py +759 -0
- vllm/compilation/base_static_graph.py +57 -0
- vllm/compilation/caching.py +178 -0
- vllm/compilation/collective_fusion.py +1234 -0
- vllm/compilation/compiler_interface.py +639 -0
- vllm/compilation/counter.py +48 -0
- vllm/compilation/cuda_graph.py +208 -0
- vllm/compilation/decorators.py +571 -0
- vllm/compilation/fix_functionalization.py +253 -0
- vllm/compilation/fusion.py +374 -0
- vllm/compilation/fusion_attn.py +359 -0
- vllm/compilation/fx_utils.py +91 -0
- vllm/compilation/inductor_pass.py +133 -0
- vllm/compilation/matcher_utils.py +317 -0
- vllm/compilation/monitor.py +62 -0
- vllm/compilation/noop_elimination.py +134 -0
- vllm/compilation/partition_rules.py +72 -0
- vllm/compilation/pass_manager.py +135 -0
- vllm/compilation/piecewise_backend.py +121 -0
- vllm/compilation/post_cleanup.py +21 -0
- vllm/compilation/qk_norm_rope_fusion.py +238 -0
- vllm/compilation/sequence_parallelism.py +363 -0
- vllm/compilation/torch25_custom_graph_pass.py +44 -0
- vllm/compilation/vllm_inductor_pass.py +173 -0
- vllm/compilation/wrapper.py +238 -0
- vllm/config/__init__.py +102 -0
- vllm/config/cache.py +207 -0
- vllm/config/compilation.py +975 -0
- vllm/config/device.py +75 -0
- vllm/config/ec_transfer.py +110 -0
- vllm/config/kv_events.py +56 -0
- vllm/config/kv_transfer.py +114 -0
- vllm/config/load.py +124 -0
- vllm/config/lora.py +112 -0
- vllm/config/model.py +2162 -0
- vllm/config/multimodal.py +248 -0
- vllm/config/observability.py +123 -0
- vllm/config/parallel.py +655 -0
- vllm/config/pooler.py +122 -0
- vllm/config/scheduler.py +298 -0
- vllm/config/speculative.py +654 -0
- vllm/config/speech_to_text.py +38 -0
- vllm/config/structured_outputs.py +92 -0
- vllm/config/utils.py +178 -0
- vllm/config/vllm.py +1166 -0
- vllm/connections.py +189 -0
- vllm/device_allocator/__init__.py +0 -0
- vllm/device_allocator/cumem.py +327 -0
- vllm/distributed/__init__.py +6 -0
- vllm/distributed/communication_op.py +43 -0
- vllm/distributed/device_communicators/__init__.py +0 -0
- vllm/distributed/device_communicators/all2all.py +490 -0
- vllm/distributed/device_communicators/all_reduce_utils.py +344 -0
- vllm/distributed/device_communicators/base_device_communicator.py +297 -0
- vllm/distributed/device_communicators/cpu_communicator.py +209 -0
- vllm/distributed/device_communicators/cuda_communicator.py +340 -0
- vllm/distributed/device_communicators/cuda_wrapper.py +216 -0
- vllm/distributed/device_communicators/custom_all_reduce.py +326 -0
- vllm/distributed/device_communicators/mnnvl_compat.py +27 -0
- vllm/distributed/device_communicators/pynccl.py +386 -0
- vllm/distributed/device_communicators/pynccl_allocator.py +191 -0
- vllm/distributed/device_communicators/pynccl_wrapper.py +564 -0
- vllm/distributed/device_communicators/quick_all_reduce.py +290 -0
- vllm/distributed/device_communicators/ray_communicator.py +259 -0
- vllm/distributed/device_communicators/shm_broadcast.py +733 -0
- vllm/distributed/device_communicators/shm_object_storage.py +660 -0
- vllm/distributed/device_communicators/symm_mem.py +156 -0
- vllm/distributed/device_communicators/tpu_communicator.py +107 -0
- vllm/distributed/device_communicators/xpu_communicator.py +95 -0
- vllm/distributed/ec_transfer/__init__.py +14 -0
- vllm/distributed/ec_transfer/ec_connector/__init__.py +0 -0
- vllm/distributed/ec_transfer/ec_connector/base.py +247 -0
- vllm/distributed/ec_transfer/ec_connector/factory.py +88 -0
- vllm/distributed/ec_transfer/ec_connector/shared_storage_connector.py +201 -0
- vllm/distributed/ec_transfer/ec_transfer_state.py +42 -0
- vllm/distributed/eplb/__init__.py +8 -0
- vllm/distributed/eplb/eplb_state.py +837 -0
- vllm/distributed/eplb/rebalance_algo.py +260 -0
- vllm/distributed/eplb/rebalance_execute.py +431 -0
- vllm/distributed/kv_events.py +371 -0
- vllm/distributed/kv_transfer/README.md +29 -0
- vllm/distributed/kv_transfer/__init__.py +20 -0
- vllm/distributed/kv_transfer/disagg_prefill_workflow.jpg +0 -0
- vllm/distributed/kv_transfer/kv_connector/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_connector/base.py +10 -0
- vllm/distributed/kv_transfer/kv_connector/factory.py +192 -0
- vllm/distributed/kv_transfer/kv_connector/utils.py +268 -0
- vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +19 -0
- vllm/distributed/kv_transfer/kv_connector/v1/base.py +546 -0
- vllm/distributed/kv_transfer/kv_connector/v1/decode_bench_connector.py +419 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +216 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/__init__.py +18 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/multi_process_adapter.py +379 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/utils.py +221 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/vllm_v1_adapter.py +1411 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_mp_connector.py +867 -0
- vllm/distributed/kv_transfer/kv_connector/v1/metrics.py +189 -0
- vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +454 -0
- vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +2440 -0
- vllm/distributed/kv_transfer/kv_connector/v1/offloading_connector.py +504 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_connector.py +531 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py +632 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/tensor_memory_pool.py +273 -0
- vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py +450 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/base.py +179 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/mooncake_store.py +164 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py +242 -0
- vllm/distributed/kv_transfer/kv_pipe/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_pipe/base.py +66 -0
- vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py +295 -0
- vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +285 -0
- vllm/distributed/kv_transfer/kv_transfer_state.py +78 -0
- vllm/distributed/parallel_state.py +1759 -0
- vllm/distributed/tpu_distributed_utils.py +188 -0
- vllm/distributed/utils.py +543 -0
- vllm/engine/__init__.py +0 -0
- vllm/engine/arg_utils.py +2144 -0
- vllm/engine/async_llm_engine.py +6 -0
- vllm/engine/llm_engine.py +6 -0
- vllm/engine/protocol.py +170 -0
- vllm/entrypoints/__init__.py +0 -0
- vllm/entrypoints/anthropic/__init__.py +0 -0
- vllm/entrypoints/anthropic/protocol.py +162 -0
- vllm/entrypoints/anthropic/serving_messages.py +460 -0
- vllm/entrypoints/api_server.py +184 -0
- vllm/entrypoints/chat_utils.py +1690 -0
- vllm/entrypoints/cli/__init__.py +13 -0
- vllm/entrypoints/cli/benchmark/__init__.py +0 -0
- vllm/entrypoints/cli/benchmark/base.py +25 -0
- vllm/entrypoints/cli/benchmark/latency.py +21 -0
- vllm/entrypoints/cli/benchmark/main.py +56 -0
- vllm/entrypoints/cli/benchmark/serve.py +21 -0
- vllm/entrypoints/cli/benchmark/sweep.py +21 -0
- vllm/entrypoints/cli/benchmark/throughput.py +21 -0
- vllm/entrypoints/cli/collect_env.py +38 -0
- vllm/entrypoints/cli/main.py +79 -0
- vllm/entrypoints/cli/openai.py +256 -0
- vllm/entrypoints/cli/run_batch.py +68 -0
- vllm/entrypoints/cli/serve.py +249 -0
- vllm/entrypoints/cli/types.py +29 -0
- vllm/entrypoints/constants.py +10 -0
- vllm/entrypoints/context.py +572 -0
- vllm/entrypoints/dynamic_lora.py +57 -0
- vllm/entrypoints/harmony_utils.py +535 -0
- vllm/entrypoints/launcher.py +175 -0
- vllm/entrypoints/llm.py +1768 -0
- vllm/entrypoints/logger.py +84 -0
- vllm/entrypoints/openai/__init__.py +0 -0
- vllm/entrypoints/openai/api_server.py +2096 -0
- vllm/entrypoints/openai/cli_args.py +302 -0
- vllm/entrypoints/openai/orca_metrics.py +120 -0
- vllm/entrypoints/openai/protocol.py +3299 -0
- vllm/entrypoints/openai/run_batch.py +547 -0
- vllm/entrypoints/openai/serving_chat.py +1772 -0
- vllm/entrypoints/openai/serving_classification.py +235 -0
- vllm/entrypoints/openai/serving_completion.py +715 -0
- vllm/entrypoints/openai/serving_embedding.py +695 -0
- vllm/entrypoints/openai/serving_engine.py +1433 -0
- vllm/entrypoints/openai/serving_models.py +304 -0
- vllm/entrypoints/openai/serving_pooling.py +346 -0
- vllm/entrypoints/openai/serving_responses.py +2021 -0
- vllm/entrypoints/openai/serving_score.py +503 -0
- vllm/entrypoints/openai/serving_tokenization.py +203 -0
- vllm/entrypoints/openai/serving_tokens.py +269 -0
- vllm/entrypoints/openai/serving_transcription.py +148 -0
- vllm/entrypoints/openai/speech_to_text.py +405 -0
- vllm/entrypoints/openai/tool_parsers/__init__.py +142 -0
- vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +273 -0
- vllm/entrypoints/openai/tool_parsers/deepseekv31_tool_parser.py +390 -0
- vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py +390 -0
- vllm/entrypoints/openai/tool_parsers/ernie45_tool_parser.py +210 -0
- vllm/entrypoints/openai/tool_parsers/glm4_moe_tool_parser.py +200 -0
- vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py +273 -0
- vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py +253 -0
- vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py +494 -0
- vllm/entrypoints/openai/tool_parsers/hunyuan_a13b_tool_parser.py +420 -0
- vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py +227 -0
- vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py +323 -0
- vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py +590 -0
- vllm/entrypoints/openai/tool_parsers/llama4_pythonic_tool_parser.py +341 -0
- vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +290 -0
- vllm/entrypoints/openai/tool_parsers/longcat_tool_parser.py +37 -0
- vllm/entrypoints/openai/tool_parsers/minimax_m2_tool_parser.py +643 -0
- vllm/entrypoints/openai/tool_parsers/minimax_tool_parser.py +849 -0
- vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +390 -0
- vllm/entrypoints/openai/tool_parsers/olmo3_tool_parser.py +366 -0
- vllm/entrypoints/openai/tool_parsers/openai_tool_parser.py +97 -0
- vllm/entrypoints/openai/tool_parsers/phi4mini_tool_parser.py +120 -0
- vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py +332 -0
- vllm/entrypoints/openai/tool_parsers/qwen3coder_tool_parser.py +781 -0
- vllm/entrypoints/openai/tool_parsers/qwen3xml_tool_parser.py +1316 -0
- vllm/entrypoints/openai/tool_parsers/seed_oss_tool_parser.py +744 -0
- vllm/entrypoints/openai/tool_parsers/step3_tool_parser.py +303 -0
- vllm/entrypoints/openai/tool_parsers/utils.py +229 -0
- vllm/entrypoints/openai/tool_parsers/xlam_tool_parser.py +556 -0
- vllm/entrypoints/renderer.py +409 -0
- vllm/entrypoints/responses_utils.py +77 -0
- vllm/entrypoints/sagemaker/__init__.py +4 -0
- vllm/entrypoints/sagemaker/routes.py +72 -0
- vllm/entrypoints/score_utils.py +242 -0
- vllm/entrypoints/ssl.py +78 -0
- vllm/entrypoints/tool.py +143 -0
- vllm/entrypoints/tool_server.py +209 -0
- vllm/entrypoints/utils.py +319 -0
- vllm/env_override.py +378 -0
- vllm/envs.py +1659 -0
- vllm/forward_context.py +356 -0
- vllm/inputs/__init__.py +44 -0
- vllm/inputs/data.py +359 -0
- vllm/inputs/parse.py +137 -0
- vllm/inputs/preprocess.py +727 -0
- vllm/logger.py +267 -0
- vllm/logging_utils/__init__.py +10 -0
- vllm/logging_utils/dump_input.py +83 -0
- vllm/logging_utils/formatter.py +77 -0
- vllm/logging_utils/log_time.py +34 -0
- vllm/logits_process.py +121 -0
- vllm/logprobs.py +208 -0
- vllm/lora/__init__.py +0 -0
- vllm/lora/layers/__init__.py +41 -0
- vllm/lora/layers/base.py +67 -0
- vllm/lora/layers/base_linear.py +164 -0
- vllm/lora/layers/column_parallel_linear.py +578 -0
- vllm/lora/layers/fused_moe.py +472 -0
- vllm/lora/layers/logits_processor.py +252 -0
- vllm/lora/layers/replicated_linear.py +70 -0
- vllm/lora/layers/row_parallel_linear.py +181 -0
- vllm/lora/layers/utils.py +65 -0
- vllm/lora/layers/vocal_parallel_embedding.py +166 -0
- vllm/lora/lora_weights.py +198 -0
- vllm/lora/models.py +890 -0
- vllm/lora/ops/__init__.py +0 -0
- vllm/lora/ops/ipex_ops/__init__.py +6 -0
- vllm/lora/ops/ipex_ops/lora_ops.py +57 -0
- vllm/lora/ops/torch_ops/__init__.py +20 -0
- vllm/lora/ops/torch_ops/lora_ops.py +128 -0
- vllm/lora/ops/triton_ops/README_TUNING.md +60 -0
- vllm/lora/ops/triton_ops/__init__.py +21 -0
- vllm/lora/ops/triton_ops/fused_moe_lora_op.py +641 -0
- vllm/lora/ops/triton_ops/kernel_utils.py +340 -0
- vllm/lora/ops/triton_ops/lora_expand_op.py +310 -0
- vllm/lora/ops/triton_ops/lora_kernel_metadata.py +154 -0
- vllm/lora/ops/triton_ops/lora_shrink_op.py +287 -0
- vllm/lora/ops/triton_ops/utils.py +295 -0
- vllm/lora/ops/xla_ops/__init__.py +6 -0
- vllm/lora/ops/xla_ops/lora_ops.py +141 -0
- vllm/lora/peft_helper.py +128 -0
- vllm/lora/punica_wrapper/__init__.py +10 -0
- vllm/lora/punica_wrapper/punica_base.py +492 -0
- vllm/lora/punica_wrapper/punica_cpu.py +351 -0
- vllm/lora/punica_wrapper/punica_gpu.py +411 -0
- vllm/lora/punica_wrapper/punica_selector.py +21 -0
- vllm/lora/punica_wrapper/punica_tpu.py +359 -0
- vllm/lora/punica_wrapper/punica_xpu.py +279 -0
- vllm/lora/punica_wrapper/utils.py +150 -0
- vllm/lora/request.py +100 -0
- vllm/lora/resolver.py +88 -0
- vllm/lora/utils.py +293 -0
- vllm/lora/worker_manager.py +279 -0
- vllm/model_executor/__init__.py +11 -0
- vllm/model_executor/custom_op.py +194 -0
- vllm/model_executor/layers/__init__.py +0 -0
- vllm/model_executor/layers/activation.py +569 -0
- vllm/model_executor/layers/attention_layer_base.py +35 -0
- vllm/model_executor/layers/batch_invariant.py +854 -0
- vllm/model_executor/layers/conv.py +236 -0
- vllm/model_executor/layers/fla/__init__.py +8 -0
- vllm/model_executor/layers/fla/ops/__init__.py +17 -0
- vllm/model_executor/layers/fla/ops/chunk.py +240 -0
- vllm/model_executor/layers/fla/ops/chunk_delta_h.py +344 -0
- vllm/model_executor/layers/fla/ops/chunk_o.py +183 -0
- vllm/model_executor/layers/fla/ops/chunk_scaled_dot_kkt.py +154 -0
- vllm/model_executor/layers/fla/ops/cumsum.py +280 -0
- vllm/model_executor/layers/fla/ops/fused_recurrent.py +390 -0
- vllm/model_executor/layers/fla/ops/index.py +41 -0
- vllm/model_executor/layers/fla/ops/kda.py +1351 -0
- vllm/model_executor/layers/fla/ops/l2norm.py +146 -0
- vllm/model_executor/layers/fla/ops/layernorm_guard.py +396 -0
- vllm/model_executor/layers/fla/ops/op.py +60 -0
- vllm/model_executor/layers/fla/ops/solve_tril.py +556 -0
- vllm/model_executor/layers/fla/ops/utils.py +194 -0
- vllm/model_executor/layers/fla/ops/wy_fast.py +158 -0
- vllm/model_executor/layers/fused_moe/__init__.py +106 -0
- vllm/model_executor/layers/fused_moe/all2all_utils.py +160 -0
- vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +406 -0
- vllm/model_executor/layers/fused_moe/batched_triton_or_deep_gemm_moe.py +180 -0
- vllm/model_executor/layers/fused_moe/config.py +916 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H200,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H100,dtype=fp8_w8a8.json +123 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1856,device_name=NVIDIA_H100_80GB_HBM3.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1856,device_name=NVIDIA_L40S.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=352,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +122 -0
- 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
- 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
- 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
- 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
- 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
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20.json +146 -0
- 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
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +114 -0
- 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
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI308X.json +213 -0
- 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
- 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
- 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
- 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
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
- 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
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=bf16.json +82 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +82 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=928,device_name=NVIDIA_H100_80GB_HBM3.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=928,device_name=NVIDIA_L40S.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2048,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=float8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H200,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=float8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=AMD_Instinct_MI300X.json +201 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=AMD_Instinct_MI350_OAM,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=320,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI350_OAM,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI355_OAM,dtype=fp8_w8a8.json +164 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
- 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
- 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
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
- 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
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- vllm/model_executor/layers/fused_moe/configs/E=256,N=384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- 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
- vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=32,N=1408,device_name=NVIDIA_B200.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=32,N=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=32,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- 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
- 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
- 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
- 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
- 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
- vllm/model_executor/layers/fused_moe/configs/E=40,N=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
- 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
- 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
- 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
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_A100-SXM4-80GB.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_A100-SXM4-80GB.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=128,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1408,device_name=NVIDIA_B200.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H100_PCIe,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=896,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=bf16.json +82 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +82 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=192,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- 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
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/README +12 -0
- vllm/model_executor/layers/fused_moe/cpu_fused_moe.py +354 -0
- vllm/model_executor/layers/fused_moe/cutlass_moe.py +1052 -0
- vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +387 -0
- vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +416 -0
- vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +420 -0
- vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +367 -0
- vllm/model_executor/layers/fused_moe/flashinfer_cutlass_moe.py +307 -0
- vllm/model_executor/layers/fused_moe/flashinfer_cutlass_prepare_finalize.py +362 -0
- vllm/model_executor/layers/fused_moe/flashinfer_trtllm_moe.py +192 -0
- vllm/model_executor/layers/fused_moe/fused_batched_moe.py +1012 -0
- vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +792 -0
- vllm/model_executor/layers/fused_moe/fused_moe.py +2175 -0
- vllm/model_executor/layers/fused_moe/fused_moe_method_base.py +112 -0
- vllm/model_executor/layers/fused_moe/fused_moe_modular_method.py +164 -0
- vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py +316 -0
- vllm/model_executor/layers/fused_moe/layer.py +1944 -0
- vllm/model_executor/layers/fused_moe/modular_kernel.py +1222 -0
- vllm/model_executor/layers/fused_moe/moe_align_block_size.py +174 -0
- vllm/model_executor/layers/fused_moe/moe_pallas.py +83 -0
- vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +229 -0
- vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
- vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +362 -0
- vllm/model_executor/layers/fused_moe/prepare_finalize.py +77 -0
- vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +265 -0
- vllm/model_executor/layers/fused_moe/routing_simulator.py +310 -0
- vllm/model_executor/layers/fused_moe/shared_fused_moe.py +97 -0
- vllm/model_executor/layers/fused_moe/topk_weight_and_reduce.py +171 -0
- vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +163 -0
- vllm/model_executor/layers/fused_moe/trtllm_moe.py +143 -0
- vllm/model_executor/layers/fused_moe/unquantized_fused_moe_method.py +578 -0
- vllm/model_executor/layers/fused_moe/utils.py +332 -0
- vllm/model_executor/layers/kda.py +448 -0
- vllm/model_executor/layers/layernorm.py +442 -0
- vllm/model_executor/layers/lightning_attn.py +729 -0
- vllm/model_executor/layers/linear.py +1424 -0
- vllm/model_executor/layers/logits_processor.py +106 -0
- vllm/model_executor/layers/mamba/__init__.py +0 -0
- vllm/model_executor/layers/mamba/abstract.py +71 -0
- vllm/model_executor/layers/mamba/linear_attn.py +402 -0
- vllm/model_executor/layers/mamba/mamba_mixer.py +535 -0
- vllm/model_executor/layers/mamba/mamba_mixer2.py +928 -0
- vllm/model_executor/layers/mamba/mamba_utils.py +225 -0
- vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
- vllm/model_executor/layers/mamba/ops/causal_conv1d.py +1240 -0
- vllm/model_executor/layers/mamba/ops/layernorm_gated.py +172 -0
- vllm/model_executor/layers/mamba/ops/mamba_ssm.py +478 -0
- vllm/model_executor/layers/mamba/ops/ssd_bmm.py +211 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +456 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +700 -0
- vllm/model_executor/layers/mamba/ops/ssd_combined.py +230 -0
- vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +157 -0
- vllm/model_executor/layers/mamba/short_conv.py +264 -0
- vllm/model_executor/layers/mla.py +168 -0
- vllm/model_executor/layers/pooler.py +817 -0
- vllm/model_executor/layers/quantization/__init__.py +174 -0
- vllm/model_executor/layers/quantization/auto_round.py +454 -0
- vllm/model_executor/layers/quantization/awq.py +277 -0
- vllm/model_executor/layers/quantization/awq_marlin.py +659 -0
- vllm/model_executor/layers/quantization/awq_triton.py +337 -0
- vllm/model_executor/layers/quantization/base_config.py +170 -0
- vllm/model_executor/layers/quantization/bitblas.py +502 -0
- vllm/model_executor/layers/quantization/bitsandbytes.py +658 -0
- vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +3 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +914 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +2284 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +35 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +392 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +55 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +176 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_nvfp4.py +124 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +218 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_fp8.py +183 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_int.py +153 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +138 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +200 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +125 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +219 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/linear.py +260 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/module.py +173 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/linear_qutlass_nvfp4.py +64 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/utils.py +13 -0
- vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +224 -0
- vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
- vllm/model_executor/layers/quantization/deepspeedfp.py +218 -0
- vllm/model_executor/layers/quantization/experts_int8.py +240 -0
- vllm/model_executor/layers/quantization/fbgemm_fp8.py +195 -0
- vllm/model_executor/layers/quantization/fp8.py +1333 -0
- vllm/model_executor/layers/quantization/fp_quant.py +420 -0
- vllm/model_executor/layers/quantization/gguf.py +643 -0
- vllm/model_executor/layers/quantization/gptq.py +393 -0
- vllm/model_executor/layers/quantization/gptq_bitblas.py +482 -0
- vllm/model_executor/layers/quantization/gptq_marlin.py +789 -0
- vllm/model_executor/layers/quantization/gptq_marlin_24.py +320 -0
- vllm/model_executor/layers/quantization/hqq_marlin.py +371 -0
- vllm/model_executor/layers/quantization/inc.py +65 -0
- vllm/model_executor/layers/quantization/input_quant_fp8.py +171 -0
- vllm/model_executor/layers/quantization/ipex_quant.py +467 -0
- vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +94 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +105 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +115 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +323 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/conch.py +98 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/cutlass.py +119 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/dynamic_4bit.py +111 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +161 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +159 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +166 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +73 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +97 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +120 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/cpu.py +219 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +140 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +42 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +105 -0
- vllm/model_executor/layers/quantization/kv_cache.py +146 -0
- vllm/model_executor/layers/quantization/modelopt.py +1788 -0
- vllm/model_executor/layers/quantization/moe_wna16.py +541 -0
- vllm/model_executor/layers/quantization/mxfp4.py +1162 -0
- vllm/model_executor/layers/quantization/petit.py +320 -0
- vllm/model_executor/layers/quantization/ptpc_fp8.py +137 -0
- vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
- vllm/model_executor/layers/quantization/quark/quark.py +528 -0
- vllm/model_executor/layers/quantization/quark/quark_moe.py +683 -0
- vllm/model_executor/layers/quantization/quark/schemes/__init__.py +9 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_ocp_mx.py +306 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +55 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +179 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +139 -0
- vllm/model_executor/layers/quantization/quark/utils.py +105 -0
- vllm/model_executor/layers/quantization/qutlass_utils.py +185 -0
- vllm/model_executor/layers/quantization/rtn.py +652 -0
- vllm/model_executor/layers/quantization/schema.py +90 -0
- vllm/model_executor/layers/quantization/torchao.py +380 -0
- vllm/model_executor/layers/quantization/tpu_int8.py +139 -0
- vllm/model_executor/layers/quantization/utils/__init__.py +6 -0
- vllm/model_executor/layers/quantization/utils/allspark_utils.py +67 -0
- vllm/model_executor/layers/quantization/utils/bitblas_utils.py +229 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- vllm/model_executor/layers/quantization/utils/configs/README.md +3 -0
- vllm/model_executor/layers/quantization/utils/flashinfer_fp4_moe.py +89 -0
- vllm/model_executor/layers/quantization/utils/flashinfer_utils.py +298 -0
- vllm/model_executor/layers/quantization/utils/fp8_utils.py +1203 -0
- vllm/model_executor/layers/quantization/utils/gptq_utils.py +158 -0
- vllm/model_executor/layers/quantization/utils/int8_utils.py +489 -0
- vllm/model_executor/layers/quantization/utils/layer_utils.py +41 -0
- vllm/model_executor/layers/quantization/utils/machete_utils.py +56 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils.py +575 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +397 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +351 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +161 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +467 -0
- vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +181 -0
- vllm/model_executor/layers/quantization/utils/mxfp6_utils.py +142 -0
- vllm/model_executor/layers/quantization/utils/mxfp8_utils.py +24 -0
- vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +142 -0
- vllm/model_executor/layers/quantization/utils/nvfp4_moe_support.py +63 -0
- vllm/model_executor/layers/quantization/utils/ocp_mx_utils.py +51 -0
- vllm/model_executor/layers/quantization/utils/petit_utils.py +124 -0
- vllm/model_executor/layers/quantization/utils/quant_utils.py +687 -0
- vllm/model_executor/layers/quantization/utils/w8a8_utils.py +516 -0
- vllm/model_executor/layers/resampler.py +283 -0
- vllm/model_executor/layers/rotary_embedding/__init__.py +278 -0
- vllm/model_executor/layers/rotary_embedding/base.py +235 -0
- vllm/model_executor/layers/rotary_embedding/common.py +188 -0
- vllm/model_executor/layers/rotary_embedding/deepseek_scaling_rope.py +165 -0
- vllm/model_executor/layers/rotary_embedding/dual_chunk_rope.py +215 -0
- vllm/model_executor/layers/rotary_embedding/dynamic_ntk_alpha_rope.py +43 -0
- vllm/model_executor/layers/rotary_embedding/dynamic_ntk_scaling_rope.py +68 -0
- vllm/model_executor/layers/rotary_embedding/ernie45_vl_rope.py +75 -0
- vllm/model_executor/layers/rotary_embedding/linear_scaling_rope.py +115 -0
- vllm/model_executor/layers/rotary_embedding/llama3_rope.py +54 -0
- vllm/model_executor/layers/rotary_embedding/llama4_vision_rope.py +80 -0
- vllm/model_executor/layers/rotary_embedding/mrope.py +397 -0
- vllm/model_executor/layers/rotary_embedding/ntk_scaling_rope.py +47 -0
- vllm/model_executor/layers/rotary_embedding/phi3_long_rope_scaled_rope.py +159 -0
- vllm/model_executor/layers/rotary_embedding/yarn_scaling_rope.py +81 -0
- vllm/model_executor/layers/utils.py +251 -0
- vllm/model_executor/layers/vocab_parallel_embedding.py +558 -0
- vllm/model_executor/model_loader/__init__.py +148 -0
- vllm/model_executor/model_loader/base_loader.py +57 -0
- vllm/model_executor/model_loader/bitsandbytes_loader.py +822 -0
- vllm/model_executor/model_loader/default_loader.py +327 -0
- vllm/model_executor/model_loader/dummy_loader.py +28 -0
- vllm/model_executor/model_loader/gguf_loader.py +176 -0
- vllm/model_executor/model_loader/online_quantization.py +224 -0
- vllm/model_executor/model_loader/runai_streamer_loader.py +116 -0
- vllm/model_executor/model_loader/sharded_state_loader.py +206 -0
- vllm/model_executor/model_loader/tensorizer.py +790 -0
- vllm/model_executor/model_loader/tensorizer_loader.py +151 -0
- vllm/model_executor/model_loader/tpu.py +118 -0
- vllm/model_executor/model_loader/utils.py +288 -0
- vllm/model_executor/model_loader/weight_utils.py +1084 -0
- vllm/model_executor/models/__init__.py +44 -0
- vllm/model_executor/models/adapters.py +543 -0
- vllm/model_executor/models/afmoe.py +711 -0
- vllm/model_executor/models/aimv2.py +247 -0
- vllm/model_executor/models/apertus.py +587 -0
- vllm/model_executor/models/arcee.py +439 -0
- vllm/model_executor/models/arctic.py +635 -0
- vllm/model_executor/models/aria.py +655 -0
- vllm/model_executor/models/aya_vision.py +450 -0
- vllm/model_executor/models/baichuan.py +496 -0
- vllm/model_executor/models/bailing_moe.py +646 -0
- vllm/model_executor/models/bamba.py +522 -0
- vllm/model_executor/models/bee.py +157 -0
- vllm/model_executor/models/bert.py +925 -0
- vllm/model_executor/models/bert_with_rope.py +732 -0
- vllm/model_executor/models/blip.py +349 -0
- vllm/model_executor/models/blip2.py +695 -0
- vllm/model_executor/models/bloom.py +390 -0
- vllm/model_executor/models/chameleon.py +1120 -0
- vllm/model_executor/models/chatglm.py +498 -0
- vllm/model_executor/models/clip.py +965 -0
- vllm/model_executor/models/cohere2_vision.py +472 -0
- vllm/model_executor/models/commandr.py +473 -0
- vllm/model_executor/models/config.py +503 -0
- vllm/model_executor/models/dbrx.py +482 -0
- vllm/model_executor/models/deepencoder.py +673 -0
- vllm/model_executor/models/deepseek_eagle.py +260 -0
- vllm/model_executor/models/deepseek_mtp.py +360 -0
- vllm/model_executor/models/deepseek_ocr.py +593 -0
- vllm/model_executor/models/deepseek_v2.py +1649 -0
- vllm/model_executor/models/deepseek_vl2.py +655 -0
- vllm/model_executor/models/dots1.py +574 -0
- vllm/model_executor/models/dots_ocr.py +900 -0
- vllm/model_executor/models/ernie45.py +53 -0
- vllm/model_executor/models/ernie45_moe.py +759 -0
- vllm/model_executor/models/ernie45_vl.py +1742 -0
- vllm/model_executor/models/ernie45_vl_moe.py +803 -0
- vllm/model_executor/models/ernie_mtp.py +279 -0
- vllm/model_executor/models/exaone.py +545 -0
- vllm/model_executor/models/exaone4.py +531 -0
- vllm/model_executor/models/fairseq2_llama.py +154 -0
- vllm/model_executor/models/falcon.py +545 -0
- vllm/model_executor/models/falcon_h1.py +685 -0
- vllm/model_executor/models/flex_olmo.py +155 -0
- vllm/model_executor/models/fuyu.py +373 -0
- vllm/model_executor/models/gemma.py +426 -0
- vllm/model_executor/models/gemma2.py +439 -0
- vllm/model_executor/models/gemma3.py +571 -0
- vllm/model_executor/models/gemma3_mm.py +741 -0
- vllm/model_executor/models/gemma3n.py +1165 -0
- vllm/model_executor/models/gemma3n_mm.py +811 -0
- vllm/model_executor/models/glm.py +23 -0
- vllm/model_executor/models/glm4.py +305 -0
- vllm/model_executor/models/glm4_1v.py +1821 -0
- vllm/model_executor/models/glm4_moe.py +747 -0
- vllm/model_executor/models/glm4_moe_mtp.py +359 -0
- vllm/model_executor/models/glm4v.py +784 -0
- vllm/model_executor/models/gpt2.py +397 -0
- vllm/model_executor/models/gpt_bigcode.py +339 -0
- vllm/model_executor/models/gpt_j.py +346 -0
- vllm/model_executor/models/gpt_neox.py +344 -0
- vllm/model_executor/models/gpt_oss.py +738 -0
- vllm/model_executor/models/granite.py +516 -0
- vllm/model_executor/models/granite_speech.py +913 -0
- vllm/model_executor/models/granitemoe.py +569 -0
- vllm/model_executor/models/granitemoehybrid.py +709 -0
- vllm/model_executor/models/granitemoeshared.py +333 -0
- vllm/model_executor/models/gritlm.py +245 -0
- vllm/model_executor/models/grok1.py +558 -0
- vllm/model_executor/models/h2ovl.py +554 -0
- vllm/model_executor/models/hunyuan_v1.py +1053 -0
- vllm/model_executor/models/hyperclovax_vision.py +1166 -0
- vllm/model_executor/models/idefics2_vision_model.py +426 -0
- vllm/model_executor/models/idefics3.py +717 -0
- vllm/model_executor/models/interfaces.py +1092 -0
- vllm/model_executor/models/interfaces_base.py +214 -0
- vllm/model_executor/models/intern_vit.py +453 -0
- vllm/model_executor/models/internlm2.py +460 -0
- vllm/model_executor/models/internlm2_ve.py +142 -0
- vllm/model_executor/models/interns1.py +830 -0
- vllm/model_executor/models/interns1_vit.py +432 -0
- vllm/model_executor/models/internvl.py +1452 -0
- vllm/model_executor/models/jais.py +397 -0
- vllm/model_executor/models/jamba.py +610 -0
- vllm/model_executor/models/jina_vl.py +147 -0
- vllm/model_executor/models/keye.py +1761 -0
- vllm/model_executor/models/keye_vl1_5.py +726 -0
- vllm/model_executor/models/kimi_linear.py +663 -0
- vllm/model_executor/models/kimi_vl.py +578 -0
- vllm/model_executor/models/lfm2.py +532 -0
- vllm/model_executor/models/lfm2_moe.py +762 -0
- vllm/model_executor/models/lightonocr.py +195 -0
- vllm/model_executor/models/llama.py +732 -0
- vllm/model_executor/models/llama4.py +859 -0
- vllm/model_executor/models/llama4_eagle.py +223 -0
- vllm/model_executor/models/llama_eagle.py +218 -0
- vllm/model_executor/models/llama_eagle3.py +367 -0
- vllm/model_executor/models/llava.py +842 -0
- vllm/model_executor/models/llava_next.py +583 -0
- vllm/model_executor/models/llava_next_video.py +467 -0
- vllm/model_executor/models/llava_onevision.py +923 -0
- vllm/model_executor/models/longcat_flash.py +749 -0
- vllm/model_executor/models/longcat_flash_mtp.py +349 -0
- vllm/model_executor/models/mamba.py +276 -0
- vllm/model_executor/models/mamba2.py +289 -0
- vllm/model_executor/models/medusa.py +179 -0
- vllm/model_executor/models/midashenglm.py +827 -0
- vllm/model_executor/models/mimo.py +188 -0
- vllm/model_executor/models/mimo_mtp.py +294 -0
- vllm/model_executor/models/minicpm.py +664 -0
- vllm/model_executor/models/minicpm3.py +242 -0
- vllm/model_executor/models/minicpm_eagle.py +389 -0
- vllm/model_executor/models/minicpmo.py +768 -0
- vllm/model_executor/models/minicpmv.py +1745 -0
- vllm/model_executor/models/minimax_m2.py +552 -0
- vllm/model_executor/models/minimax_text_01.py +1012 -0
- vllm/model_executor/models/minimax_vl_01.py +396 -0
- vllm/model_executor/models/mistral3.py +637 -0
- vllm/model_executor/models/mixtral.py +621 -0
- vllm/model_executor/models/mllama4.py +1147 -0
- vllm/model_executor/models/mlp_speculator.py +235 -0
- vllm/model_executor/models/modernbert.py +450 -0
- vllm/model_executor/models/module_mapping.py +74 -0
- vllm/model_executor/models/molmo.py +1555 -0
- vllm/model_executor/models/moonvit.py +677 -0
- vllm/model_executor/models/mpt.py +335 -0
- vllm/model_executor/models/nano_nemotron_vl.py +1740 -0
- vllm/model_executor/models/nemotron.py +518 -0
- vllm/model_executor/models/nemotron_h.py +852 -0
- vllm/model_executor/models/nemotron_nas.py +491 -0
- vllm/model_executor/models/nemotron_vl.py +653 -0
- vllm/model_executor/models/nvlm_d.py +216 -0
- vllm/model_executor/models/olmo.py +414 -0
- vllm/model_executor/models/olmo2.py +454 -0
- vllm/model_executor/models/olmoe.py +498 -0
- vllm/model_executor/models/openpangu.py +1062 -0
- vllm/model_executor/models/openpangu_mtp.py +265 -0
- vllm/model_executor/models/opt.py +426 -0
- vllm/model_executor/models/orion.py +372 -0
- vllm/model_executor/models/ouro.py +516 -0
- vllm/model_executor/models/ovis.py +559 -0
- vllm/model_executor/models/ovis2_5.py +673 -0
- vllm/model_executor/models/paddleocr_vl.py +1407 -0
- vllm/model_executor/models/paligemma.py +412 -0
- vllm/model_executor/models/persimmon.py +377 -0
- vllm/model_executor/models/phi.py +374 -0
- vllm/model_executor/models/phi3.py +18 -0
- vllm/model_executor/models/phi3v.py +737 -0
- vllm/model_executor/models/phi4_multimodal.py +1447 -0
- vllm/model_executor/models/phi4mm.py +1253 -0
- vllm/model_executor/models/phi4mm_audio.py +1296 -0
- vllm/model_executor/models/phi4mm_utils.py +1907 -0
- vllm/model_executor/models/phimoe.py +675 -0
- vllm/model_executor/models/pixtral.py +1352 -0
- vllm/model_executor/models/plamo2.py +981 -0
- vllm/model_executor/models/qwen.py +368 -0
- vllm/model_executor/models/qwen2.py +541 -0
- vllm/model_executor/models/qwen2_5_omni_thinker.py +1246 -0
- vllm/model_executor/models/qwen2_5_vl.py +1613 -0
- vllm/model_executor/models/qwen2_audio.py +473 -0
- vllm/model_executor/models/qwen2_moe.py +596 -0
- vllm/model_executor/models/qwen2_rm.py +123 -0
- vllm/model_executor/models/qwen2_vl.py +1670 -0
- vllm/model_executor/models/qwen3.py +336 -0
- vllm/model_executor/models/qwen3_moe.py +744 -0
- vllm/model_executor/models/qwen3_next.py +1395 -0
- vllm/model_executor/models/qwen3_next_mtp.py +296 -0
- vllm/model_executor/models/qwen3_omni_moe_thinker.py +1721 -0
- vllm/model_executor/models/qwen3_vl.py +1673 -0
- vllm/model_executor/models/qwen3_vl_moe.py +415 -0
- vllm/model_executor/models/qwen_vl.py +802 -0
- vllm/model_executor/models/radio.py +555 -0
- vllm/model_executor/models/registry.py +1155 -0
- vllm/model_executor/models/roberta.py +259 -0
- vllm/model_executor/models/rvl.py +107 -0
- vllm/model_executor/models/seed_oss.py +497 -0
- vllm/model_executor/models/siglip.py +1174 -0
- vllm/model_executor/models/siglip2navit.py +724 -0
- vllm/model_executor/models/skyworkr1v.py +953 -0
- vllm/model_executor/models/smolvlm.py +38 -0
- vllm/model_executor/models/solar.py +502 -0
- vllm/model_executor/models/stablelm.py +359 -0
- vllm/model_executor/models/starcoder2.py +367 -0
- vllm/model_executor/models/step3_text.py +559 -0
- vllm/model_executor/models/step3_vl.py +1148 -0
- vllm/model_executor/models/swin.py +514 -0
- vllm/model_executor/models/tarsier.py +619 -0
- vllm/model_executor/models/telechat2.py +153 -0
- vllm/model_executor/models/teleflm.py +78 -0
- vllm/model_executor/models/terratorch.py +319 -0
- vllm/model_executor/models/transformers/__init__.py +127 -0
- vllm/model_executor/models/transformers/base.py +464 -0
- vllm/model_executor/models/transformers/causal.py +65 -0
- vllm/model_executor/models/transformers/legacy.py +90 -0
- vllm/model_executor/models/transformers/moe.py +318 -0
- vllm/model_executor/models/transformers/multimodal.py +411 -0
- vllm/model_executor/models/transformers/pooling.py +119 -0
- vllm/model_executor/models/transformers/utils.py +207 -0
- vllm/model_executor/models/ultravox.py +681 -0
- vllm/model_executor/models/utils.py +877 -0
- vllm/model_executor/models/vision.py +552 -0
- vllm/model_executor/models/voxtral.py +845 -0
- vllm/model_executor/models/whisper.py +959 -0
- vllm/model_executor/models/zamba2.py +986 -0
- vllm/model_executor/parameter.py +642 -0
- vllm/model_executor/utils.py +94 -0
- vllm/model_executor/warmup/__init__.py +0 -0
- vllm/model_executor/warmup/deep_gemm_warmup.py +314 -0
- vllm/model_executor/warmup/kernel_warmup.py +98 -0
- vllm/multimodal/__init__.py +40 -0
- vllm/multimodal/audio.py +118 -0
- vllm/multimodal/base.py +26 -0
- vllm/multimodal/cache.py +755 -0
- vllm/multimodal/evs.py +294 -0
- vllm/multimodal/hasher.py +106 -0
- vllm/multimodal/image.py +130 -0
- vllm/multimodal/inputs.py +1036 -0
- vllm/multimodal/parse.py +544 -0
- vllm/multimodal/processing.py +2186 -0
- vllm/multimodal/profiling.py +369 -0
- vllm/multimodal/registry.py +360 -0
- vllm/multimodal/utils.py +512 -0
- vllm/multimodal/video.py +306 -0
- vllm/outputs.py +345 -0
- vllm/platforms/__init__.py +277 -0
- vllm/platforms/cpu.py +414 -0
- vllm/platforms/cuda.py +657 -0
- vllm/platforms/interface.py +639 -0
- vllm/platforms/rocm.py +466 -0
- vllm/platforms/tpu.py +276 -0
- vllm/platforms/xpu.py +274 -0
- vllm/plugins/__init__.py +78 -0
- vllm/plugins/io_processors/__init__.py +68 -0
- vllm/plugins/io_processors/interface.py +77 -0
- vllm/plugins/lora_resolvers/__init__.py +0 -0
- vllm/plugins/lora_resolvers/filesystem_resolver.py +52 -0
- vllm/pooling_params.py +228 -0
- vllm/profiler/__init__.py +0 -0
- vllm/profiler/gpu_profiler.py +37 -0
- vllm/profiler/layerwise_profile.py +392 -0
- vllm/profiler/utils.py +151 -0
- vllm/py.typed +2 -0
- vllm/ray/__init__.py +0 -0
- vllm/ray/lazy_utils.py +26 -0
- vllm/ray/ray_env.py +79 -0
- vllm/reasoning/__init__.py +92 -0
- vllm/reasoning/abs_reasoning_parsers.py +290 -0
- vllm/reasoning/basic_parsers.py +162 -0
- vllm/reasoning/deepseek_r1_reasoning_parser.py +67 -0
- vllm/reasoning/deepseek_v3_reasoning_parser.py +62 -0
- vllm/reasoning/ernie45_reasoning_parser.py +165 -0
- vllm/reasoning/glm4_moe_reasoning_parser.py +171 -0
- vllm/reasoning/gptoss_reasoning_parser.py +173 -0
- vllm/reasoning/granite_reasoning_parser.py +363 -0
- vllm/reasoning/hunyuan_a13b_reasoning_parser.py +237 -0
- vllm/reasoning/identity_reasoning_parser.py +58 -0
- vllm/reasoning/minimax_m2_reasoning_parser.py +67 -0
- vllm/reasoning/mistral_reasoning_parser.py +55 -0
- vllm/reasoning/olmo3_reasoning_parser.py +302 -0
- vllm/reasoning/qwen3_reasoning_parser.py +67 -0
- vllm/reasoning/seedoss_reasoning_parser.py +27 -0
- vllm/reasoning/step3_reasoning_parser.py +107 -0
- vllm/sampling_params.py +669 -0
- vllm/scalar_type.py +355 -0
- vllm/scripts.py +17 -0
- vllm/sequence.py +98 -0
- vllm/tasks.py +13 -0
- vllm/third_party/__init__.py +0 -0
- vllm/third_party/pynvml.py +6140 -0
- vllm/tracing.py +135 -0
- vllm/transformers_utils/__init__.py +26 -0
- vllm/transformers_utils/chat_templates/__init__.py +5 -0
- vllm/transformers_utils/chat_templates/registry.py +73 -0
- vllm/transformers_utils/chat_templates/template_basic.jinja +3 -0
- vllm/transformers_utils/chat_templates/template_blip2.jinja +11 -0
- vllm/transformers_utils/chat_templates/template_chatml.jinja +10 -0
- vllm/transformers_utils/chat_templates/template_deepseek_ocr.jinja +14 -0
- vllm/transformers_utils/chat_templates/template_deepseek_vl2.jinja +23 -0
- vllm/transformers_utils/chat_templates/template_fuyu.jinja +3 -0
- vllm/transformers_utils/chat_templates/template_minicpmv45.jinja +93 -0
- vllm/transformers_utils/config.py +1203 -0
- vllm/transformers_utils/config_parser_base.py +20 -0
- vllm/transformers_utils/configs/__init__.py +70 -0
- vllm/transformers_utils/configs/afmoe.py +84 -0
- vllm/transformers_utils/configs/arctic.py +206 -0
- vllm/transformers_utils/configs/chatglm.py +75 -0
- vllm/transformers_utils/configs/deepseek_vl2.py +126 -0
- vllm/transformers_utils/configs/dotsocr.py +71 -0
- vllm/transformers_utils/configs/eagle.py +84 -0
- vllm/transformers_utils/configs/falcon.py +89 -0
- vllm/transformers_utils/configs/flex_olmo.py +77 -0
- vllm/transformers_utils/configs/jais.py +243 -0
- vllm/transformers_utils/configs/kimi_linear.py +144 -0
- vllm/transformers_utils/configs/kimi_vl.py +38 -0
- vllm/transformers_utils/configs/lfm2_moe.py +159 -0
- vllm/transformers_utils/configs/medusa.py +65 -0
- vllm/transformers_utils/configs/midashenglm.py +103 -0
- vllm/transformers_utils/configs/mistral.py +174 -0
- vllm/transformers_utils/configs/mlp_speculator.py +69 -0
- vllm/transformers_utils/configs/moonvit.py +33 -0
- vllm/transformers_utils/configs/nemotron.py +212 -0
- vllm/transformers_utils/configs/nemotron_h.py +282 -0
- vllm/transformers_utils/configs/olmo3.py +79 -0
- vllm/transformers_utils/configs/ovis.py +182 -0
- vllm/transformers_utils/configs/qwen3_next.py +274 -0
- vllm/transformers_utils/configs/radio.py +89 -0
- vllm/transformers_utils/configs/speculators/__init__.py +2 -0
- vllm/transformers_utils/configs/speculators/algos.py +38 -0
- vllm/transformers_utils/configs/speculators/base.py +114 -0
- vllm/transformers_utils/configs/step3_vl.py +174 -0
- vllm/transformers_utils/configs/ultravox.py +118 -0
- vllm/transformers_utils/detokenizer_utils.py +198 -0
- vllm/transformers_utils/dynamic_module.py +59 -0
- vllm/transformers_utils/processor.py +402 -0
- vllm/transformers_utils/processors/__init__.py +15 -0
- vllm/transformers_utils/processors/deepseek_ocr.py +438 -0
- vllm/transformers_utils/processors/deepseek_vl2.py +406 -0
- vllm/transformers_utils/processors/ovis.py +453 -0
- vllm/transformers_utils/processors/ovis2_5.py +468 -0
- vllm/transformers_utils/runai_utils.py +104 -0
- vllm/transformers_utils/s3_utils.py +95 -0
- vllm/transformers_utils/tokenizer.py +293 -0
- vllm/transformers_utils/tokenizer_base.py +155 -0
- vllm/transformers_utils/tokenizers/__init__.py +16 -0
- vllm/transformers_utils/tokenizers/mistral.py +502 -0
- vllm/transformers_utils/utils.py +130 -0
- vllm/triton_utils/__init__.py +19 -0
- vllm/triton_utils/importing.py +103 -0
- vllm/usage/__init__.py +0 -0
- vllm/usage/usage_lib.py +294 -0
- vllm/utils/__init__.py +82 -0
- vllm/utils/argparse_utils.py +487 -0
- vllm/utils/async_utils.py +303 -0
- vllm/utils/cache.py +214 -0
- vllm/utils/collection_utils.py +139 -0
- vllm/utils/counter.py +45 -0
- vllm/utils/deep_gemm.py +391 -0
- vllm/utils/flashinfer.py +490 -0
- vllm/utils/func_utils.py +236 -0
- vllm/utils/gc_utils.py +147 -0
- vllm/utils/hashing.py +63 -0
- vllm/utils/import_utils.py +411 -0
- vllm/utils/jsontree.py +165 -0
- vllm/utils/math_utils.py +32 -0
- vllm/utils/mem_constants.py +13 -0
- vllm/utils/mem_utils.py +232 -0
- vllm/utils/nccl.py +64 -0
- vllm/utils/network_utils.py +331 -0
- vllm/utils/platform_utils.py +59 -0
- vllm/utils/profiling.py +56 -0
- vllm/utils/registry.py +49 -0
- vllm/utils/serial_utils.py +169 -0
- vllm/utils/system_utils.py +229 -0
- vllm/utils/tensor_schema.py +255 -0
- vllm/utils/torch_utils.py +657 -0
- vllm/v1/__init__.py +0 -0
- vllm/v1/attention/__init__.py +0 -0
- vllm/v1/attention/backends/__init__.py +0 -0
- vllm/v1/attention/backends/cpu_attn.py +496 -0
- vllm/v1/attention/backends/flash_attn.py +1028 -0
- vllm/v1/attention/backends/flashinfer.py +1572 -0
- vllm/v1/attention/backends/flex_attention.py +926 -0
- vllm/v1/attention/backends/gdn_attn.py +387 -0
- vllm/v1/attention/backends/linear_attn.py +74 -0
- vllm/v1/attention/backends/mamba1_attn.py +165 -0
- vllm/v1/attention/backends/mamba2_attn.py +354 -0
- vllm/v1/attention/backends/mamba_attn.py +115 -0
- vllm/v1/attention/backends/mla/__init__.py +0 -0
- vllm/v1/attention/backends/mla/common.py +2031 -0
- vllm/v1/attention/backends/mla/cutlass_mla.py +275 -0
- vllm/v1/attention/backends/mla/flashattn_mla.py +337 -0
- vllm/v1/attention/backends/mla/flashinfer_mla.py +171 -0
- vllm/v1/attention/backends/mla/flashmla.py +314 -0
- vllm/v1/attention/backends/mla/flashmla_sparse.py +548 -0
- vllm/v1/attention/backends/mla/indexer.py +362 -0
- vllm/v1/attention/backends/mla/rocm_aiter_mla.py +294 -0
- vllm/v1/attention/backends/mla/triton_mla.py +171 -0
- vllm/v1/attention/backends/pallas.py +436 -0
- vllm/v1/attention/backends/rocm_aiter_fa.py +816 -0
- vllm/v1/attention/backends/rocm_aiter_unified_attn.py +196 -0
- vllm/v1/attention/backends/rocm_attn.py +362 -0
- vllm/v1/attention/backends/short_conv_attn.py +105 -0
- vllm/v1/attention/backends/tree_attn.py +425 -0
- vllm/v1/attention/backends/triton_attn.py +373 -0
- vllm/v1/attention/backends/utils.py +1116 -0
- vllm/v1/attention/backends/xformers.py +417 -0
- vllm/v1/core/__init__.py +0 -0
- vllm/v1/core/block_pool.py +428 -0
- vllm/v1/core/encoder_cache_manager.py +343 -0
- vllm/v1/core/kv_cache_coordinator.py +480 -0
- vllm/v1/core/kv_cache_manager.py +420 -0
- vllm/v1/core/kv_cache_utils.py +1340 -0
- vllm/v1/core/sched/__init__.py +0 -0
- vllm/v1/core/sched/async_scheduler.py +62 -0
- vllm/v1/core/sched/interface.py +181 -0
- vllm/v1/core/sched/output.py +202 -0
- vllm/v1/core/sched/request_queue.py +221 -0
- vllm/v1/core/sched/scheduler.py +1617 -0
- vllm/v1/core/sched/utils.py +72 -0
- vllm/v1/core/single_type_kv_cache_manager.py +736 -0
- vllm/v1/cudagraph_dispatcher.py +148 -0
- vllm/v1/engine/__init__.py +206 -0
- vllm/v1/engine/async_llm.py +797 -0
- vllm/v1/engine/coordinator.py +377 -0
- vllm/v1/engine/core.py +1420 -0
- vllm/v1/engine/core_client.py +1400 -0
- vllm/v1/engine/detokenizer.py +351 -0
- vllm/v1/engine/exceptions.py +18 -0
- vllm/v1/engine/llm_engine.py +408 -0
- vllm/v1/engine/logprobs.py +182 -0
- vllm/v1/engine/output_processor.py +642 -0
- vllm/v1/engine/parallel_sampling.py +145 -0
- vllm/v1/engine/processor.py +621 -0
- vllm/v1/engine/utils.py +1072 -0
- vllm/v1/executor/__init__.py +6 -0
- vllm/v1/executor/abstract.py +352 -0
- vllm/v1/executor/multiproc_executor.py +877 -0
- vllm/v1/executor/ray_distributed_executor.py +8 -0
- vllm/v1/executor/ray_executor.py +626 -0
- vllm/v1/executor/ray_utils.py +465 -0
- vllm/v1/executor/uniproc_executor.py +183 -0
- vllm/v1/kv_cache_interface.py +403 -0
- vllm/v1/kv_offload/__init__.py +0 -0
- vllm/v1/kv_offload/abstract.py +161 -0
- vllm/v1/kv_offload/arc_manager.py +237 -0
- vllm/v1/kv_offload/backend.py +97 -0
- vllm/v1/kv_offload/backends/__init__.py +0 -0
- vllm/v1/kv_offload/backends/cpu.py +62 -0
- vllm/v1/kv_offload/cpu.py +93 -0
- vllm/v1/kv_offload/factory.py +56 -0
- vllm/v1/kv_offload/lru_manager.py +139 -0
- vllm/v1/kv_offload/mediums.py +39 -0
- vllm/v1/kv_offload/spec.py +62 -0
- vllm/v1/kv_offload/worker/__init__.py +0 -0
- vllm/v1/kv_offload/worker/cpu_gpu.py +185 -0
- vllm/v1/kv_offload/worker/worker.py +144 -0
- vllm/v1/metrics/__init__.py +0 -0
- vllm/v1/metrics/loggers.py +1238 -0
- vllm/v1/metrics/prometheus.py +82 -0
- vllm/v1/metrics/ray_wrappers.py +169 -0
- vllm/v1/metrics/reader.py +257 -0
- vllm/v1/metrics/stats.py +420 -0
- vllm/v1/outputs.py +249 -0
- vllm/v1/pool/__init__.py +0 -0
- vllm/v1/pool/metadata.py +82 -0
- vllm/v1/request.py +259 -0
- vllm/v1/sample/__init__.py +0 -0
- vllm/v1/sample/logits_processor/__init__.py +352 -0
- vllm/v1/sample/logits_processor/builtin.py +274 -0
- vllm/v1/sample/logits_processor/interface.py +106 -0
- vllm/v1/sample/logits_processor/state.py +165 -0
- vllm/v1/sample/metadata.py +44 -0
- vllm/v1/sample/ops/__init__.py +0 -0
- vllm/v1/sample/ops/bad_words.py +52 -0
- vllm/v1/sample/ops/logprobs.py +25 -0
- vllm/v1/sample/ops/penalties.py +57 -0
- vllm/v1/sample/ops/topk_topp_sampler.py +290 -0
- vllm/v1/sample/rejection_sampler.py +793 -0
- vllm/v1/sample/sampler.py +316 -0
- vllm/v1/sample/tpu/__init__.py +0 -0
- vllm/v1/sample/tpu/metadata.py +120 -0
- vllm/v1/sample/tpu/sampler.py +215 -0
- vllm/v1/serial_utils.py +532 -0
- vllm/v1/spec_decode/__init__.py +0 -0
- vllm/v1/spec_decode/eagle.py +1225 -0
- vllm/v1/spec_decode/medusa.py +73 -0
- vllm/v1/spec_decode/metadata.py +66 -0
- vllm/v1/spec_decode/metrics.py +224 -0
- vllm/v1/spec_decode/ngram_proposer.py +291 -0
- vllm/v1/spec_decode/suffix_decoding.py +103 -0
- vllm/v1/spec_decode/utils.py +16 -0
- vllm/v1/structured_output/__init__.py +338 -0
- vllm/v1/structured_output/backend_guidance.py +265 -0
- vllm/v1/structured_output/backend_lm_format_enforcer.py +177 -0
- vllm/v1/structured_output/backend_outlines.py +324 -0
- vllm/v1/structured_output/backend_types.py +136 -0
- vllm/v1/structured_output/backend_xgrammar.py +362 -0
- vllm/v1/structured_output/request.py +94 -0
- vllm/v1/structured_output/utils.py +469 -0
- vllm/v1/utils.py +414 -0
- vllm/v1/worker/__init__.py +0 -0
- vllm/v1/worker/block_table.py +327 -0
- vllm/v1/worker/cpu_model_runner.py +122 -0
- vllm/v1/worker/cpu_worker.py +206 -0
- vllm/v1/worker/dp_utils.py +230 -0
- vllm/v1/worker/ec_connector_model_runner_mixin.py +87 -0
- vllm/v1/worker/gpu_input_batch.py +975 -0
- vllm/v1/worker/gpu_model_runner.py +5102 -0
- vllm/v1/worker/gpu_ubatch_wrapper.py +466 -0
- vllm/v1/worker/gpu_worker.py +894 -0
- vllm/v1/worker/kv_connector_model_runner_mixin.py +144 -0
- vllm/v1/worker/lora_model_runner_mixin.py +213 -0
- vllm/v1/worker/tpu_input_batch.py +593 -0
- vllm/v1/worker/tpu_model_runner.py +2173 -0
- vllm/v1/worker/tpu_worker.py +355 -0
- vllm/v1/worker/ubatch_utils.py +73 -0
- vllm/v1/worker/ubatching.py +231 -0
- vllm/v1/worker/utils.py +366 -0
- vllm/v1/worker/worker_base.py +375 -0
- vllm/v1/worker/xpu_model_runner.py +55 -0
- vllm/v1/worker/xpu_worker.py +189 -0
- vllm/version.py +39 -0
- vllm/vllm_flash_attn/.gitkeep +0 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/METADATA +345 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/RECORD +1536 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/WHEEL +5 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/entry_points.txt +5 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1788 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
3
|
+
|
|
4
|
+
from collections.abc import Callable
|
|
5
|
+
from typing import TYPE_CHECKING, Any, Optional
|
|
6
|
+
|
|
7
|
+
import torch
|
|
8
|
+
from torch.nn import Module
|
|
9
|
+
from torch.nn.parameter import Parameter
|
|
10
|
+
|
|
11
|
+
import vllm.envs as envs
|
|
12
|
+
import vllm.model_executor.layers.fused_moe.modular_kernel as mk
|
|
13
|
+
from vllm._custom_ops import cutlass_scaled_fp4_mm, scaled_fp4_quant
|
|
14
|
+
from vllm.logger import init_logger
|
|
15
|
+
from vllm.model_executor.layers.fused_moe.config import (
|
|
16
|
+
FusedMoEConfig,
|
|
17
|
+
FusedMoEQuantConfig,
|
|
18
|
+
RoutingMethodType,
|
|
19
|
+
fp8_w8a8_moe_quant_config,
|
|
20
|
+
nvfp4_moe_quant_config,
|
|
21
|
+
)
|
|
22
|
+
from vllm.model_executor.layers.fused_moe.fused_marlin_moe import fused_marlin_moe
|
|
23
|
+
from vllm.model_executor.layers.fused_moe.layer import (
|
|
24
|
+
FusedMoE,
|
|
25
|
+
FusedMoEMethodBase,
|
|
26
|
+
FusedMoeWeightScaleSupported,
|
|
27
|
+
)
|
|
28
|
+
from vllm.model_executor.layers.linear import (
|
|
29
|
+
LinearBase,
|
|
30
|
+
LinearMethodBase,
|
|
31
|
+
UnquantizedLinearMethod,
|
|
32
|
+
)
|
|
33
|
+
from vllm.model_executor.layers.quantization import QuantizationMethods
|
|
34
|
+
from vllm.model_executor.layers.quantization.base_config import (
|
|
35
|
+
QuantizationConfig,
|
|
36
|
+
QuantizeMethodBase,
|
|
37
|
+
)
|
|
38
|
+
from vllm.model_executor.layers.quantization.kv_cache import BaseKVCacheMethod
|
|
39
|
+
from vllm.model_executor.layers.quantization.utils.flashinfer_fp4_moe import (
|
|
40
|
+
build_flashinfer_fp4_cutlass_moe_prepare_finalize,
|
|
41
|
+
reorder_w1w3_to_w3w1,
|
|
42
|
+
select_nvfp4_gemm_impl,
|
|
43
|
+
)
|
|
44
|
+
from vllm.model_executor.layers.quantization.utils.flashinfer_utils import (
|
|
45
|
+
FlashinferMoeBackend,
|
|
46
|
+
apply_flashinfer_per_tensor_scale_fp8,
|
|
47
|
+
build_flashinfer_fp8_cutlass_moe_prepare_finalize,
|
|
48
|
+
flashinfer_cutlass_moe_fp8,
|
|
49
|
+
get_flashinfer_moe_backend,
|
|
50
|
+
is_flashinfer_supporting_global_sf,
|
|
51
|
+
register_moe_scaling_factors,
|
|
52
|
+
rotate_flashinfer_fp8_moe_weights,
|
|
53
|
+
select_cutlass_fp8_gemm_impl,
|
|
54
|
+
swap_w13_to_w31,
|
|
55
|
+
)
|
|
56
|
+
from vllm.model_executor.layers.quantization.utils.marlin_utils_fp4 import (
|
|
57
|
+
apply_fp4_marlin_linear,
|
|
58
|
+
is_fp4_marlin_supported,
|
|
59
|
+
prepare_fp4_layer_for_marlin,
|
|
60
|
+
prepare_moe_fp4_layer_for_marlin,
|
|
61
|
+
)
|
|
62
|
+
from vllm.model_executor.layers.quantization.utils.quant_utils import (
|
|
63
|
+
GroupShape,
|
|
64
|
+
cutlass_fp4_supported,
|
|
65
|
+
is_layer_skipped,
|
|
66
|
+
swizzle_blockscale,
|
|
67
|
+
)
|
|
68
|
+
from vllm.model_executor.layers.quantization.utils.w8a8_utils import (
|
|
69
|
+
Fp8LinearOp,
|
|
70
|
+
requantize_with_max_scale,
|
|
71
|
+
)
|
|
72
|
+
from vllm.model_executor.parameter import ModelWeightParameter, PerTensorScaleParameter
|
|
73
|
+
from vllm.scalar_type import scalar_types
|
|
74
|
+
from vllm.utils.flashinfer import (
|
|
75
|
+
flashinfer_scaled_fp4_mm,
|
|
76
|
+
has_flashinfer,
|
|
77
|
+
has_flashinfer_moe,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
if TYPE_CHECKING:
|
|
81
|
+
from vllm.model_executor.models.utils import WeightsMapper
|
|
82
|
+
|
|
83
|
+
logger = init_logger(__name__)
|
|
84
|
+
|
|
85
|
+
QUANT_ALGOS = ["FP8", "NVFP4"]
|
|
86
|
+
KV_CACHE_QUANT_ALGOS = ["FP8"]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class ModelOptFp8Config(QuantizationConfig):
|
|
90
|
+
"""Config class for ModelOpt FP8."""
|
|
91
|
+
|
|
92
|
+
def __init__(
|
|
93
|
+
self,
|
|
94
|
+
is_checkpoint_fp8_serialized: bool = False,
|
|
95
|
+
kv_cache_quant_method: str | None = None,
|
|
96
|
+
exclude_modules: list[str] | None = None,
|
|
97
|
+
) -> None:
|
|
98
|
+
super().__init__()
|
|
99
|
+
self.is_checkpoint_fp8_serialized = is_checkpoint_fp8_serialized
|
|
100
|
+
self.kv_cache_quant_method = kv_cache_quant_method
|
|
101
|
+
self.exclude_modules = exclude_modules or []
|
|
102
|
+
if is_checkpoint_fp8_serialized:
|
|
103
|
+
logger.warning(
|
|
104
|
+
"Detected ModelOpt fp8 checkpoint. Please note that"
|
|
105
|
+
" the format is experimental and could change."
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
@classmethod
|
|
109
|
+
def get_name(cls) -> QuantizationMethods:
|
|
110
|
+
return "modelopt"
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def get_supported_act_dtypes(cls) -> list[torch.dtype]:
|
|
114
|
+
return [torch.bfloat16, torch.half]
|
|
115
|
+
|
|
116
|
+
@classmethod
|
|
117
|
+
def get_min_capability(cls) -> int:
|
|
118
|
+
return 89
|
|
119
|
+
|
|
120
|
+
@classmethod
|
|
121
|
+
def get_config_filenames(cls) -> list[str]:
|
|
122
|
+
return ["hf_quant_config.json"]
|
|
123
|
+
|
|
124
|
+
def apply_vllm_mapper(self, hf_to_vllm_mapper: "WeightsMapper"):
|
|
125
|
+
if self.exclude_modules is not None:
|
|
126
|
+
self.exclude_modules = hf_to_vllm_mapper.apply_list(self.exclude_modules)
|
|
127
|
+
|
|
128
|
+
@classmethod
|
|
129
|
+
def override_quantization_method(
|
|
130
|
+
cls, hf_quant_cfg, user_quant
|
|
131
|
+
) -> QuantizationMethods | None:
|
|
132
|
+
"""Detect if this ModelOpt config should be used based on
|
|
133
|
+
quantization config."""
|
|
134
|
+
|
|
135
|
+
if hf_quant_cfg is None:
|
|
136
|
+
return None
|
|
137
|
+
|
|
138
|
+
# Use the community standard 'quant_method'
|
|
139
|
+
quant_method = hf_quant_cfg.get("quant_method", "").lower()
|
|
140
|
+
|
|
141
|
+
# Only proceed if the method is explicitly "modelopt"
|
|
142
|
+
if quant_method != "modelopt":
|
|
143
|
+
return None
|
|
144
|
+
|
|
145
|
+
# Look for ModelOpt-specific config structure
|
|
146
|
+
if "quantization" in hf_quant_cfg:
|
|
147
|
+
quant_config = hf_quant_cfg["quantization"]
|
|
148
|
+
if isinstance(quant_config, dict):
|
|
149
|
+
quant_algo = quant_config.get("quant_algo", "")
|
|
150
|
+
if "FP8" in quant_algo:
|
|
151
|
+
return "modelopt"
|
|
152
|
+
else:
|
|
153
|
+
# Check for compressed-tensors style config with specific quant_algo
|
|
154
|
+
quant_algo = hf_quant_cfg.get("quant_algo", "")
|
|
155
|
+
if isinstance(quant_algo, str) and "FP8" in quant_algo:
|
|
156
|
+
return "modelopt"
|
|
157
|
+
|
|
158
|
+
return None
|
|
159
|
+
|
|
160
|
+
@classmethod
|
|
161
|
+
def from_config(cls, config: dict[str, Any]) -> "ModelOptFp8Config":
|
|
162
|
+
# Handle both ModelOpt format and compressed-tensors style format
|
|
163
|
+
if "quantization" in config:
|
|
164
|
+
# ModelOpt format: {"quantization": {"quant_algo": "..."}}
|
|
165
|
+
quant_config = cls.get_from_keys(config, ["quantization"])
|
|
166
|
+
if not isinstance(quant_config, dict):
|
|
167
|
+
raise ValueError("Expected 'quantization' to be a dictionary in config")
|
|
168
|
+
quant_method = quant_config.get("quant_algo", "")
|
|
169
|
+
if not quant_method:
|
|
170
|
+
raise ValueError("Missing 'quant_algo' in quantization config")
|
|
171
|
+
kv_cache_quant_method = quant_config.get("kv_cache_quant_algo")
|
|
172
|
+
# "exclude_modules" is the key in the legacy hf_quant_config.json
|
|
173
|
+
exclude_modules = quant_config.get("exclude_modules")
|
|
174
|
+
else:
|
|
175
|
+
# Compressed-tensors style format:
|
|
176
|
+
# {"quant_algo": "...", "quant_method": "modelopt"}
|
|
177
|
+
quant_method = config.get("quant_algo", "")
|
|
178
|
+
kv_cache_quant_method = config.get("kv_cache_quant_algo")
|
|
179
|
+
# "ignore" is the key in config.json
|
|
180
|
+
exclude_modules = config.get("ignore")
|
|
181
|
+
|
|
182
|
+
if quant_method not in QUANT_ALGOS:
|
|
183
|
+
raise ValueError(
|
|
184
|
+
f"ModelOpt currently only supports: {QUANT_ALGOS} "
|
|
185
|
+
"quantizations in vLLM. Please check the "
|
|
186
|
+
"`hf_quant_config.json` file for your model's "
|
|
187
|
+
"quant configuration."
|
|
188
|
+
)
|
|
189
|
+
is_checkpoint_fp8_serialized = "FP8" in quant_method
|
|
190
|
+
|
|
191
|
+
return cls(is_checkpoint_fp8_serialized, kv_cache_quant_method, exclude_modules)
|
|
192
|
+
|
|
193
|
+
def is_layer_excluded(self, prefix: str) -> bool:
|
|
194
|
+
"""
|
|
195
|
+
Check if a layer should be excluded from quantization.
|
|
196
|
+
Handles both exact matching (for fused layers) and substring matching.
|
|
197
|
+
|
|
198
|
+
This method handles both regular models and multimodal models that use
|
|
199
|
+
the language_model prefix. For multimodal models, it checks if the
|
|
200
|
+
module name (without the language_model prefix) is in the exclude list.
|
|
201
|
+
"""
|
|
202
|
+
if self.exclude_modules is None:
|
|
203
|
+
return False
|
|
204
|
+
|
|
205
|
+
# First check exact matching with fused layer support
|
|
206
|
+
if is_layer_skipped(prefix, self.exclude_modules, self.packed_modules_mapping):
|
|
207
|
+
return True
|
|
208
|
+
|
|
209
|
+
# Then check substring matching for patterns not caught by exact match
|
|
210
|
+
for module in self.exclude_modules:
|
|
211
|
+
# Skip exact matches already handled above
|
|
212
|
+
if module != prefix and (
|
|
213
|
+
module in prefix
|
|
214
|
+
or (
|
|
215
|
+
prefix.startswith("language_model.")
|
|
216
|
+
and module in prefix.removeprefix("language_model.")
|
|
217
|
+
)
|
|
218
|
+
):
|
|
219
|
+
return True
|
|
220
|
+
return False
|
|
221
|
+
|
|
222
|
+
def get_quant_method(
|
|
223
|
+
self, layer: torch.nn.Module, prefix: str
|
|
224
|
+
) -> Optional["QuantizeMethodBase"]:
|
|
225
|
+
from vllm.attention.layer import ( # Avoid circular import
|
|
226
|
+
Attention,
|
|
227
|
+
MLAAttention,
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
if isinstance(layer, LinearBase):
|
|
231
|
+
if self.is_layer_excluded(prefix):
|
|
232
|
+
return UnquantizedLinearMethod()
|
|
233
|
+
# Check if this is a vision model layer that should not be quantized
|
|
234
|
+
if "vision_tower" in prefix or "vision_model" in prefix:
|
|
235
|
+
return UnquantizedLinearMethod()
|
|
236
|
+
return ModelOptFp8LinearMethod(self)
|
|
237
|
+
elif isinstance(layer, (Attention, MLAAttention)):
|
|
238
|
+
return ModelOptFp8KVCacheMethod(self)
|
|
239
|
+
elif isinstance(layer, FusedMoE):
|
|
240
|
+
return ModelOptFp8MoEMethod(self, layer)
|
|
241
|
+
return None
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
class ModelOptFp8LinearMethod(LinearMethodBase):
|
|
245
|
+
"""Linear method for Model Optimizer static quantization.
|
|
246
|
+
Supports loading FP8 checkpoints with static weight scale and
|
|
247
|
+
activation scale. Future support might be added for dynamic
|
|
248
|
+
scales.
|
|
249
|
+
|
|
250
|
+
Limitations:
|
|
251
|
+
1. Only support per-tensor quantization due to torch._scaled_mm support.
|
|
252
|
+
2. Only support float8_e4m3fn datatype
|
|
253
|
+
Args: quant_config: The ModelOpt quantization config.
|
|
254
|
+
"""
|
|
255
|
+
|
|
256
|
+
def __init__(self, quant_config: ModelOptFp8Config) -> None:
|
|
257
|
+
self.quant_config = quant_config
|
|
258
|
+
self.fp8_linear = Fp8LinearOp(
|
|
259
|
+
act_quant_static=True, act_quant_group_shape=GroupShape.PER_TENSOR
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
def create_weights(
|
|
263
|
+
self,
|
|
264
|
+
layer: torch.nn.Module,
|
|
265
|
+
input_size_per_partition: int,
|
|
266
|
+
output_partition_sizes: list[int],
|
|
267
|
+
input_size: int,
|
|
268
|
+
output_size: int,
|
|
269
|
+
params_dtype: torch.dtype,
|
|
270
|
+
**extra_weight_attrs,
|
|
271
|
+
):
|
|
272
|
+
del input_size, output_size
|
|
273
|
+
output_size_per_partition = sum(output_partition_sizes)
|
|
274
|
+
weight_loader = extra_weight_attrs.get("weight_loader")
|
|
275
|
+
layer.logical_widths = output_partition_sizes
|
|
276
|
+
layer.input_size_per_partition = input_size_per_partition
|
|
277
|
+
layer.output_size_per_partition = output_size_per_partition
|
|
278
|
+
weight_dtype = (
|
|
279
|
+
torch.float8_e4m3fn
|
|
280
|
+
if self.quant_config.is_checkpoint_fp8_serialized
|
|
281
|
+
else params_dtype
|
|
282
|
+
)
|
|
283
|
+
weight = ModelWeightParameter(
|
|
284
|
+
data=torch.empty(
|
|
285
|
+
output_size_per_partition, input_size_per_partition, dtype=weight_dtype
|
|
286
|
+
),
|
|
287
|
+
input_dim=1,
|
|
288
|
+
output_dim=0,
|
|
289
|
+
weight_loader=weight_loader,
|
|
290
|
+
)
|
|
291
|
+
layer.register_parameter("weight", weight)
|
|
292
|
+
|
|
293
|
+
if self.quant_config.is_checkpoint_fp8_serialized:
|
|
294
|
+
# WEIGHT SCALE
|
|
295
|
+
weight_scale = PerTensorScaleParameter(
|
|
296
|
+
data=torch.empty(len(output_partition_sizes), dtype=torch.float32),
|
|
297
|
+
weight_loader=weight_loader,
|
|
298
|
+
)
|
|
299
|
+
weight_scale[:] = torch.finfo(torch.float32).min
|
|
300
|
+
layer.register_parameter("weight_scale", weight_scale)
|
|
301
|
+
# INPUT SCALE
|
|
302
|
+
scale = PerTensorScaleParameter(
|
|
303
|
+
data=torch.empty(len(output_partition_sizes), dtype=torch.float32),
|
|
304
|
+
weight_loader=weight_loader,
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
scale[:] = torch.finfo(torch.float32).min
|
|
308
|
+
layer.register_parameter("input_scale", scale)
|
|
309
|
+
|
|
310
|
+
def process_weights_after_loading(self, layer: Module) -> None:
|
|
311
|
+
weight = layer.weight
|
|
312
|
+
max_w_scale = layer.weight_scale.max()
|
|
313
|
+
if not (layer.weight_scale == layer.weight_scale[0]).all():
|
|
314
|
+
max_w_scale, weight = requantize_with_max_scale(
|
|
315
|
+
layer.weight, layer.weight_scale, layer.logical_widths
|
|
316
|
+
)
|
|
317
|
+
layer.weight = Parameter(weight.t(), requires_grad=False)
|
|
318
|
+
layer.weight_scale = Parameter(max_w_scale, requires_grad=False)
|
|
319
|
+
layer.input_scale = Parameter(layer.input_scale.max(), requires_grad=False)
|
|
320
|
+
|
|
321
|
+
def apply(
|
|
322
|
+
self,
|
|
323
|
+
layer: torch.nn.Module,
|
|
324
|
+
x: torch.Tensor,
|
|
325
|
+
bias: torch.Tensor | None = None,
|
|
326
|
+
) -> torch.Tensor:
|
|
327
|
+
return self.fp8_linear.apply(
|
|
328
|
+
input=x,
|
|
329
|
+
weight=layer.weight,
|
|
330
|
+
weight_scale=layer.weight_scale,
|
|
331
|
+
input_scale=layer.input_scale,
|
|
332
|
+
bias=bias,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
class ModelOptFp8MoEMethod(FusedMoEMethodBase):
|
|
337
|
+
"""MoE method for ModelOpt FP8.
|
|
338
|
+
Supports loading FP8 checkpoints with static weight scale and
|
|
339
|
+
activation scale.
|
|
340
|
+
Args:
|
|
341
|
+
quant_config: The ModelOpt quantization config.
|
|
342
|
+
"""
|
|
343
|
+
|
|
344
|
+
def __init__(
|
|
345
|
+
self,
|
|
346
|
+
quant_config: ModelOptFp8Config,
|
|
347
|
+
layer: torch.nn.Module,
|
|
348
|
+
) -> None:
|
|
349
|
+
super().__init__(layer.moe_config)
|
|
350
|
+
self.layer = layer
|
|
351
|
+
self.quant_config = quant_config
|
|
352
|
+
from vllm.model_executor.layers.quantization.utils.w8a8_utils import (
|
|
353
|
+
cutlass_fp8_supported,
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
self.cutlass_fp8_supported = cutlass_fp8_supported()
|
|
357
|
+
self.flashinfer_moe_backend: FlashinferMoeBackend | None = None
|
|
358
|
+
if envs.VLLM_USE_FLASHINFER_MOE_FP8 and has_flashinfer_moe():
|
|
359
|
+
self.flashinfer_moe_backend = get_flashinfer_moe_backend()
|
|
360
|
+
if (
|
|
361
|
+
self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM
|
|
362
|
+
and not self.moe.is_act_and_mul
|
|
363
|
+
):
|
|
364
|
+
logger.info_once(
|
|
365
|
+
"Non-gated MoE is not supported for min-latency mode,"
|
|
366
|
+
"falling back to high-throughput mode"
|
|
367
|
+
)
|
|
368
|
+
self.flashinfer_moe_backend = FlashinferMoeBackend.CUTLASS
|
|
369
|
+
|
|
370
|
+
logger.info_once(
|
|
371
|
+
f"Using FlashInfer {self.flashinfer_moe_backend.value} kernels"
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
def maybe_make_prepare_finalize(
|
|
375
|
+
self,
|
|
376
|
+
) -> mk.FusedMoEPrepareAndFinalize | None:
|
|
377
|
+
# TRT LLM not supported with all2all yet.
|
|
378
|
+
if self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM:
|
|
379
|
+
return None
|
|
380
|
+
elif self.flashinfer_moe_backend == FlashinferMoeBackend.CUTLASS:
|
|
381
|
+
prepare_finalize = build_flashinfer_fp8_cutlass_moe_prepare_finalize(
|
|
382
|
+
self.moe
|
|
383
|
+
)
|
|
384
|
+
logger.debug_once("%s", prepare_finalize.__class__.__name__)
|
|
385
|
+
return prepare_finalize
|
|
386
|
+
else:
|
|
387
|
+
return super().maybe_make_prepare_finalize()
|
|
388
|
+
|
|
389
|
+
def select_gemm_impl(
|
|
390
|
+
self,
|
|
391
|
+
prepare_finalize: mk.FusedMoEPrepareAndFinalize,
|
|
392
|
+
layer: torch.nn.Module,
|
|
393
|
+
) -> mk.FusedMoEPermuteExpertsUnpermute:
|
|
394
|
+
assert self.moe_quant_config is not None
|
|
395
|
+
experts = select_cutlass_fp8_gemm_impl(
|
|
396
|
+
self.moe,
|
|
397
|
+
self.moe_quant_config,
|
|
398
|
+
)
|
|
399
|
+
logger.debug_once("Using %s", experts.__class__.__name__)
|
|
400
|
+
return experts
|
|
401
|
+
|
|
402
|
+
def create_weights(
|
|
403
|
+
self,
|
|
404
|
+
layer: torch.nn.Module,
|
|
405
|
+
num_experts: int,
|
|
406
|
+
hidden_size: int,
|
|
407
|
+
intermediate_size_per_partition: int,
|
|
408
|
+
params_dtype: torch.dtype,
|
|
409
|
+
**extra_weight_attrs,
|
|
410
|
+
):
|
|
411
|
+
# Use FP8 dtype if checkpoint is serialized
|
|
412
|
+
weight_dtype = (
|
|
413
|
+
torch.float8_e4m3fn
|
|
414
|
+
if self.quant_config.is_checkpoint_fp8_serialized
|
|
415
|
+
else params_dtype
|
|
416
|
+
)
|
|
417
|
+
weight_loader = extra_weight_attrs.get("weight_loader")
|
|
418
|
+
|
|
419
|
+
if self.moe.is_act_and_mul:
|
|
420
|
+
w13_up_dim = 2 * intermediate_size_per_partition
|
|
421
|
+
else:
|
|
422
|
+
w13_up_dim = intermediate_size_per_partition
|
|
423
|
+
|
|
424
|
+
w13_weight = ModelWeightParameter(
|
|
425
|
+
data=torch.empty(
|
|
426
|
+
num_experts,
|
|
427
|
+
w13_up_dim,
|
|
428
|
+
hidden_size,
|
|
429
|
+
dtype=weight_dtype,
|
|
430
|
+
),
|
|
431
|
+
input_dim=2,
|
|
432
|
+
output_dim=1,
|
|
433
|
+
weight_loader=weight_loader,
|
|
434
|
+
)
|
|
435
|
+
layer.register_parameter("w13_weight", w13_weight)
|
|
436
|
+
|
|
437
|
+
w2_weight = ModelWeightParameter(
|
|
438
|
+
data=torch.empty(
|
|
439
|
+
num_experts,
|
|
440
|
+
hidden_size,
|
|
441
|
+
intermediate_size_per_partition,
|
|
442
|
+
dtype=weight_dtype,
|
|
443
|
+
),
|
|
444
|
+
input_dim=2,
|
|
445
|
+
output_dim=1,
|
|
446
|
+
weight_loader=weight_loader,
|
|
447
|
+
)
|
|
448
|
+
layer.register_parameter("w2_weight", w2_weight)
|
|
449
|
+
|
|
450
|
+
if self.quant_config.is_checkpoint_fp8_serialized:
|
|
451
|
+
# WEIGHT SCALES - Per-tensor scaling for ModelOpts
|
|
452
|
+
# For gated MoE, allocate 2 scales for w1 and w3 respectively.
|
|
453
|
+
# They will be combined to a single scale after weight loading.
|
|
454
|
+
# For non-gated MoE, allocate 1 scale for w13.
|
|
455
|
+
if self.moe.is_act_and_mul:
|
|
456
|
+
w13_weight_scale_shape = (num_experts, 2)
|
|
457
|
+
else:
|
|
458
|
+
w13_weight_scale_shape = (num_experts, 1)
|
|
459
|
+
w13_weight_scale = PerTensorScaleParameter(
|
|
460
|
+
data=torch.full(
|
|
461
|
+
w13_weight_scale_shape,
|
|
462
|
+
1.0,
|
|
463
|
+
dtype=torch.float32,
|
|
464
|
+
),
|
|
465
|
+
weight_loader=weight_loader,
|
|
466
|
+
)
|
|
467
|
+
w2_weight_scale = PerTensorScaleParameter(
|
|
468
|
+
data=torch.full((num_experts,), 1.0, dtype=torch.float32),
|
|
469
|
+
weight_loader=weight_loader,
|
|
470
|
+
)
|
|
471
|
+
layer.register_parameter("w13_weight_scale", w13_weight_scale)
|
|
472
|
+
layer.register_parameter("w2_weight_scale", w2_weight_scale)
|
|
473
|
+
|
|
474
|
+
# Set weight loader attributes for scales
|
|
475
|
+
extra_weight_attrs.update(
|
|
476
|
+
{"quant_method": FusedMoeWeightScaleSupported.TENSOR.value}
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
# INPUT SCALES - Per-tensor scaling for ModelOpt
|
|
480
|
+
w13_input_scale = PerTensorScaleParameter(
|
|
481
|
+
data=torch.full((num_experts,), 1.0, dtype=torch.float32),
|
|
482
|
+
weight_loader=weight_loader,
|
|
483
|
+
)
|
|
484
|
+
w2_input_scale = PerTensorScaleParameter(
|
|
485
|
+
data=torch.full((num_experts,), 1.0, dtype=torch.float32),
|
|
486
|
+
weight_loader=weight_loader,
|
|
487
|
+
)
|
|
488
|
+
layer.register_parameter("w13_input_scale", w13_input_scale)
|
|
489
|
+
layer.register_parameter("w2_input_scale", w2_input_scale)
|
|
490
|
+
|
|
491
|
+
def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
|
|
492
|
+
"""Process FP8 MoE weights after loading from serialized checkpoint.
|
|
493
|
+
Only supports pre-quantized checkpoints with FP8 weights and scales.
|
|
494
|
+
"""
|
|
495
|
+
|
|
496
|
+
layer.w13_weight = Parameter(layer.w13_weight.data, requires_grad=False)
|
|
497
|
+
layer.w2_weight = Parameter(layer.w2_weight.data, requires_grad=False)
|
|
498
|
+
|
|
499
|
+
from vllm._custom_ops import scaled_fp8_quant
|
|
500
|
+
from vllm.model_executor.layers.quantization.utils.w8a8_utils import (
|
|
501
|
+
per_tensor_dequantize,
|
|
502
|
+
)
|
|
503
|
+
|
|
504
|
+
# Handle scale parameters
|
|
505
|
+
if hasattr(layer, "w13_weight_scale") and layer.w13_weight_scale is not None:
|
|
506
|
+
# Fp8 moe kernel needs single weight scale for w13 per expert.
|
|
507
|
+
# We take the max of the w1 and w3 scales
|
|
508
|
+
# then dequant and requant each expert.
|
|
509
|
+
if (
|
|
510
|
+
layer.w13_weight_scale.dim() == 2
|
|
511
|
+
and layer.w13_weight_scale.shape[1] == 2
|
|
512
|
+
):
|
|
513
|
+
assert self.moe.is_act_and_mul, (
|
|
514
|
+
"w13_weight_scale should have 2 elements per expert "
|
|
515
|
+
"only for gated MoE"
|
|
516
|
+
)
|
|
517
|
+
# Get the maximum scale across w1 and w3 for each expert
|
|
518
|
+
max_w13_scales = layer.w13_weight_scale.max(dim=1).values
|
|
519
|
+
|
|
520
|
+
# Requantize each expert's weights using the combined scale
|
|
521
|
+
# w13_weight (num_experts, 2 * intermediate_size, hidden_size)
|
|
522
|
+
# where the first intermediate_size rows are w1, the next are w3
|
|
523
|
+
intermediate_size = layer.w13_weight.shape[1] // 2
|
|
524
|
+
for expert_id in range(layer.w13_weight.shape[0]):
|
|
525
|
+
start = 0
|
|
526
|
+
for shard_id in range(2): # w1 and w3
|
|
527
|
+
# Dequantize using the original scale for this shard
|
|
528
|
+
dq_weight = per_tensor_dequantize(
|
|
529
|
+
layer.w13_weight[expert_id][
|
|
530
|
+
start : start + intermediate_size, :
|
|
531
|
+
],
|
|
532
|
+
layer.w13_weight_scale[expert_id][shard_id],
|
|
533
|
+
)
|
|
534
|
+
# Requantize using the combined max scale
|
|
535
|
+
|
|
536
|
+
(
|
|
537
|
+
layer.w13_weight[expert_id][
|
|
538
|
+
start : start + intermediate_size, :
|
|
539
|
+
],
|
|
540
|
+
_,
|
|
541
|
+
) = scaled_fp8_quant(dq_weight, max_w13_scales[expert_id])
|
|
542
|
+
|
|
543
|
+
start += intermediate_size
|
|
544
|
+
|
|
545
|
+
# Update the scale parameter to be per-expert
|
|
546
|
+
layer.w13_weight_scale = Parameter(max_w13_scales, requires_grad=False)
|
|
547
|
+
else:
|
|
548
|
+
layer.w13_weight_scale = Parameter(
|
|
549
|
+
layer.w13_weight_scale.data, requires_grad=False
|
|
550
|
+
)
|
|
551
|
+
|
|
552
|
+
if hasattr(layer, "w2_weight_scale") and layer.w2_weight_scale is not None:
|
|
553
|
+
layer.w2_weight_scale = Parameter(
|
|
554
|
+
layer.w2_weight_scale.data, requires_grad=False
|
|
555
|
+
)
|
|
556
|
+
# Input scales must be equal for each expert in fp8 MoE layers.
|
|
557
|
+
if hasattr(layer, "w13_input_scale") and layer.w13_input_scale is not None:
|
|
558
|
+
layer.w13_input_scale = Parameter(
|
|
559
|
+
layer.w13_input_scale.max(), requires_grad=False
|
|
560
|
+
)
|
|
561
|
+
if hasattr(layer, "w2_input_scale") and layer.w2_input_scale is not None:
|
|
562
|
+
layer.w2_input_scale = Parameter(
|
|
563
|
+
layer.w2_input_scale.max(), requires_grad=False
|
|
564
|
+
)
|
|
565
|
+
|
|
566
|
+
if self.flashinfer_moe_backend is not None:
|
|
567
|
+
if self.moe.is_act_and_mul:
|
|
568
|
+
layer.w13_weight.data = swap_w13_to_w31(layer.w13_weight.data)
|
|
569
|
+
if self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM:
|
|
570
|
+
rotate_flashinfer_fp8_moe_weights(layer.w13_weight, layer.w2_weight)
|
|
571
|
+
register_moe_scaling_factors(layer)
|
|
572
|
+
|
|
573
|
+
def get_fused_moe_quant_config(
|
|
574
|
+
self, layer: torch.nn.Module
|
|
575
|
+
) -> FusedMoEQuantConfig | None:
|
|
576
|
+
if self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM:
|
|
577
|
+
return None
|
|
578
|
+
|
|
579
|
+
return fp8_w8a8_moe_quant_config(
|
|
580
|
+
w1_scale=layer.w13_weight_scale,
|
|
581
|
+
g1_alphas=layer.output1_scales_gate_scalar.squeeze(),
|
|
582
|
+
w2_scale=layer.w2_weight_scale,
|
|
583
|
+
g2_alphas=layer.output2_scales_scalar.squeeze(),
|
|
584
|
+
a1_scale=layer.w13_input_scale,
|
|
585
|
+
a1_gscale=layer.w13_input_scale,
|
|
586
|
+
a2_scale=layer.w2_input_scale,
|
|
587
|
+
a2_gscale=layer.w2_input_scale_inv,
|
|
588
|
+
per_act_token_quant=False,
|
|
589
|
+
)
|
|
590
|
+
|
|
591
|
+
def apply(
|
|
592
|
+
self,
|
|
593
|
+
layer: torch.nn.Module,
|
|
594
|
+
x: torch.Tensor,
|
|
595
|
+
router_logits: torch.Tensor,
|
|
596
|
+
top_k: int,
|
|
597
|
+
renormalize: bool,
|
|
598
|
+
use_grouped_topk: bool = False,
|
|
599
|
+
topk_group: int | None = None,
|
|
600
|
+
num_expert_group: int | None = None,
|
|
601
|
+
global_num_experts: int = -1,
|
|
602
|
+
expert_map: torch.Tensor | None = None,
|
|
603
|
+
custom_routing_function: Callable | None = None,
|
|
604
|
+
scoring_func: str = "softmax",
|
|
605
|
+
routed_scaling_factor: float = 1.0,
|
|
606
|
+
e_score_correction_bias: torch.Tensor | None = None,
|
|
607
|
+
apply_router_weight_on_input: bool = False,
|
|
608
|
+
activation: str = "silu",
|
|
609
|
+
enable_eplb: bool = False,
|
|
610
|
+
expert_load_view: torch.Tensor | None = None,
|
|
611
|
+
logical_to_physical_map: torch.Tensor | None = None,
|
|
612
|
+
logical_replica_count: torch.Tensor | None = None,
|
|
613
|
+
) -> torch.Tensor | tuple[torch.Tensor, torch.Tensor]:
|
|
614
|
+
if enable_eplb:
|
|
615
|
+
raise NotImplementedError(
|
|
616
|
+
"EPLB not supported for `ModelOptFp8MoEMethod` yet."
|
|
617
|
+
)
|
|
618
|
+
|
|
619
|
+
if self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM:
|
|
620
|
+
assert activation == "silu", (
|
|
621
|
+
f"Expected 'silu' activation but got {activation}"
|
|
622
|
+
)
|
|
623
|
+
assert not renormalize
|
|
624
|
+
return apply_flashinfer_per_tensor_scale_fp8(
|
|
625
|
+
layer=layer,
|
|
626
|
+
hidden_states=x,
|
|
627
|
+
router_logits=router_logits,
|
|
628
|
+
routing_bias=e_score_correction_bias,
|
|
629
|
+
global_num_experts=global_num_experts,
|
|
630
|
+
top_k=top_k,
|
|
631
|
+
num_expert_group=num_expert_group,
|
|
632
|
+
topk_group=topk_group,
|
|
633
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
634
|
+
)
|
|
635
|
+
|
|
636
|
+
# Expert selection
|
|
637
|
+
topk_weights, topk_ids, _ = FusedMoE.select_experts(
|
|
638
|
+
hidden_states=x,
|
|
639
|
+
router_logits=router_logits,
|
|
640
|
+
use_grouped_topk=use_grouped_topk,
|
|
641
|
+
top_k=top_k,
|
|
642
|
+
renormalize=renormalize,
|
|
643
|
+
topk_group=topk_group,
|
|
644
|
+
num_expert_group=num_expert_group,
|
|
645
|
+
custom_routing_function=custom_routing_function,
|
|
646
|
+
scoring_func=scoring_func,
|
|
647
|
+
routed_scaling_factor=routed_scaling_factor,
|
|
648
|
+
e_score_correction_bias=e_score_correction_bias,
|
|
649
|
+
indices_type=self.topk_indices_dtype,
|
|
650
|
+
)
|
|
651
|
+
|
|
652
|
+
if self.flashinfer_moe_backend == FlashinferMoeBackend.CUTLASS:
|
|
653
|
+
assert activation in ("silu", "relu2_no_mul"), (
|
|
654
|
+
"Expected activation to be in ('silu', 'relu2_no_mul'),"
|
|
655
|
+
f"but got {activation}"
|
|
656
|
+
)
|
|
657
|
+
return flashinfer_cutlass_moe_fp8(
|
|
658
|
+
x,
|
|
659
|
+
layer,
|
|
660
|
+
topk_weights,
|
|
661
|
+
topk_ids,
|
|
662
|
+
inplace=False,
|
|
663
|
+
activation=activation,
|
|
664
|
+
global_num_experts=global_num_experts,
|
|
665
|
+
expert_map=expert_map,
|
|
666
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
667
|
+
)
|
|
668
|
+
else:
|
|
669
|
+
from vllm.model_executor.layers.fused_moe.fused_moe import fused_experts
|
|
670
|
+
|
|
671
|
+
assert self.moe_quant_config is not None
|
|
672
|
+
|
|
673
|
+
return fused_experts(
|
|
674
|
+
x,
|
|
675
|
+
layer.w13_weight,
|
|
676
|
+
layer.w2_weight,
|
|
677
|
+
topk_weights=topk_weights,
|
|
678
|
+
topk_ids=topk_ids,
|
|
679
|
+
inplace=True,
|
|
680
|
+
activation=activation,
|
|
681
|
+
quant_config=self.moe_quant_config,
|
|
682
|
+
global_num_experts=global_num_experts,
|
|
683
|
+
expert_map=expert_map,
|
|
684
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
685
|
+
)
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
class ModelOptNvFp4Config(QuantizationConfig):
|
|
689
|
+
"""Config class for ModelOpt FP4."""
|
|
690
|
+
|
|
691
|
+
def __init__(
|
|
692
|
+
self,
|
|
693
|
+
is_checkpoint_nvfp4_serialized: bool,
|
|
694
|
+
kv_cache_quant_algo: str | None,
|
|
695
|
+
exclude_modules: list[str],
|
|
696
|
+
group_size: int = 16,
|
|
697
|
+
) -> None:
|
|
698
|
+
super().__init__()
|
|
699
|
+
self.is_checkpoint_nvfp4_serialized = is_checkpoint_nvfp4_serialized
|
|
700
|
+
if is_checkpoint_nvfp4_serialized:
|
|
701
|
+
logger.warning(
|
|
702
|
+
"Detected ModelOpt NVFP4 checkpoint. Please note that"
|
|
703
|
+
" the format is experimental and could change in future."
|
|
704
|
+
)
|
|
705
|
+
|
|
706
|
+
self.group_size = group_size
|
|
707
|
+
self.kv_cache_quant_algo = kv_cache_quant_algo
|
|
708
|
+
self.exclude_modules = exclude_modules
|
|
709
|
+
|
|
710
|
+
@classmethod
|
|
711
|
+
def get_name(cls) -> QuantizationMethods:
|
|
712
|
+
return "modelopt_fp4"
|
|
713
|
+
|
|
714
|
+
@classmethod
|
|
715
|
+
def get_supported_act_dtypes(cls) -> list[torch.dtype]:
|
|
716
|
+
return [torch.bfloat16, torch.half, torch.float8_e4m3fn]
|
|
717
|
+
|
|
718
|
+
@classmethod
|
|
719
|
+
def get_min_capability(cls) -> int:
|
|
720
|
+
return 80
|
|
721
|
+
|
|
722
|
+
@classmethod
|
|
723
|
+
def get_config_filenames(cls) -> list[str]:
|
|
724
|
+
return ["hf_quant_config.json"]
|
|
725
|
+
|
|
726
|
+
def apply_vllm_mapper(self, hf_to_vllm_mapper: "WeightsMapper"):
|
|
727
|
+
if self.exclude_modules is not None:
|
|
728
|
+
self.exclude_modules = hf_to_vllm_mapper.apply_list(self.exclude_modules)
|
|
729
|
+
|
|
730
|
+
@classmethod
|
|
731
|
+
def override_quantization_method(
|
|
732
|
+
cls, hf_quant_cfg, user_quant
|
|
733
|
+
) -> QuantizationMethods | None:
|
|
734
|
+
"""Detect if this ModelOpt FP4 config should be used based on
|
|
735
|
+
quantization config."""
|
|
736
|
+
if hf_quant_cfg is None:
|
|
737
|
+
return None
|
|
738
|
+
|
|
739
|
+
# Use the community standard 'quant_method'
|
|
740
|
+
quant_method = hf_quant_cfg.get("quant_method", "").lower()
|
|
741
|
+
|
|
742
|
+
# Only proceed if the method is explicitly "modelopt"
|
|
743
|
+
if quant_method != "modelopt":
|
|
744
|
+
return None
|
|
745
|
+
|
|
746
|
+
# Look for ModelOpt-specific config structure
|
|
747
|
+
if "quantization" in hf_quant_cfg:
|
|
748
|
+
quant_config = hf_quant_cfg["quantization"]
|
|
749
|
+
if isinstance(quant_config, dict):
|
|
750
|
+
quant_algo = quant_config.get("quant_algo", "")
|
|
751
|
+
if "NVFP4" in quant_algo:
|
|
752
|
+
return "modelopt_fp4"
|
|
753
|
+
else:
|
|
754
|
+
# Check for compressed-tensors style config with specific
|
|
755
|
+
# quant_algo field
|
|
756
|
+
quant_algo = hf_quant_cfg.get("quant_algo", "")
|
|
757
|
+
if isinstance(quant_algo, str) and "FP4" in quant_algo.upper():
|
|
758
|
+
return "modelopt_fp4"
|
|
759
|
+
|
|
760
|
+
return None
|
|
761
|
+
|
|
762
|
+
@classmethod
|
|
763
|
+
def from_config(cls, config: dict[str, Any]) -> "ModelOptNvFp4Config":
|
|
764
|
+
# Handle both traditional ModelOpt format and compressed-tensors
|
|
765
|
+
# style format
|
|
766
|
+
if "quantization" in config:
|
|
767
|
+
# Traditional ModelOpt format:
|
|
768
|
+
# {"quantization": {"quant_algo": "..."}}
|
|
769
|
+
quant_config = cls.get_from_keys(config, ["quantization"])
|
|
770
|
+
if not isinstance(quant_config, dict):
|
|
771
|
+
raise ValueError("Expected 'quantization' to be a dictionary in config")
|
|
772
|
+
|
|
773
|
+
quant_method = quant_config.get("quant_algo", "")
|
|
774
|
+
if not quant_method:
|
|
775
|
+
raise ValueError("Missing 'quant_algo' in quantization config")
|
|
776
|
+
|
|
777
|
+
# Handle kv_cache_quant_algo with proper type validation
|
|
778
|
+
kv_cache_quant_algo_raw = quant_config.get("kv_cache_quant_algo")
|
|
779
|
+
if kv_cache_quant_algo_raw is None:
|
|
780
|
+
# No KV cache quantization by default
|
|
781
|
+
kv_cache_quant_algo = None
|
|
782
|
+
elif isinstance(kv_cache_quant_algo_raw, str):
|
|
783
|
+
kv_cache_quant_algo = kv_cache_quant_algo_raw
|
|
784
|
+
else:
|
|
785
|
+
raise ValueError(
|
|
786
|
+
f"kv_cache_quant_algo must be a string, got "
|
|
787
|
+
f"{type(kv_cache_quant_algo_raw)}"
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
# Handle group_size with proper type validation
|
|
791
|
+
group_size_raw = quant_config.get("group_size")
|
|
792
|
+
if group_size_raw is None:
|
|
793
|
+
group_size = 16 # Default value
|
|
794
|
+
elif isinstance(group_size_raw, int):
|
|
795
|
+
group_size = group_size_raw
|
|
796
|
+
else:
|
|
797
|
+
try:
|
|
798
|
+
group_size = int(group_size_raw)
|
|
799
|
+
except (ValueError, TypeError):
|
|
800
|
+
raise ValueError(
|
|
801
|
+
f"group_size must be an integer, got {type(group_size_raw)}"
|
|
802
|
+
) from None
|
|
803
|
+
|
|
804
|
+
# "exclude_modules" is the key in the legacy hf_quant_config.json
|
|
805
|
+
exclude_modules = quant_config.get("exclude_modules", [])
|
|
806
|
+
if not isinstance(exclude_modules, list):
|
|
807
|
+
raise ValueError(
|
|
808
|
+
f"exclude_modules must be a list, got {type(exclude_modules)}"
|
|
809
|
+
)
|
|
810
|
+
else:
|
|
811
|
+
# Compressed-tensors style format:
|
|
812
|
+
# {"quant_algo": "...", "quant_method": "modelopt"}
|
|
813
|
+
quant_method = config.get("quant_algo", "")
|
|
814
|
+
|
|
815
|
+
# Handle kv_cache_quant_algo with proper type validation
|
|
816
|
+
kv_cache_quant_algo_raw = config.get("kv_cache_quant_algo")
|
|
817
|
+
if kv_cache_quant_algo_raw is None:
|
|
818
|
+
# No KV cache quantization by default
|
|
819
|
+
kv_cache_quant_algo = None
|
|
820
|
+
elif isinstance(kv_cache_quant_algo_raw, str):
|
|
821
|
+
kv_cache_quant_algo = kv_cache_quant_algo_raw
|
|
822
|
+
else:
|
|
823
|
+
raise ValueError(
|
|
824
|
+
f"kv_cache_quant_algo must be a string, got "
|
|
825
|
+
f"{type(kv_cache_quant_algo_raw)}"
|
|
826
|
+
)
|
|
827
|
+
|
|
828
|
+
# Handle group_size with proper type validation
|
|
829
|
+
group_size_raw = config.get("group_size")
|
|
830
|
+
if group_size_raw is None:
|
|
831
|
+
group_size = 16 # Default value
|
|
832
|
+
elif isinstance(group_size_raw, int):
|
|
833
|
+
group_size = group_size_raw
|
|
834
|
+
else:
|
|
835
|
+
try:
|
|
836
|
+
group_size = int(group_size_raw)
|
|
837
|
+
except (ValueError, TypeError):
|
|
838
|
+
raise ValueError(
|
|
839
|
+
f"group_size must be an integer, got {type(group_size_raw)}"
|
|
840
|
+
) from None
|
|
841
|
+
|
|
842
|
+
# "ignore" is the key in config.json
|
|
843
|
+
exclude_modules = config.get("ignore", [])
|
|
844
|
+
if not isinstance(exclude_modules, list):
|
|
845
|
+
raise ValueError(
|
|
846
|
+
f"exclude_modules must be a list, got {type(exclude_modules)}"
|
|
847
|
+
)
|
|
848
|
+
|
|
849
|
+
if quant_method not in QUANT_ALGOS:
|
|
850
|
+
raise ValueError(
|
|
851
|
+
f"ModelOpt currently only supports: {QUANT_ALGOS} "
|
|
852
|
+
"quantizations in vLLM. Please check the "
|
|
853
|
+
"`hf_quant_config.json` file for your model's "
|
|
854
|
+
"quant configuration."
|
|
855
|
+
)
|
|
856
|
+
is_checkpoint_nvfp4_serialized = "NVFP4" in quant_method
|
|
857
|
+
|
|
858
|
+
# For FP4, these fields are required
|
|
859
|
+
if is_checkpoint_nvfp4_serialized and "quantization" in config:
|
|
860
|
+
# Check if required fields are present in the quantization config
|
|
861
|
+
quant_config = config["quantization"]
|
|
862
|
+
required_fields = ["group_size", "kv_cache_quant_algo", "exclude_modules"]
|
|
863
|
+
missing_fields = [
|
|
864
|
+
field for field in required_fields if field not in quant_config
|
|
865
|
+
]
|
|
866
|
+
if missing_fields:
|
|
867
|
+
raise ValueError(
|
|
868
|
+
f"NVFP4 quantization requires the following fields in "
|
|
869
|
+
f"hf_quant_config.json: {missing_fields}"
|
|
870
|
+
)
|
|
871
|
+
|
|
872
|
+
return cls(
|
|
873
|
+
is_checkpoint_nvfp4_serialized,
|
|
874
|
+
kv_cache_quant_algo,
|
|
875
|
+
exclude_modules,
|
|
876
|
+
group_size,
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
def is_layer_excluded(self, prefix: str) -> bool:
|
|
880
|
+
"""
|
|
881
|
+
Check if a layer should be excluded from quantization.
|
|
882
|
+
Handles both exact matching (for fused layers) and pattern matching.
|
|
883
|
+
"""
|
|
884
|
+
# First check exact matching with fused layer support
|
|
885
|
+
if is_layer_skipped(prefix, self.exclude_modules, self.packed_modules_mapping):
|
|
886
|
+
return True
|
|
887
|
+
|
|
888
|
+
# Check regex pattern matching for patterns not caught by exact match
|
|
889
|
+
import regex as re
|
|
890
|
+
|
|
891
|
+
for pattern in self.exclude_modules:
|
|
892
|
+
# Skip patterns that would be caught by exact matching
|
|
893
|
+
if "*" in pattern or "." in pattern:
|
|
894
|
+
regex_str = pattern.replace(".", r"\.").replace("*", r".*")
|
|
895
|
+
if re.fullmatch(regex_str, prefix):
|
|
896
|
+
return True
|
|
897
|
+
return False
|
|
898
|
+
|
|
899
|
+
def get_quant_method(
|
|
900
|
+
self, layer: torch.nn.Module, prefix: str
|
|
901
|
+
) -> Optional["QuantizeMethodBase"]:
|
|
902
|
+
from vllm.attention.layer import ( # Avoid circular import
|
|
903
|
+
Attention,
|
|
904
|
+
MLAAttention,
|
|
905
|
+
)
|
|
906
|
+
|
|
907
|
+
skip_layer = self.is_layer_excluded(prefix)
|
|
908
|
+
if isinstance(layer, LinearBase):
|
|
909
|
+
if skip_layer:
|
|
910
|
+
return UnquantizedLinearMethod()
|
|
911
|
+
# Check if this is a vision model layer that should not be quantized
|
|
912
|
+
if "vision_tower" in prefix or "vision_model" in prefix:
|
|
913
|
+
return UnquantizedLinearMethod()
|
|
914
|
+
return ModelOptNvFp4LinearMethod(self)
|
|
915
|
+
elif isinstance(layer, (Attention, MLAAttention)):
|
|
916
|
+
return ModelOptFp8KVCacheMethod(self)
|
|
917
|
+
elif isinstance(layer, FusedMoE):
|
|
918
|
+
if skip_layer:
|
|
919
|
+
return None
|
|
920
|
+
return ModelOptNvFp4FusedMoE(self, layer.moe_config, layer)
|
|
921
|
+
return None
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
class ModelOptFp8KVCacheMethod(BaseKVCacheMethod):
|
|
925
|
+
"""
|
|
926
|
+
Supports loading kv-cache scaling factors from FP8 checkpoints.
|
|
927
|
+
"""
|
|
928
|
+
|
|
929
|
+
def __init__(self, quant_config: ModelOptFp8Config | ModelOptNvFp4Config):
|
|
930
|
+
super().__init__(quant_config)
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
class ModelOptNvFp4LinearMethod(LinearMethodBase):
|
|
934
|
+
"""Linear method for Model Optimizer NVFP4.
|
|
935
|
+
Supports loading NVFP4 checkpoints with the following structure:
|
|
936
|
+
|
|
937
|
+
input_scale: torch.float32, scalar ,
|
|
938
|
+
weight: NVFP4(represented as byte) Shape: [1, X, y/2]
|
|
939
|
+
weight_scale: FP8-E4M3, Shape: [X, Y], aka per block scale,
|
|
940
|
+
weight_scale_2: torch.float32, scalar,
|
|
941
|
+
Args: quant_config: The ModelOpt quantization config.
|
|
942
|
+
"""
|
|
943
|
+
|
|
944
|
+
def __init__(self, quant_config: ModelOptNvFp4Config) -> None:
|
|
945
|
+
self.quant_config = quant_config
|
|
946
|
+
|
|
947
|
+
self.backend = "none"
|
|
948
|
+
if envs.VLLM_NVFP4_GEMM_BACKEND is None:
|
|
949
|
+
if has_flashinfer():
|
|
950
|
+
self.backend = "flashinfer-cutlass"
|
|
951
|
+
elif cutlass_fp4_supported():
|
|
952
|
+
self.backend = "cutlass"
|
|
953
|
+
elif is_fp4_marlin_supported():
|
|
954
|
+
self.backend = "marlin"
|
|
955
|
+
elif envs.VLLM_NVFP4_GEMM_BACKEND.startswith("flashinfer-"):
|
|
956
|
+
self.backend = envs.VLLM_NVFP4_GEMM_BACKEND
|
|
957
|
+
assert has_flashinfer(), f"FlashInfer is required for {self.backend}"
|
|
958
|
+
elif envs.VLLM_NVFP4_GEMM_BACKEND == "cutlass":
|
|
959
|
+
self.backend = "cutlass"
|
|
960
|
+
assert cutlass_fp4_supported(), f"Cutlass is required for {self.backend}"
|
|
961
|
+
|
|
962
|
+
if self.backend == "none":
|
|
963
|
+
raise ValueError(
|
|
964
|
+
"No valid NVFP4 GEMM backend found. "
|
|
965
|
+
"Please check your platform capability."
|
|
966
|
+
)
|
|
967
|
+
|
|
968
|
+
logger.info_once(f"Using {self.backend} for NVFP4 GEMM")
|
|
969
|
+
|
|
970
|
+
def create_weights(
|
|
971
|
+
self,
|
|
972
|
+
layer: torch.nn.Module,
|
|
973
|
+
input_size_per_partition: int,
|
|
974
|
+
output_partition_sizes: list[int],
|
|
975
|
+
input_size: int,
|
|
976
|
+
output_size: int,
|
|
977
|
+
params_dtype: torch.dtype,
|
|
978
|
+
**extra_weight_attrs,
|
|
979
|
+
):
|
|
980
|
+
del input_size, output_size
|
|
981
|
+
if not self.quant_config.is_checkpoint_nvfp4_serialized:
|
|
982
|
+
raise ValueError(
|
|
983
|
+
"NVFP4 quantization was selected, "
|
|
984
|
+
" dynamic quantization is not supported."
|
|
985
|
+
)
|
|
986
|
+
output_size_per_partition = sum(output_partition_sizes)
|
|
987
|
+
weight_loader = extra_weight_attrs.get("weight_loader")
|
|
988
|
+
layer.logical_widths = output_partition_sizes
|
|
989
|
+
layer.input_size_per_partition = input_size_per_partition
|
|
990
|
+
layer.output_size_per_partition = output_size_per_partition
|
|
991
|
+
|
|
992
|
+
if input_size_per_partition % 16 != 0:
|
|
993
|
+
raise ValueError(
|
|
994
|
+
"Unsupported model when in features size is not multiple of 16"
|
|
995
|
+
)
|
|
996
|
+
# The nvfp4 weight is still represented as
|
|
997
|
+
weight_dtype = (
|
|
998
|
+
torch.float8_e4m3fn
|
|
999
|
+
if self.quant_config.is_checkpoint_nvfp4_serialized
|
|
1000
|
+
else params_dtype
|
|
1001
|
+
)
|
|
1002
|
+
# Weight
|
|
1003
|
+
weight = ModelWeightParameter(
|
|
1004
|
+
data=torch.empty(
|
|
1005
|
+
# 2 fp4 items are packed in the input dimension
|
|
1006
|
+
layer.output_size_per_partition,
|
|
1007
|
+
layer.input_size_per_partition // 2,
|
|
1008
|
+
dtype=torch.uint8,
|
|
1009
|
+
),
|
|
1010
|
+
input_dim=1,
|
|
1011
|
+
output_dim=0,
|
|
1012
|
+
weight_loader=weight_loader,
|
|
1013
|
+
)
|
|
1014
|
+
layer.register_parameter("weight", weight)
|
|
1015
|
+
|
|
1016
|
+
# Input Weight Scale
|
|
1017
|
+
input_scale = PerTensorScaleParameter(
|
|
1018
|
+
data=torch.empty(len(output_partition_sizes), dtype=torch.float32),
|
|
1019
|
+
weight_loader=weight_loader,
|
|
1020
|
+
)
|
|
1021
|
+
layer.register_parameter("input_scale", input_scale)
|
|
1022
|
+
|
|
1023
|
+
# Global Weight Scale
|
|
1024
|
+
weight_scale_2 = PerTensorScaleParameter(
|
|
1025
|
+
data=torch.empty(len(output_partition_sizes), dtype=torch.float32),
|
|
1026
|
+
weight_loader=weight_loader,
|
|
1027
|
+
)
|
|
1028
|
+
layer.register_parameter("weight_scale_2", weight_scale_2)
|
|
1029
|
+
|
|
1030
|
+
# Per Block Weight Scale
|
|
1031
|
+
weight_scale = ModelWeightParameter(
|
|
1032
|
+
data=torch.empty(
|
|
1033
|
+
output_size_per_partition,
|
|
1034
|
+
input_size_per_partition // self.quant_config.group_size,
|
|
1035
|
+
dtype=weight_dtype,
|
|
1036
|
+
),
|
|
1037
|
+
input_dim=1,
|
|
1038
|
+
output_dim=0,
|
|
1039
|
+
weight_loader=weight_loader,
|
|
1040
|
+
)
|
|
1041
|
+
|
|
1042
|
+
layer.register_parameter("weight_scale", weight_scale)
|
|
1043
|
+
|
|
1044
|
+
def process_weights_after_loading(self, layer: Module) -> None:
|
|
1045
|
+
# global scales:
|
|
1046
|
+
input_scale_2 = layer.input_scale.max().to(torch.float32)
|
|
1047
|
+
layer.input_scale = Parameter(input_scale_2, requires_grad=False)
|
|
1048
|
+
|
|
1049
|
+
weight_scale_2 = layer.weight_scale_2.max().to(torch.float32)
|
|
1050
|
+
layer.weight_scale_2 = Parameter(weight_scale_2, requires_grad=False)
|
|
1051
|
+
|
|
1052
|
+
layer.alpha = Parameter(
|
|
1053
|
+
layer.input_scale * layer.weight_scale_2, requires_grad=False
|
|
1054
|
+
)
|
|
1055
|
+
|
|
1056
|
+
# Calculate `1 / input_scale` so that we don't need to do so at runtime
|
|
1057
|
+
layer.input_scale_inv = Parameter(
|
|
1058
|
+
(1 / layer.input_scale).to(torch.float32), requires_grad=False
|
|
1059
|
+
)
|
|
1060
|
+
|
|
1061
|
+
# Swizzle the weight blockscale.
|
|
1062
|
+
# contracting dimension is input dimension
|
|
1063
|
+
# block_size = 16;
|
|
1064
|
+
assert layer.weight_scale.dtype == torch.float8_e4m3fn, (
|
|
1065
|
+
"Weight Block scale must be represented as FP8-E4M3"
|
|
1066
|
+
)
|
|
1067
|
+
|
|
1068
|
+
if self.backend == "marlin":
|
|
1069
|
+
prepare_fp4_layer_for_marlin(layer)
|
|
1070
|
+
del layer.alpha
|
|
1071
|
+
del layer.input_scale
|
|
1072
|
+
elif self.backend == "flashinfer-trtllm":
|
|
1073
|
+
# FlashInfer TRTLLM FP4 GEMM requires a different weight layout.
|
|
1074
|
+
# FlashInfer provides nvfp4_quantize to quantize + shuffle the
|
|
1075
|
+
# layout but we use our own quantization so we have to call
|
|
1076
|
+
# shuffles ourselves.
|
|
1077
|
+
from flashinfer import shuffle_matrix_a, shuffle_matrix_sf_a
|
|
1078
|
+
|
|
1079
|
+
weight = layer.weight.data
|
|
1080
|
+
weight_scale = layer.weight_scale.data
|
|
1081
|
+
|
|
1082
|
+
epilogue_tile_m = 128
|
|
1083
|
+
weight = shuffle_matrix_a(weight.view(torch.uint8), epilogue_tile_m)
|
|
1084
|
+
weight_scale = (
|
|
1085
|
+
shuffle_matrix_sf_a(weight_scale.view(torch.uint8), epilogue_tile_m)
|
|
1086
|
+
.reshape(weight_scale.shape)
|
|
1087
|
+
.view(torch.float8_e4m3fn)
|
|
1088
|
+
)
|
|
1089
|
+
|
|
1090
|
+
layer.weight_scale = Parameter(weight_scale, requires_grad=False)
|
|
1091
|
+
layer.weight = Parameter(weight, requires_grad=False)
|
|
1092
|
+
else:
|
|
1093
|
+
swizzled_weight_scale = swizzle_blockscale(layer.weight_scale)
|
|
1094
|
+
layer.weight_scale = Parameter(swizzled_weight_scale, requires_grad=False)
|
|
1095
|
+
layer.weight = Parameter(layer.weight.data, requires_grad=False)
|
|
1096
|
+
|
|
1097
|
+
def apply(
|
|
1098
|
+
self,
|
|
1099
|
+
layer: torch.nn.Module,
|
|
1100
|
+
x: torch.Tensor,
|
|
1101
|
+
bias: torch.Tensor | None = None,
|
|
1102
|
+
) -> torch.Tensor:
|
|
1103
|
+
if self.backend == "marlin":
|
|
1104
|
+
return apply_fp4_marlin_linear(
|
|
1105
|
+
input=x,
|
|
1106
|
+
weight=layer.weight,
|
|
1107
|
+
weight_scale=layer.weight_scale,
|
|
1108
|
+
weight_scale_2=layer.weight_scale_2,
|
|
1109
|
+
workspace=layer.workspace,
|
|
1110
|
+
size_n=layer.output_size_per_partition,
|
|
1111
|
+
size_k=layer.input_size_per_partition,
|
|
1112
|
+
bias=bias,
|
|
1113
|
+
)
|
|
1114
|
+
|
|
1115
|
+
output_dtype = x.dtype
|
|
1116
|
+
output_shape = [x.shape[0], layer.weight.shape[0]]
|
|
1117
|
+
|
|
1118
|
+
# quantize BF16 or FP16 to (FP4 and interleaved block scale)
|
|
1119
|
+
x_fp4, x_blockscale = scaled_fp4_quant(x, layer.input_scale_inv)
|
|
1120
|
+
|
|
1121
|
+
# validate dtypes of quantized input, input block scale,
|
|
1122
|
+
# weight and weight_blockscale
|
|
1123
|
+
assert x_fp4.dtype == torch.uint8
|
|
1124
|
+
assert layer.weight.dtype == torch.uint8
|
|
1125
|
+
assert x_blockscale.dtype == torch.float8_e4m3fn
|
|
1126
|
+
assert layer.weight_scale.dtype == torch.float8_e4m3fn
|
|
1127
|
+
assert layer.alpha.dtype == torch.float32
|
|
1128
|
+
|
|
1129
|
+
mm_args = (
|
|
1130
|
+
x_fp4,
|
|
1131
|
+
layer.weight,
|
|
1132
|
+
x_blockscale,
|
|
1133
|
+
layer.weight_scale,
|
|
1134
|
+
layer.alpha,
|
|
1135
|
+
output_dtype,
|
|
1136
|
+
)
|
|
1137
|
+
if self.backend.startswith("flashinfer-"):
|
|
1138
|
+
backend_name = self.backend[len("flashinfer-") :]
|
|
1139
|
+
out = flashinfer_scaled_fp4_mm(*mm_args, backend=backend_name)
|
|
1140
|
+
else:
|
|
1141
|
+
assert self.backend == "cutlass"
|
|
1142
|
+
out = cutlass_scaled_fp4_mm(*mm_args)
|
|
1143
|
+
|
|
1144
|
+
if bias is not None:
|
|
1145
|
+
out = out + bias
|
|
1146
|
+
return out.view(*output_shape)
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
class ModelOptNvFp4FusedMoE(FusedMoEMethodBase):
|
|
1150
|
+
"""
|
|
1151
|
+
MoE Method for FP4 Quantization.
|
|
1152
|
+
Args:
|
|
1153
|
+
quant_config: NVFP4 Quant Config
|
|
1154
|
+
"""
|
|
1155
|
+
|
|
1156
|
+
def __init__(
|
|
1157
|
+
self,
|
|
1158
|
+
quant_config: ModelOptNvFp4Config,
|
|
1159
|
+
moe: FusedMoEConfig,
|
|
1160
|
+
layer: torch.nn.Module,
|
|
1161
|
+
) -> None:
|
|
1162
|
+
from vllm.model_executor.layers.quantization.utils.nvfp4_moe_support import (
|
|
1163
|
+
detect_nvfp4_moe_support, # noqa: E501
|
|
1164
|
+
)
|
|
1165
|
+
|
|
1166
|
+
super().__init__(moe)
|
|
1167
|
+
self.quant_config = quant_config
|
|
1168
|
+
self.layer = layer
|
|
1169
|
+
_nvfp4 = detect_nvfp4_moe_support(self.__class__.__name__)
|
|
1170
|
+
self.cutlass_nvfp4_supported = _nvfp4.cutlass_supported
|
|
1171
|
+
self.allow_flashinfer = _nvfp4.allow_flashinfer
|
|
1172
|
+
self.use_marlin = _nvfp4.use_marlin
|
|
1173
|
+
self.flashinfer_moe_backend = None
|
|
1174
|
+
self._cache_permute_indices: dict[torch.Size, torch.Tensor] = {}
|
|
1175
|
+
if self.allow_flashinfer:
|
|
1176
|
+
self.flashinfer_moe_backend = get_flashinfer_moe_backend()
|
|
1177
|
+
logger.info_once(
|
|
1178
|
+
f"Using FlashInfer {self.flashinfer_moe_backend.value} kernels"
|
|
1179
|
+
" for ModelOptNvFp4FusedMoE."
|
|
1180
|
+
)
|
|
1181
|
+
|
|
1182
|
+
def maybe_make_prepare_finalize(self) -> mk.FusedMoEPrepareAndFinalize | None:
|
|
1183
|
+
if self.use_marlin or (
|
|
1184
|
+
self.allow_flashinfer
|
|
1185
|
+
and self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM
|
|
1186
|
+
):
|
|
1187
|
+
return None
|
|
1188
|
+
elif (
|
|
1189
|
+
self.allow_flashinfer
|
|
1190
|
+
and self.flashinfer_moe_backend == FlashinferMoeBackend.CUTLASS
|
|
1191
|
+
):
|
|
1192
|
+
# For now, fp4 moe only works with the flashinfer dispatcher.
|
|
1193
|
+
prepare_finalize = build_flashinfer_fp4_cutlass_moe_prepare_finalize(
|
|
1194
|
+
self.moe
|
|
1195
|
+
)
|
|
1196
|
+
logger.debug_once("%s", prepare_finalize.__class__.__name__)
|
|
1197
|
+
return prepare_finalize
|
|
1198
|
+
else:
|
|
1199
|
+
return super().maybe_make_prepare_finalize()
|
|
1200
|
+
|
|
1201
|
+
def select_gemm_impl(
|
|
1202
|
+
self,
|
|
1203
|
+
prepare_finalize: mk.FusedMoEPrepareAndFinalize,
|
|
1204
|
+
layer: torch.nn.Module,
|
|
1205
|
+
) -> mk.FusedMoEPermuteExpertsUnpermute:
|
|
1206
|
+
assert self.moe_quant_config is not None
|
|
1207
|
+
experts = select_nvfp4_gemm_impl(
|
|
1208
|
+
self.moe,
|
|
1209
|
+
self.moe_quant_config,
|
|
1210
|
+
allow_flashinfer=self.allow_flashinfer,
|
|
1211
|
+
)
|
|
1212
|
+
logger.debug_once("Using %s", experts.__class__.__name__)
|
|
1213
|
+
return experts
|
|
1214
|
+
|
|
1215
|
+
def uses_weight_scale_2_pattern(self) -> bool:
|
|
1216
|
+
"""
|
|
1217
|
+
FP4 variants use 'weight_scale_2' pattern for per-tensor weight scales.
|
|
1218
|
+
"""
|
|
1219
|
+
return True
|
|
1220
|
+
|
|
1221
|
+
def create_weights(
|
|
1222
|
+
self,
|
|
1223
|
+
layer: torch.nn.Module,
|
|
1224
|
+
num_experts: int,
|
|
1225
|
+
hidden_size: int,
|
|
1226
|
+
intermediate_size_per_partition: int,
|
|
1227
|
+
params_dtype: torch.dtype,
|
|
1228
|
+
**extra_weight_attrs,
|
|
1229
|
+
):
|
|
1230
|
+
if not self.quant_config.is_checkpoint_nvfp4_serialized:
|
|
1231
|
+
raise ValueError(
|
|
1232
|
+
"NVFP4 quantization was selected, "
|
|
1233
|
+
" dynamic quantization is not supported."
|
|
1234
|
+
)
|
|
1235
|
+
|
|
1236
|
+
layer.num_experts = num_experts
|
|
1237
|
+
layer.params_dtype = params_dtype
|
|
1238
|
+
layer.quant_config = self.quant_config
|
|
1239
|
+
weight_dtype = torch.uint8
|
|
1240
|
+
weight_scale_dtype = torch.float8_e4m3fn
|
|
1241
|
+
weight_loader = extra_weight_attrs.get("weight_loader")
|
|
1242
|
+
global_num_experts = extra_weight_attrs.get("global_num_experts")
|
|
1243
|
+
# GEMM 1
|
|
1244
|
+
w13_weight = ModelWeightParameter(
|
|
1245
|
+
data=torch.empty(
|
|
1246
|
+
num_experts,
|
|
1247
|
+
2 * intermediate_size_per_partition,
|
|
1248
|
+
# 2 fp4 items are packed in the input dimension
|
|
1249
|
+
hidden_size // 2,
|
|
1250
|
+
dtype=weight_dtype,
|
|
1251
|
+
),
|
|
1252
|
+
input_dim=1,
|
|
1253
|
+
output_dim=2,
|
|
1254
|
+
weight_loader=weight_loader,
|
|
1255
|
+
)
|
|
1256
|
+
layer.register_parameter("w13_weight", w13_weight)
|
|
1257
|
+
|
|
1258
|
+
# GEMM 2
|
|
1259
|
+
w2_weight = ModelWeightParameter(
|
|
1260
|
+
data=torch.empty(
|
|
1261
|
+
num_experts,
|
|
1262
|
+
hidden_size,
|
|
1263
|
+
# 2 fp4 items are packed in the input dimension
|
|
1264
|
+
intermediate_size_per_partition // 2,
|
|
1265
|
+
dtype=weight_dtype,
|
|
1266
|
+
),
|
|
1267
|
+
input_dim=1,
|
|
1268
|
+
output_dim=2,
|
|
1269
|
+
weight_loader=weight_loader,
|
|
1270
|
+
)
|
|
1271
|
+
layer.register_parameter("w2_weight", w2_weight)
|
|
1272
|
+
|
|
1273
|
+
w13_weight_scale = ModelWeightParameter(
|
|
1274
|
+
data=torch.empty(
|
|
1275
|
+
num_experts,
|
|
1276
|
+
2 * intermediate_size_per_partition,
|
|
1277
|
+
# 2 fp4 items are packed in the input dimension
|
|
1278
|
+
hidden_size // self.quant_config.group_size,
|
|
1279
|
+
dtype=weight_scale_dtype,
|
|
1280
|
+
),
|
|
1281
|
+
input_dim=1,
|
|
1282
|
+
output_dim=2,
|
|
1283
|
+
weight_loader=weight_loader,
|
|
1284
|
+
)
|
|
1285
|
+
layer.register_parameter("w13_weight_scale", w13_weight_scale)
|
|
1286
|
+
|
|
1287
|
+
w2_weight_scale = ModelWeightParameter(
|
|
1288
|
+
data=torch.empty(
|
|
1289
|
+
num_experts,
|
|
1290
|
+
hidden_size,
|
|
1291
|
+
# 2 fp4 items are packed in the input dimension
|
|
1292
|
+
intermediate_size_per_partition // self.quant_config.group_size,
|
|
1293
|
+
dtype=weight_scale_dtype,
|
|
1294
|
+
),
|
|
1295
|
+
input_dim=1,
|
|
1296
|
+
output_dim=2,
|
|
1297
|
+
weight_loader=weight_loader,
|
|
1298
|
+
)
|
|
1299
|
+
layer.register_parameter("w2_weight_scale", w2_weight_scale)
|
|
1300
|
+
|
|
1301
|
+
extra_weight_attrs.update(
|
|
1302
|
+
{"quant_method": FusedMoeWeightScaleSupported.BLOCK.value}
|
|
1303
|
+
)
|
|
1304
|
+
|
|
1305
|
+
w13_weight_scale_2 = PerTensorScaleParameter(
|
|
1306
|
+
data=torch.empty(num_experts, 2, dtype=torch.float32),
|
|
1307
|
+
weight_loader=weight_loader,
|
|
1308
|
+
)
|
|
1309
|
+
layer.register_parameter("w13_weight_scale_2", w13_weight_scale_2)
|
|
1310
|
+
|
|
1311
|
+
w2_weight_scale_2 = PerTensorScaleParameter(
|
|
1312
|
+
data=torch.empty(num_experts, dtype=torch.float32),
|
|
1313
|
+
weight_loader=weight_loader,
|
|
1314
|
+
)
|
|
1315
|
+
layer.register_parameter("w2_weight_scale_2", w2_weight_scale_2)
|
|
1316
|
+
|
|
1317
|
+
extra_weight_attrs.update(
|
|
1318
|
+
{"quant_method": FusedMoeWeightScaleSupported.TENSOR.value}
|
|
1319
|
+
)
|
|
1320
|
+
|
|
1321
|
+
use_global_sf = self.allow_flashinfer and is_flashinfer_supporting_global_sf(
|
|
1322
|
+
self.flashinfer_moe_backend
|
|
1323
|
+
)
|
|
1324
|
+
global_scale_num_experts = global_num_experts if use_global_sf else num_experts
|
|
1325
|
+
|
|
1326
|
+
w13_input_scale = PerTensorScaleParameter(
|
|
1327
|
+
data=torch.empty(global_scale_num_experts, 2, dtype=torch.float32),
|
|
1328
|
+
weight_loader=weight_loader,
|
|
1329
|
+
)
|
|
1330
|
+
layer.register_parameter("w13_input_scale", w13_input_scale)
|
|
1331
|
+
|
|
1332
|
+
w2_input_scale = PerTensorScaleParameter(
|
|
1333
|
+
data=torch.empty(global_scale_num_experts, dtype=torch.float32),
|
|
1334
|
+
weight_loader=weight_loader,
|
|
1335
|
+
)
|
|
1336
|
+
layer.register_parameter("w2_input_scale", w2_input_scale)
|
|
1337
|
+
|
|
1338
|
+
def prepare_static_weights_for_trtllm_fp4_moe(
|
|
1339
|
+
self,
|
|
1340
|
+
# args_dequant,
|
|
1341
|
+
# args,
|
|
1342
|
+
gemm1_weights,
|
|
1343
|
+
gemm2_weights,
|
|
1344
|
+
gemm1_scales_linear_fp4_bytes,
|
|
1345
|
+
gemm2_scales_linear_fp4_bytes,
|
|
1346
|
+
hidden_size,
|
|
1347
|
+
intermediate_size,
|
|
1348
|
+
num_experts,
|
|
1349
|
+
):
|
|
1350
|
+
from flashinfer import nvfp4_block_scale_interleave
|
|
1351
|
+
from flashinfer.fused_moe.core import (
|
|
1352
|
+
_maybe_get_cached_w3_w1_permute_indices,
|
|
1353
|
+
get_w2_permute_indices_with_cache,
|
|
1354
|
+
)
|
|
1355
|
+
|
|
1356
|
+
"""Prepare quantized weights for kernel (done offline with weights)."""
|
|
1357
|
+
epilogue_tile_m = 128 # FIXME: this depends on the kernel internals
|
|
1358
|
+
|
|
1359
|
+
# Convert quantized weights to proper formats
|
|
1360
|
+
gemm1_weights_fp4 = gemm1_weights.view(torch.float8_e4m3fn).reshape(
|
|
1361
|
+
num_experts, 2 * intermediate_size, hidden_size // 2
|
|
1362
|
+
) # packed fp4
|
|
1363
|
+
gemm1_scales_linear_fp4 = gemm1_scales_linear_fp4_bytes.view(
|
|
1364
|
+
torch.float8_e4m3fn
|
|
1365
|
+
).reshape(
|
|
1366
|
+
num_experts, 2 * intermediate_size, hidden_size // 16
|
|
1367
|
+
) # fp8 scaling factors
|
|
1368
|
+
|
|
1369
|
+
gemm2_weights_fp4 = gemm2_weights.view(torch.float8_e4m3fn).reshape(
|
|
1370
|
+
num_experts, hidden_size, intermediate_size // 2
|
|
1371
|
+
) # packed fp4
|
|
1372
|
+
gemm2_scales_linear_fp4 = gemm2_scales_linear_fp4_bytes.view(
|
|
1373
|
+
torch.float8_e4m3fn
|
|
1374
|
+
).reshape(
|
|
1375
|
+
num_experts, hidden_size, intermediate_size // 16
|
|
1376
|
+
) # fp8 scaling factors
|
|
1377
|
+
|
|
1378
|
+
gemm1_weights_fp4_shuffled = []
|
|
1379
|
+
gemm1_scales_fp4_shuffled = []
|
|
1380
|
+
gemm2_weights_fp4_shuffled = []
|
|
1381
|
+
gemm2_scales_fp4_shuffled = []
|
|
1382
|
+
for i in range(num_experts):
|
|
1383
|
+
# Calculate the permute indices for the following:
|
|
1384
|
+
# 1. Reorder rows of W1 and scales for fused gated activation
|
|
1385
|
+
# 2. Shuffle weights and scaling factors for transposed mma output
|
|
1386
|
+
# for both w3_w1 and w2 weights and scale factors
|
|
1387
|
+
permute_indices = _maybe_get_cached_w3_w1_permute_indices(
|
|
1388
|
+
self._cache_permute_indices,
|
|
1389
|
+
gemm1_weights_fp4[i].view(torch.uint8),
|
|
1390
|
+
epilogue_tile_m,
|
|
1391
|
+
)
|
|
1392
|
+
gemm1_weights_fp4_shuffled.append(
|
|
1393
|
+
gemm1_weights_fp4[i]
|
|
1394
|
+
.view(torch.uint8)[permute_indices.to(gemm1_weights_fp4.device)]
|
|
1395
|
+
.contiguous()
|
|
1396
|
+
)
|
|
1397
|
+
|
|
1398
|
+
permute_sf_indices = _maybe_get_cached_w3_w1_permute_indices(
|
|
1399
|
+
self._cache_permute_indices,
|
|
1400
|
+
gemm1_scales_linear_fp4[i].view(torch.uint8),
|
|
1401
|
+
epilogue_tile_m,
|
|
1402
|
+
num_elts_per_sf=16,
|
|
1403
|
+
)
|
|
1404
|
+
gemm1_scales_fp4_shuffled.append(
|
|
1405
|
+
nvfp4_block_scale_interleave(
|
|
1406
|
+
gemm1_scales_linear_fp4[i]
|
|
1407
|
+
.view(torch.uint8)[
|
|
1408
|
+
permute_sf_indices.to(gemm1_scales_linear_fp4.device)
|
|
1409
|
+
]
|
|
1410
|
+
.contiguous()
|
|
1411
|
+
)
|
|
1412
|
+
)
|
|
1413
|
+
|
|
1414
|
+
permute_indices = get_w2_permute_indices_with_cache(
|
|
1415
|
+
self._cache_permute_indices,
|
|
1416
|
+
gemm2_weights_fp4[i].view(torch.uint8),
|
|
1417
|
+
epilogue_tile_m,
|
|
1418
|
+
)
|
|
1419
|
+
gemm2_weights_fp4_shuffled.append(
|
|
1420
|
+
gemm2_weights_fp4[i]
|
|
1421
|
+
.view(torch.uint8)[permute_indices.to(gemm2_weights_fp4.device)]
|
|
1422
|
+
.contiguous()
|
|
1423
|
+
)
|
|
1424
|
+
|
|
1425
|
+
permute_sf_indices = get_w2_permute_indices_with_cache(
|
|
1426
|
+
self._cache_permute_indices,
|
|
1427
|
+
gemm2_scales_linear_fp4[i].view(torch.uint8),
|
|
1428
|
+
epilogue_tile_m,
|
|
1429
|
+
num_elts_per_sf=16,
|
|
1430
|
+
)
|
|
1431
|
+
gemm2_scales_fp4_shuffled.append(
|
|
1432
|
+
nvfp4_block_scale_interleave(
|
|
1433
|
+
gemm2_scales_linear_fp4[i]
|
|
1434
|
+
.view(torch.uint8)[
|
|
1435
|
+
permute_sf_indices.to(gemm2_scales_linear_fp4.device)
|
|
1436
|
+
]
|
|
1437
|
+
.contiguous()
|
|
1438
|
+
)
|
|
1439
|
+
)
|
|
1440
|
+
|
|
1441
|
+
# Stack weights for all experts
|
|
1442
|
+
gemm1_weights_fp4_shuffled = torch.stack(gemm1_weights_fp4_shuffled)
|
|
1443
|
+
gemm1_scales_fp4_shuffled = (
|
|
1444
|
+
torch.stack(gemm1_scales_fp4_shuffled)
|
|
1445
|
+
.view(torch.float8_e4m3fn)
|
|
1446
|
+
.reshape(num_experts, 2 * intermediate_size, hidden_size // 16)
|
|
1447
|
+
)
|
|
1448
|
+
|
|
1449
|
+
gemm2_weights_fp4_shuffled = torch.stack(gemm2_weights_fp4_shuffled)
|
|
1450
|
+
gemm2_scales_fp4_shuffled = (
|
|
1451
|
+
torch.stack(gemm2_scales_fp4_shuffled)
|
|
1452
|
+
.view(torch.float8_e4m3fn)
|
|
1453
|
+
.reshape(num_experts, hidden_size, intermediate_size // 16)
|
|
1454
|
+
)
|
|
1455
|
+
return (
|
|
1456
|
+
gemm1_weights_fp4_shuffled,
|
|
1457
|
+
gemm1_scales_fp4_shuffled,
|
|
1458
|
+
gemm2_weights_fp4_shuffled,
|
|
1459
|
+
gemm2_scales_fp4_shuffled,
|
|
1460
|
+
)
|
|
1461
|
+
|
|
1462
|
+
def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
|
|
1463
|
+
# GEMM 1 processing
|
|
1464
|
+
gemm1_weight = layer.w13_weight.data
|
|
1465
|
+
gemm1_weight_scale = layer.w13_weight_scale.data
|
|
1466
|
+
|
|
1467
|
+
if self.allow_flashinfer:
|
|
1468
|
+
gemm1_weight, gemm1_weight_scale = reorder_w1w3_to_w3w1(
|
|
1469
|
+
gemm1_weight, gemm1_weight_scale, dim=-2
|
|
1470
|
+
)
|
|
1471
|
+
|
|
1472
|
+
layer.w13_weight = Parameter(gemm1_weight, requires_grad=False)
|
|
1473
|
+
layer.w13_weight_scale = Parameter(gemm1_weight_scale, requires_grad=False)
|
|
1474
|
+
|
|
1475
|
+
# Common processing for w13_weight_scale_2
|
|
1476
|
+
if not torch.allclose(
|
|
1477
|
+
layer.w13_weight_scale_2[:, 0], layer.w13_weight_scale_2[:, 1]
|
|
1478
|
+
):
|
|
1479
|
+
logger.warning_once(
|
|
1480
|
+
"w1_weight_scale_2 must match w3_weight_scale_2. "
|
|
1481
|
+
"Accuracy may be affected."
|
|
1482
|
+
)
|
|
1483
|
+
|
|
1484
|
+
w13_weight_scale_2 = layer.w13_weight_scale_2[:, 0]
|
|
1485
|
+
layer.w13_weight_scale_2 = Parameter(w13_weight_scale_2, requires_grad=False)
|
|
1486
|
+
|
|
1487
|
+
# Common processing for input scales and alphas
|
|
1488
|
+
use_global_sf = self.allow_flashinfer and is_flashinfer_supporting_global_sf(
|
|
1489
|
+
self.flashinfer_moe_backend
|
|
1490
|
+
)
|
|
1491
|
+
if use_global_sf:
|
|
1492
|
+
# For backends provide by Flashinfer, the input global scales are
|
|
1493
|
+
# shared across all experts.
|
|
1494
|
+
w13_input_scale = (
|
|
1495
|
+
layer.w13_input_scale.max().to(torch.float32).expand(layer.num_experts)
|
|
1496
|
+
)
|
|
1497
|
+
else:
|
|
1498
|
+
w13_input_scale = layer.w13_input_scale.max(dim=1).values.to(torch.float32)
|
|
1499
|
+
layer.g1_alphas = Parameter(
|
|
1500
|
+
(w13_input_scale * w13_weight_scale_2).to(torch.float32),
|
|
1501
|
+
requires_grad=False,
|
|
1502
|
+
)
|
|
1503
|
+
|
|
1504
|
+
# This is for quantization, so we need to invert it.
|
|
1505
|
+
layer.w13_input_scale_quant = Parameter(
|
|
1506
|
+
(1 / w13_input_scale).to(torch.float32), requires_grad=False
|
|
1507
|
+
)
|
|
1508
|
+
|
|
1509
|
+
# GEMM 2 processing
|
|
1510
|
+
if use_global_sf:
|
|
1511
|
+
# For backends provide by Flashinfer, the input global scales are
|
|
1512
|
+
# shared across all experts.
|
|
1513
|
+
w2_input_scale = (
|
|
1514
|
+
layer.w2_input_scale.max().to(torch.float32).expand(layer.num_experts)
|
|
1515
|
+
)
|
|
1516
|
+
else:
|
|
1517
|
+
w2_input_scale = layer.w2_input_scale
|
|
1518
|
+
layer.g2_alphas = Parameter(
|
|
1519
|
+
(w2_input_scale * layer.w2_weight_scale_2).to(torch.float32),
|
|
1520
|
+
requires_grad=False,
|
|
1521
|
+
)
|
|
1522
|
+
|
|
1523
|
+
# This is for quantization, so we need to invert it.
|
|
1524
|
+
layer.w2_input_scale_quant = Parameter(
|
|
1525
|
+
(1 / w2_input_scale).to(torch.float32), requires_grad=False
|
|
1526
|
+
)
|
|
1527
|
+
|
|
1528
|
+
# TensorRT-LLM specific processing
|
|
1529
|
+
if (
|
|
1530
|
+
self.allow_flashinfer
|
|
1531
|
+
and self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM
|
|
1532
|
+
):
|
|
1533
|
+
# Prepare static weights for TRT-LLM kernel
|
|
1534
|
+
# alternate: prepare_static_weight_layouts_for_trtllm_moe
|
|
1535
|
+
(
|
|
1536
|
+
gemm1_weights_fp4_shuffled,
|
|
1537
|
+
gemm1_scales_fp4_shuffled,
|
|
1538
|
+
gemm2_weights_fp4_shuffled,
|
|
1539
|
+
gemm2_scales_fp4_shuffled,
|
|
1540
|
+
) = self.prepare_static_weights_for_trtllm_fp4_moe(
|
|
1541
|
+
layer.w13_weight,
|
|
1542
|
+
layer.w2_weight,
|
|
1543
|
+
layer.w13_weight_scale,
|
|
1544
|
+
layer.w2_weight_scale,
|
|
1545
|
+
layer.w2_weight.size(-2), # hidden_size
|
|
1546
|
+
layer.w13_weight.size(-2) // 2, # intermediate_size
|
|
1547
|
+
layer.w13_weight.size(0), # num_experts
|
|
1548
|
+
)
|
|
1549
|
+
logger.debug_once("Finished shuffling weights for TRT-LLM MOE")
|
|
1550
|
+
|
|
1551
|
+
layer.gemm1_weights_fp4_shuffled = Parameter(
|
|
1552
|
+
gemm1_weights_fp4_shuffled, requires_grad=False
|
|
1553
|
+
)
|
|
1554
|
+
layer.gemm2_weights_fp4_shuffled = Parameter(
|
|
1555
|
+
gemm2_weights_fp4_shuffled, requires_grad=False
|
|
1556
|
+
)
|
|
1557
|
+
layer.gemm1_scales_fp4_shuffled = Parameter(
|
|
1558
|
+
gemm1_scales_fp4_shuffled, requires_grad=False
|
|
1559
|
+
)
|
|
1560
|
+
layer.gemm2_scales_fp4_shuffled = Parameter(
|
|
1561
|
+
gemm2_scales_fp4_shuffled, requires_grad=False
|
|
1562
|
+
)
|
|
1563
|
+
|
|
1564
|
+
# Additional parameter needed for TRT-LLM
|
|
1565
|
+
layer.g1_scale_c = Parameter(
|
|
1566
|
+
(layer.w2_input_scale_quant * layer.g1_alphas).to(torch.float32),
|
|
1567
|
+
requires_grad=False,
|
|
1568
|
+
)
|
|
1569
|
+
|
|
1570
|
+
# Clean up weights that won't be used by TRT-LLM
|
|
1571
|
+
del layer.w2_weight
|
|
1572
|
+
del layer.w2_weight_scale
|
|
1573
|
+
del layer.w13_weight
|
|
1574
|
+
del layer.w13_weight_scale
|
|
1575
|
+
elif self.use_marlin:
|
|
1576
|
+
# Marlin processing
|
|
1577
|
+
prepare_moe_fp4_layer_for_marlin(layer)
|
|
1578
|
+
del layer.g1_alphas
|
|
1579
|
+
del layer.g2_alphas
|
|
1580
|
+
del layer.w13_input_scale_quant
|
|
1581
|
+
del layer.w2_input_scale_quant
|
|
1582
|
+
else:
|
|
1583
|
+
# Non-TRT-LLM processing (Cutlass or non-flashinfer)
|
|
1584
|
+
w13_blockscale_swizzled = swizzle_blockscale(layer.w13_weight_scale)
|
|
1585
|
+
layer.w13_weight_scale = Parameter(
|
|
1586
|
+
w13_blockscale_swizzled, requires_grad=False
|
|
1587
|
+
)
|
|
1588
|
+
|
|
1589
|
+
w2_blockscale_swizzled = swizzle_blockscale(layer.w2_weight_scale)
|
|
1590
|
+
layer.w2_weight_scale = Parameter(
|
|
1591
|
+
w2_blockscale_swizzled, requires_grad=False
|
|
1592
|
+
)
|
|
1593
|
+
layer.w2_weight = Parameter(layer.w2_weight.data, requires_grad=False)
|
|
1594
|
+
|
|
1595
|
+
def get_fused_moe_quant_config(
|
|
1596
|
+
self, layer: torch.nn.Module
|
|
1597
|
+
) -> FusedMoEQuantConfig | None:
|
|
1598
|
+
if (
|
|
1599
|
+
self.use_marlin
|
|
1600
|
+
or self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM
|
|
1601
|
+
):
|
|
1602
|
+
return None
|
|
1603
|
+
|
|
1604
|
+
return nvfp4_moe_quant_config(
|
|
1605
|
+
w1_scale=layer.w13_weight_scale,
|
|
1606
|
+
w2_scale=layer.w2_weight_scale,
|
|
1607
|
+
g1_alphas=layer.g1_alphas,
|
|
1608
|
+
g2_alphas=layer.g2_alphas,
|
|
1609
|
+
a1_gscale=layer.w13_input_scale_quant,
|
|
1610
|
+
a2_gscale=layer.w2_input_scale_quant,
|
|
1611
|
+
)
|
|
1612
|
+
|
|
1613
|
+
def apply(
|
|
1614
|
+
self,
|
|
1615
|
+
layer: torch.nn.Module,
|
|
1616
|
+
x: torch.Tensor,
|
|
1617
|
+
router_logits: torch.Tensor,
|
|
1618
|
+
top_k: int,
|
|
1619
|
+
renormalize: bool,
|
|
1620
|
+
use_grouped_topk: bool = False,
|
|
1621
|
+
topk_group: int | None = None,
|
|
1622
|
+
num_expert_group: int | None = None,
|
|
1623
|
+
global_num_experts: int = -1,
|
|
1624
|
+
expert_map: torch.Tensor | None = None,
|
|
1625
|
+
custom_routing_function: Callable | None = None,
|
|
1626
|
+
scoring_func: str = "softmax",
|
|
1627
|
+
routed_scaling_factor: float = 1.0,
|
|
1628
|
+
e_score_correction_bias: torch.Tensor | None = None,
|
|
1629
|
+
apply_router_weight_on_input: bool = False,
|
|
1630
|
+
activation: str = "silu",
|
|
1631
|
+
enable_eplb: bool = False,
|
|
1632
|
+
expert_load_view: torch.Tensor | None = None,
|
|
1633
|
+
logical_to_physical_map: torch.Tensor | None = None,
|
|
1634
|
+
logical_replica_count: torch.Tensor | None = None,
|
|
1635
|
+
) -> torch.Tensor | tuple[torch.Tensor, torch.Tensor]:
|
|
1636
|
+
if enable_eplb:
|
|
1637
|
+
raise NotImplementedError(
|
|
1638
|
+
"EPLB not supported for `ModelOptNvFp4FusedMoE` yet."
|
|
1639
|
+
)
|
|
1640
|
+
assert activation == "silu", "Only SiLU activation is supported."
|
|
1641
|
+
|
|
1642
|
+
if (
|
|
1643
|
+
self.allow_flashinfer
|
|
1644
|
+
and self.flashinfer_moe_backend == FlashinferMoeBackend.TENSORRT_LLM
|
|
1645
|
+
):
|
|
1646
|
+
import flashinfer
|
|
1647
|
+
|
|
1648
|
+
from vllm.model_executor.models.llama4 import Llama4MoE
|
|
1649
|
+
|
|
1650
|
+
a1_gscale = layer.w13_input_scale_quant
|
|
1651
|
+
(hidden_states_fp4, hidden_states_scale_linear_fp4) = (
|
|
1652
|
+
flashinfer.fp4_quantize(
|
|
1653
|
+
x,
|
|
1654
|
+
a1_gscale,
|
|
1655
|
+
is_sf_swizzled_layout=False,
|
|
1656
|
+
)
|
|
1657
|
+
)
|
|
1658
|
+
use_llama4_routing = (
|
|
1659
|
+
custom_routing_function is Llama4MoE.custom_routing_function
|
|
1660
|
+
)
|
|
1661
|
+
routing_method_type = layer.routing_method_type
|
|
1662
|
+
if use_llama4_routing:
|
|
1663
|
+
routing_method_type = RoutingMethodType.Llama4
|
|
1664
|
+
router_logits = (
|
|
1665
|
+
router_logits.to(torch.float32)
|
|
1666
|
+
if routing_method_type == RoutingMethodType.DeepSeekV3
|
|
1667
|
+
else router_logits
|
|
1668
|
+
)
|
|
1669
|
+
routing_bias = e_score_correction_bias
|
|
1670
|
+
if routing_bias is not None:
|
|
1671
|
+
routing_bias = routing_bias.to(torch.bfloat16)
|
|
1672
|
+
out = flashinfer.fused_moe.trtllm_fp4_block_scale_moe(
|
|
1673
|
+
routing_logits=router_logits,
|
|
1674
|
+
routing_bias=routing_bias,
|
|
1675
|
+
hidden_states=hidden_states_fp4,
|
|
1676
|
+
hidden_states_scale=hidden_states_scale_linear_fp4.view(
|
|
1677
|
+
torch.float8_e4m3fn
|
|
1678
|
+
).flatten(),
|
|
1679
|
+
gemm1_weights=layer.gemm1_weights_fp4_shuffled.data,
|
|
1680
|
+
gemm1_weights_scale=layer.gemm1_scales_fp4_shuffled.data.view(
|
|
1681
|
+
torch.float8_e4m3fn
|
|
1682
|
+
),
|
|
1683
|
+
gemm1_bias=None,
|
|
1684
|
+
gemm1_alpha=None,
|
|
1685
|
+
gemm1_beta=None,
|
|
1686
|
+
gemm1_clamp_limit=None,
|
|
1687
|
+
gemm2_weights=layer.gemm2_weights_fp4_shuffled.data,
|
|
1688
|
+
gemm2_weights_scale=layer.gemm2_scales_fp4_shuffled.data.view(
|
|
1689
|
+
torch.float8_e4m3fn
|
|
1690
|
+
),
|
|
1691
|
+
gemm2_bias=None,
|
|
1692
|
+
output1_scale_scalar=layer.g1_scale_c.data,
|
|
1693
|
+
output1_scale_gate_scalar=layer.g1_alphas.data,
|
|
1694
|
+
output2_scale_scalar=layer.g2_alphas.data,
|
|
1695
|
+
num_experts=global_num_experts,
|
|
1696
|
+
top_k=top_k,
|
|
1697
|
+
n_group=num_expert_group,
|
|
1698
|
+
topk_group=topk_group,
|
|
1699
|
+
intermediate_size=layer.intermediate_size_per_partition,
|
|
1700
|
+
local_expert_offset=layer.ep_rank * layer.local_num_experts,
|
|
1701
|
+
local_num_experts=layer.local_num_experts,
|
|
1702
|
+
routed_scaling_factor=None,
|
|
1703
|
+
tile_tokens_dim=None,
|
|
1704
|
+
routing_method_type=routing_method_type,
|
|
1705
|
+
do_finalize=True,
|
|
1706
|
+
)[0]
|
|
1707
|
+
return out
|
|
1708
|
+
|
|
1709
|
+
topk_weights, topk_ids, _ = FusedMoE.select_experts(
|
|
1710
|
+
hidden_states=x,
|
|
1711
|
+
router_logits=router_logits,
|
|
1712
|
+
use_grouped_topk=use_grouped_topk,
|
|
1713
|
+
top_k=top_k,
|
|
1714
|
+
renormalize=renormalize,
|
|
1715
|
+
topk_group=topk_group,
|
|
1716
|
+
num_expert_group=num_expert_group,
|
|
1717
|
+
custom_routing_function=custom_routing_function,
|
|
1718
|
+
scoring_func=scoring_func,
|
|
1719
|
+
routed_scaling_factor=routed_scaling_factor,
|
|
1720
|
+
e_score_correction_bias=e_score_correction_bias,
|
|
1721
|
+
indices_type=self.topk_indices_dtype,
|
|
1722
|
+
)
|
|
1723
|
+
|
|
1724
|
+
if self.use_marlin:
|
|
1725
|
+
return fused_marlin_moe(
|
|
1726
|
+
x,
|
|
1727
|
+
layer.w13_weight,
|
|
1728
|
+
layer.w2_weight,
|
|
1729
|
+
None,
|
|
1730
|
+
None,
|
|
1731
|
+
layer.w13_weight_scale,
|
|
1732
|
+
layer.w2_weight_scale,
|
|
1733
|
+
router_logits,
|
|
1734
|
+
topk_weights,
|
|
1735
|
+
topk_ids,
|
|
1736
|
+
global_scale1=layer.w13_weight_scale_2,
|
|
1737
|
+
global_scale2=layer.w2_weight_scale_2,
|
|
1738
|
+
quant_type_id=scalar_types.float4_e2m1f.id,
|
|
1739
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
1740
|
+
global_num_experts=global_num_experts,
|
|
1741
|
+
expert_map=expert_map,
|
|
1742
|
+
workspace=layer.workspace,
|
|
1743
|
+
)
|
|
1744
|
+
|
|
1745
|
+
elif (
|
|
1746
|
+
self.allow_flashinfer
|
|
1747
|
+
and self.flashinfer_moe_backend == FlashinferMoeBackend.CUTLASS
|
|
1748
|
+
):
|
|
1749
|
+
from vllm.model_executor.layers.fused_moe.flashinfer_cutlass_moe import ( # noqa: E501
|
|
1750
|
+
flashinfer_cutlass_moe_fp4,
|
|
1751
|
+
)
|
|
1752
|
+
|
|
1753
|
+
assert self.moe_quant_config is not None
|
|
1754
|
+
|
|
1755
|
+
return flashinfer_cutlass_moe_fp4(
|
|
1756
|
+
hidden_states=x,
|
|
1757
|
+
w1=layer.w13_weight,
|
|
1758
|
+
w2=layer.w2_weight,
|
|
1759
|
+
topk_weights=topk_weights,
|
|
1760
|
+
topk_ids=topk_ids,
|
|
1761
|
+
quant_config=self.moe_quant_config,
|
|
1762
|
+
inplace=False,
|
|
1763
|
+
activation=activation,
|
|
1764
|
+
global_num_experts=global_num_experts,
|
|
1765
|
+
expert_map=expert_map,
|
|
1766
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
1767
|
+
)
|
|
1768
|
+
else:
|
|
1769
|
+
# If no modular kernel is provided, use cutlass_moe_fp4 for TP case
|
|
1770
|
+
# only (no EP).
|
|
1771
|
+
from vllm.model_executor.layers.fused_moe.cutlass_moe import cutlass_moe_fp4
|
|
1772
|
+
|
|
1773
|
+
assert self.moe_quant_config is not None
|
|
1774
|
+
return cutlass_moe_fp4(
|
|
1775
|
+
a=x,
|
|
1776
|
+
w1_fp4=layer.w13_weight,
|
|
1777
|
+
w2_fp4=layer.w2_weight,
|
|
1778
|
+
topk_weights=topk_weights,
|
|
1779
|
+
topk_ids=topk_ids,
|
|
1780
|
+
quant_config=self.moe_quant_config,
|
|
1781
|
+
expert_map=expert_map,
|
|
1782
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
1783
|
+
# TODO: derive from arguments
|
|
1784
|
+
m=x.shape[0],
|
|
1785
|
+
n=layer.w2_weight.shape[2] * 2,
|
|
1786
|
+
k=x.shape[1],
|
|
1787
|
+
e=layer.w13_weight.shape[0],
|
|
1788
|
+
)
|