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