vllm-cpu-amxbf16 0.9.1__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 +53 -0
- vllm/_custom_ops.py +1828 -0
- vllm/_ipex_ops.py +244 -0
- vllm/_version.py +34 -0
- vllm/adapter_commons/__init__.py +0 -0
- vllm/adapter_commons/layers.py +16 -0
- vllm/adapter_commons/models.py +106 -0
- vllm/adapter_commons/request.py +26 -0
- vllm/adapter_commons/utils.py +93 -0
- vllm/adapter_commons/worker_manager.py +39 -0
- vllm/assets/__init__.py +0 -0
- vllm/assets/audio.py +45 -0
- vllm/assets/base.py +41 -0
- vllm/assets/image.py +34 -0
- vllm/assets/video.py +115 -0
- vllm/attention/__init__.py +20 -0
- vllm/attention/backends/__init__.py +0 -0
- vllm/attention/backends/abstract.py +308 -0
- vllm/attention/backends/blocksparse_attn.py +461 -0
- vllm/attention/backends/cpu_mla.py +307 -0
- vllm/attention/backends/dual_chunk_flash_attn.py +1498 -0
- vllm/attention/backends/flash_attn.py +1003 -0
- vllm/attention/backends/flashinfer.py +1104 -0
- vllm/attention/backends/flashmla.py +244 -0
- vllm/attention/backends/hpu_attn.py +313 -0
- vllm/attention/backends/ipex_attn.py +398 -0
- vllm/attention/backends/mla/__init__.py +0 -0
- vllm/attention/backends/mla/common.py +1385 -0
- vllm/attention/backends/pallas.py +351 -0
- vllm/attention/backends/placeholder_attn.py +400 -0
- vllm/attention/backends/rocm_aiter_mla.py +435 -0
- vllm/attention/backends/rocm_flash_attn.py +975 -0
- vllm/attention/backends/torch_sdpa.py +703 -0
- vllm/attention/backends/triton_mla.py +115 -0
- vllm/attention/backends/utils.py +610 -0
- vllm/attention/backends/xformers.py +802 -0
- vllm/attention/layer.py +468 -0
- vllm/attention/ops/__init__.py +0 -0
- vllm/attention/ops/blocksparse_attention/__init__.py +0 -0
- vllm/attention/ops/blocksparse_attention/blocksparse_attention_kernel.py +433 -0
- vllm/attention/ops/blocksparse_attention/interface.py +239 -0
- vllm/attention/ops/blocksparse_attention/utils.py +246 -0
- vllm/attention/ops/chunked_prefill_paged_decode.py +368 -0
- vllm/attention/ops/flashmla.py +116 -0
- vllm/attention/ops/hpu_paged_attn.py +88 -0
- vllm/attention/ops/ipex_attn.py +195 -0
- vllm/attention/ops/merge_attn_states.py +43 -0
- vllm/attention/ops/nki_flash_attn.py +906 -0
- vllm/attention/ops/paged_attn.py +256 -0
- vllm/attention/ops/prefix_prefill.py +902 -0
- vllm/attention/ops/rocm_aiter_mla.py +100 -0
- vllm/attention/ops/rocm_aiter_paged_attn.py +102 -0
- vllm/attention/ops/triton_decode_attention.py +674 -0
- vllm/attention/ops/triton_flash_attention.py +979 -0
- vllm/attention/ops/triton_merge_attn_states.py +97 -0
- vllm/attention/ops/triton_unified_attention.py +334 -0
- vllm/attention/selector.py +187 -0
- vllm/attention/utils/fa_utils.py +55 -0
- vllm/beam_search.py +87 -0
- vllm/benchmarks/__init__.py +0 -0
- vllm/benchmarks/datasets.py +1185 -0
- vllm/benchmarks/endpoint_request_func.py +381 -0
- vllm/benchmarks/latency.py +168 -0
- vllm/benchmarks/serve.py +1135 -0
- vllm/benchmarks/throughput.py +609 -0
- vllm/benchmarks/utils.py +70 -0
- vllm/collect_env.py +820 -0
- vllm/compilation/__init__.py +0 -0
- vllm/compilation/activation_quant_fusion.py +89 -0
- vllm/compilation/backends.py +563 -0
- vllm/compilation/base_piecewise_backend.py +72 -0
- vllm/compilation/collective_fusion.py +127 -0
- vllm/compilation/compiler_interface.py +544 -0
- vllm/compilation/counter.py +38 -0
- vllm/compilation/cuda_piecewise_backend.py +214 -0
- vllm/compilation/decorators.py +250 -0
- vllm/compilation/fix_functionalization.py +191 -0
- vllm/compilation/fusion.py +618 -0
- vllm/compilation/fx_utils.py +62 -0
- vllm/compilation/inductor_pass.py +115 -0
- vllm/compilation/monitor.py +39 -0
- vllm/compilation/multi_output_match.py +109 -0
- vllm/compilation/noop_elimination.py +137 -0
- vllm/compilation/pass_manager.py +78 -0
- vllm/compilation/sequence_parallelism.py +268 -0
- vllm/compilation/torch25_custom_graph_pass.py +42 -0
- vllm/compilation/vllm_inductor_pass.py +67 -0
- vllm/compilation/wrapper.py +135 -0
- vllm/config.py +4746 -0
- vllm/connections.py +174 -0
- vllm/core/__init__.py +0 -0
- vllm/core/block/__init__.py +0 -0
- vllm/core/block/block_table.py +399 -0
- vllm/core/block/common.py +371 -0
- vllm/core/block/cpu_gpu_block_allocator.py +441 -0
- vllm/core/block/interfaces.py +319 -0
- vllm/core/block/naive_block.py +466 -0
- vllm/core/block/prefix_caching_block.py +1135 -0
- vllm/core/block/utils.py +28 -0
- vllm/core/block_manager.py +521 -0
- vllm/core/evictor.py +157 -0
- vllm/core/interfaces.py +135 -0
- vllm/core/placeholder_block_space_manager.py +100 -0
- vllm/core/scheduler.py +2093 -0
- vllm/device_allocator/__init__.py +0 -0
- vllm/device_allocator/cumem.py +281 -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 +264 -0
- vllm/distributed/device_communicators/base_device_communicator.py +260 -0
- vllm/distributed/device_communicators/cpu_communicator.py +145 -0
- vllm/distributed/device_communicators/cuda_communicator.py +176 -0
- vllm/distributed/device_communicators/cuda_wrapper.py +180 -0
- vllm/distributed/device_communicators/custom_all_reduce.py +304 -0
- vllm/distributed/device_communicators/custom_all_reduce_utils.py +259 -0
- vllm/distributed/device_communicators/hpu_communicator.py +46 -0
- vllm/distributed/device_communicators/neuron_communicator.py +20 -0
- vllm/distributed/device_communicators/pynccl.py +218 -0
- vllm/distributed/device_communicators/pynccl_wrapper.py +341 -0
- vllm/distributed/device_communicators/shm_broadcast.py +585 -0
- vllm/distributed/device_communicators/tpu_communicator.py +103 -0
- vllm/distributed/device_communicators/xpu_communicator.py +55 -0
- vllm/distributed/kv_events.py +356 -0
- vllm/distributed/kv_transfer/README.md +29 -0
- vllm/distributed/kv_transfer/__init__.py +12 -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 +128 -0
- vllm/distributed/kv_transfer/kv_connector/factory.py +128 -0
- vllm/distributed/kv_transfer/kv_connector/lmcache_connector.py +99 -0
- vllm/distributed/kv_transfer/kv_connector/mooncake_store_connector.py +203 -0
- vllm/distributed/kv_transfer/kv_connector/simple_connector.py +329 -0
- vllm/distributed/kv_transfer/kv_connector/utils.py +108 -0
- vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +6 -0
- vllm/distributed/kv_transfer/kv_connector/v1/base.py +283 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +134 -0
- vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +201 -0
- vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +1030 -0
- vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py +384 -0
- vllm/distributed/kv_transfer/kv_connector_agent.py +77 -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 +280 -0
- vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +280 -0
- vllm/distributed/kv_transfer/kv_transfer_state.py +71 -0
- vllm/distributed/parallel_state.py +1296 -0
- vllm/distributed/tpu_distributed_utils.py +177 -0
- vllm/distributed/utils.py +536 -0
- vllm/engine/__init__.py +0 -0
- vllm/engine/arg_utils.py +1708 -0
- vllm/engine/async_llm_engine.py +1200 -0
- vllm/engine/async_timeout.py +173 -0
- vllm/engine/llm_engine.py +2097 -0
- vllm/engine/metrics.py +629 -0
- vllm/engine/metrics_types.py +94 -0
- vllm/engine/multiprocessing/__init__.py +148 -0
- vllm/engine/multiprocessing/client.py +681 -0
- vllm/engine/multiprocessing/engine.py +460 -0
- vllm/engine/output_processor/__init__.py +0 -0
- vllm/engine/output_processor/interfaces.py +75 -0
- vllm/engine/output_processor/multi_step.py +216 -0
- vllm/engine/output_processor/single_step.py +145 -0
- vllm/engine/output_processor/stop_checker.py +131 -0
- vllm/engine/output_processor/util.py +28 -0
- vllm/engine/protocol.py +317 -0
- vllm/entrypoints/__init__.py +0 -0
- vllm/entrypoints/api_server.py +178 -0
- vllm/entrypoints/chat_utils.py +1299 -0
- vllm/entrypoints/cli/__init__.py +0 -0
- vllm/entrypoints/cli/benchmark/__init__.py +0 -0
- vllm/entrypoints/cli/benchmark/base.py +39 -0
- vllm/entrypoints/cli/benchmark/latency.py +30 -0
- vllm/entrypoints/cli/benchmark/main.py +54 -0
- vllm/entrypoints/cli/benchmark/serve.py +30 -0
- vllm/entrypoints/cli/benchmark/throughput.py +30 -0
- vllm/entrypoints/cli/collect_env.py +35 -0
- vllm/entrypoints/cli/main.py +65 -0
- vllm/entrypoints/cli/openai.py +205 -0
- vllm/entrypoints/cli/run_batch.py +62 -0
- vllm/entrypoints/cli/serve.py +328 -0
- vllm/entrypoints/cli/types.py +25 -0
- vllm/entrypoints/launcher.py +147 -0
- vllm/entrypoints/llm.py +1544 -0
- vllm/entrypoints/logger.py +50 -0
- vllm/entrypoints/openai/__init__.py +0 -0
- vllm/entrypoints/openai/api_server.py +1387 -0
- vllm/entrypoints/openai/cli_args.py +315 -0
- vllm/entrypoints/openai/logits_processors.py +90 -0
- vllm/entrypoints/openai/protocol.py +1913 -0
- vllm/entrypoints/openai/run_batch.py +463 -0
- vllm/entrypoints/openai/serving_chat.py +1221 -0
- vllm/entrypoints/openai/serving_classification.py +160 -0
- vllm/entrypoints/openai/serving_completion.py +592 -0
- vllm/entrypoints/openai/serving_embedding.py +201 -0
- vllm/entrypoints/openai/serving_engine.py +986 -0
- vllm/entrypoints/openai/serving_models.py +315 -0
- vllm/entrypoints/openai/serving_pooling.py +232 -0
- vllm/entrypoints/openai/serving_score.py +433 -0
- vllm/entrypoints/openai/serving_tokenization.py +157 -0
- vllm/entrypoints/openai/serving_transcription.py +424 -0
- vllm/entrypoints/openai/tool_parsers/__init__.py +23 -0
- vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +164 -0
- vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py +370 -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 +371 -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/llama4_pythonic_tool_parser.py +316 -0
- vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +267 -0
- vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +369 -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/utils.py +124 -0
- vllm/entrypoints/score_utils.py +50 -0
- vllm/entrypoints/ssl.py +75 -0
- vllm/entrypoints/utils.py +233 -0
- vllm/env_override.py +41 -0
- vllm/envs.py +944 -0
- vllm/executor/__init__.py +0 -0
- vllm/executor/executor_base.py +401 -0
- vllm/executor/mp_distributed_executor.py +244 -0
- vllm/executor/msgspec_utils.py +30 -0
- vllm/executor/multiproc_worker_utils.py +313 -0
- vllm/executor/ray_distributed_executor.py +701 -0
- vllm/executor/ray_utils.py +399 -0
- vllm/executor/uniproc_executor.py +139 -0
- vllm/forward_context.py +179 -0
- vllm/inputs/__init__.py +41 -0
- vllm/inputs/data.py +331 -0
- vllm/inputs/parse.py +151 -0
- vllm/inputs/preprocess.py +909 -0
- vllm/inputs/registry.py +237 -0
- vllm/jsontree.py +80 -0
- vllm/logger.py +212 -0
- vllm/logging_utils/__init__.py +8 -0
- vllm/logging_utils/dump_input.py +85 -0
- vllm/logging_utils/formatter.py +18 -0
- vllm/logits_process.py +119 -0
- vllm/lora/__init__.py +0 -0
- vllm/lora/fully_sharded_layers.py +355 -0
- vllm/lora/layers.py +1285 -0
- vllm/lora/lora.py +199 -0
- vllm/lora/models.py +818 -0
- vllm/lora/ops/__init__.py +0 -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 +290 -0
- vllm/lora/ops/triton_ops/lora_kernel_metadata.py +148 -0
- vllm/lora/ops/triton_ops/lora_shrink_op.py +244 -0
- vllm/lora/ops/triton_ops/utils.py +120 -0
- vllm/lora/ops/xla_ops/__init__.py +7 -0
- vllm/lora/ops/xla_ops/lora_ops.py +145 -0
- vllm/lora/peft_helper.py +136 -0
- vllm/lora/punica_wrapper/__init__.py +10 -0
- vllm/lora/punica_wrapper/punica_base.py +485 -0
- vllm/lora/punica_wrapper/punica_cpu.py +349 -0
- vllm/lora/punica_wrapper/punica_gpu.py +290 -0
- vllm/lora/punica_wrapper/punica_hpu.py +145 -0
- vllm/lora/punica_wrapper/punica_selector.py +20 -0
- vllm/lora/punica_wrapper/punica_tpu.py +405 -0
- vllm/lora/punica_wrapper/utils.py +164 -0
- vllm/lora/request.py +99 -0
- vllm/lora/resolver.py +85 -0
- vllm/lora/utils.py +240 -0
- vllm/lora/worker_manager.py +259 -0
- vllm/model_executor/__init__.py +16 -0
- vllm/model_executor/custom_op.py +152 -0
- vllm/model_executor/guided_decoding/__init__.py +181 -0
- vllm/model_executor/guided_decoding/guidance_decoding.py +63 -0
- vllm/model_executor/guided_decoding/guidance_logits_processors.py +104 -0
- vllm/model_executor/guided_decoding/guided_fields.py +41 -0
- vllm/model_executor/guided_decoding/lm_format_enforcer_decoding.py +67 -0
- vllm/model_executor/guided_decoding/outlines_decoding.py +155 -0
- vllm/model_executor/guided_decoding/outlines_logits_processors.py +284 -0
- vllm/model_executor/guided_decoding/utils.py +242 -0
- vllm/model_executor/guided_decoding/xgrammar_decoding.py +426 -0
- vllm/model_executor/layers/__init__.py +0 -0
- vllm/model_executor/layers/activation.py +369 -0
- vllm/model_executor/layers/fused_moe/__init__.py +54 -0
- vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +125 -0
- vllm/model_executor/layers/fused_moe/batched_triton_or_deep_gemm_moe.py +117 -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=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=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_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.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=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_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.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_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=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=64,device_name=NVIDIA_A800-SXM4-80GB.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=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=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=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=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=896,device_name=NVIDIA_H20.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.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/cutlass_moe.py +461 -0
- vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +240 -0
- vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +240 -0
- vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +186 -0
- vllm/model_executor/layers/fused_moe/fused_batched_moe.py +775 -0
- vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +232 -0
- vllm/model_executor/layers/fused_moe/fused_moe.py +1724 -0
- vllm/model_executor/layers/fused_moe/layer.py +1535 -0
- vllm/model_executor/layers/fused_moe/modular_kernel.py +446 -0
- vllm/model_executor/layers/fused_moe/moe_align_block_size.py +243 -0
- vllm/model_executor/layers/fused_moe/moe_pallas.py +80 -0
- vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +190 -0
- vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
- vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +159 -0
- vllm/model_executor/layers/fused_moe/prepare_finalize.py +69 -0
- vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +421 -0
- vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +117 -0
- vllm/model_executor/layers/fused_moe/utils.py +98 -0
- vllm/model_executor/layers/layernorm.py +288 -0
- vllm/model_executor/layers/lightning_attn.py +652 -0
- vllm/model_executor/layers/linear.py +1524 -0
- vllm/model_executor/layers/logits_processor.py +197 -0
- vllm/model_executor/layers/mamba/__init__.py +0 -0
- vllm/model_executor/layers/mamba/mamba2_metadata.py +125 -0
- vllm/model_executor/layers/mamba/mamba_mixer.py +245 -0
- vllm/model_executor/layers/mamba/mamba_mixer2.py +616 -0
- vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
- vllm/model_executor/layers/mamba/ops/causal_conv1d.py +105 -0
- vllm/model_executor/layers/mamba/ops/mamba_ssm.py +414 -0
- vllm/model_executor/layers/mamba/ops/ssd_bmm.py +262 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +589 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +751 -0
- vllm/model_executor/layers/mamba/ops/ssd_combined.py +232 -0
- vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +206 -0
- vllm/model_executor/layers/pooler.py +350 -0
- vllm/model_executor/layers/quantization/__init__.py +157 -0
- vllm/model_executor/layers/quantization/aqlm.py +376 -0
- vllm/model_executor/layers/quantization/auto_round.py +310 -0
- vllm/model_executor/layers/quantization/awq.py +194 -0
- vllm/model_executor/layers/quantization/awq_marlin.py +519 -0
- vllm/model_executor/layers/quantization/awq_triton.py +320 -0
- vllm/model_executor/layers/quantization/base_config.py +151 -0
- vllm/model_executor/layers/quantization/bitblas.py +461 -0
- vllm/model_executor/layers/quantization/bitsandbytes.py +396 -0
- vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +668 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +1260 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +24 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +358 -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 +93 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +178 -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 +150 -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/triton_scaled_mm.py +206 -0
- vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
- vllm/model_executor/layers/quantization/deepspeedfp.py +195 -0
- vllm/model_executor/layers/quantization/experts_int8.py +196 -0
- vllm/model_executor/layers/quantization/fbgemm_fp8.py +172 -0
- vllm/model_executor/layers/quantization/fp8.py +906 -0
- vllm/model_executor/layers/quantization/gguf.py +565 -0
- vllm/model_executor/layers/quantization/gptq.py +278 -0
- vllm/model_executor/layers/quantization/gptq_bitblas.py +445 -0
- vllm/model_executor/layers/quantization/gptq_marlin.py +648 -0
- vllm/model_executor/layers/quantization/gptq_marlin_24.py +297 -0
- vllm/model_executor/layers/quantization/hqq_marlin.py +332 -0
- vllm/model_executor/layers/quantization/ipex_quant.py +250 -0
- vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +90 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +83 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +116 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +300 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +143 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +120 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +131 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +67 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +87 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +120 -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 +105 -0
- vllm/model_executor/layers/quantization/kv_cache.py +139 -0
- vllm/model_executor/layers/quantization/marlin.py +261 -0
- vllm/model_executor/layers/quantization/modelopt.py +737 -0
- vllm/model_executor/layers/quantization/moe_wna16.py +449 -0
- vllm/model_executor/layers/quantization/neuron_quant.py +76 -0
- vllm/model_executor/layers/quantization/ptpc_fp8.py +127 -0
- vllm/model_executor/layers/quantization/qqq.py +275 -0
- vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
- vllm/model_executor/layers/quantization/quark/quark.py +441 -0
- vllm/model_executor/layers/quantization/quark/quark_moe.py +237 -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 +126 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +146 -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/schema.py +86 -0
- vllm/model_executor/layers/quantization/torchao.py +161 -0
- vllm/model_executor/layers/quantization/tpu_int8.py +121 -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 +208 -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=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=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=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/fp8_utils.py +618 -0
- vllm/model_executor/layers/quantization/utils/gptq_utils.py +95 -0
- vllm/model_executor/layers/quantization/utils/int8_utils.py +485 -0
- vllm/model_executor/layers/quantization/utils/layer_utils.py +40 -0
- vllm/model_executor/layers/quantization/utils/machete_utils.py +33 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils.py +476 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +283 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +325 -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/marlin_utils_test_qqq.py +126 -0
- vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +45 -0
- vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +104 -0
- vllm/model_executor/layers/quantization/utils/quant_utils.py +573 -0
- vllm/model_executor/layers/quantization/utils/w8a8_utils.py +405 -0
- vllm/model_executor/layers/rejection_sampler.py +406 -0
- vllm/model_executor/layers/resampler.py +270 -0
- vllm/model_executor/layers/rotary_embedding.py +1862 -0
- vllm/model_executor/layers/sampler.py +1204 -0
- vllm/model_executor/layers/spec_decode_base_sampler.py +259 -0
- vllm/model_executor/layers/typical_acceptance_sampler.py +166 -0
- vllm/model_executor/layers/utils.py +95 -0
- vllm/model_executor/layers/vocab_parallel_embedding.py +487 -0
- vllm/model_executor/model_loader/__init__.py +76 -0
- vllm/model_executor/model_loader/base_loader.py +43 -0
- vllm/model_executor/model_loader/bitsandbytes_loader.py +570 -0
- vllm/model_executor/model_loader/default_loader.py +282 -0
- vllm/model_executor/model_loader/dummy_loader.py +27 -0
- vllm/model_executor/model_loader/gguf_loader.py +120 -0
- vllm/model_executor/model_loader/neuron.py +476 -0
- vllm/model_executor/model_loader/neuronx_distributed.py +685 -0
- vllm/model_executor/model_loader/runai_streamer_loader.py +109 -0
- vllm/model_executor/model_loader/sharded_state_loader.py +201 -0
- vllm/model_executor/model_loader/tensorizer.py +600 -0
- vllm/model_executor/model_loader/tensorizer_loader.py +123 -0
- vllm/model_executor/model_loader/tpu.py +112 -0
- vllm/model_executor/model_loader/utils.py +302 -0
- vllm/model_executor/model_loader/weight_utils.py +782 -0
- vllm/model_executor/models/__init__.py +28 -0
- vllm/model_executor/models/adapters.py +248 -0
- vllm/model_executor/models/aimv2.py +246 -0
- vllm/model_executor/models/arctic.py +559 -0
- vllm/model_executor/models/aria.py +657 -0
- vllm/model_executor/models/aya_vision.py +466 -0
- vllm/model_executor/models/baichuan.py +474 -0
- vllm/model_executor/models/bamba.py +543 -0
- vllm/model_executor/models/bart.py +938 -0
- vllm/model_executor/models/bert.py +523 -0
- vllm/model_executor/models/bert_with_rope.py +769 -0
- vllm/model_executor/models/blip.py +339 -0
- vllm/model_executor/models/blip2.py +718 -0
- vllm/model_executor/models/bloom.py +373 -0
- vllm/model_executor/models/chameleon.py +1136 -0
- vllm/model_executor/models/chatglm.py +478 -0
- vllm/model_executor/models/clip.py +407 -0
- vllm/model_executor/models/commandr.py +472 -0
- vllm/model_executor/models/constant_size_cache.py +137 -0
- vllm/model_executor/models/dbrx.py +472 -0
- vllm/model_executor/models/deepseek.py +486 -0
- vllm/model_executor/models/deepseek_mtp.py +269 -0
- vllm/model_executor/models/deepseek_v2.py +843 -0
- vllm/model_executor/models/deepseek_vl2.py +648 -0
- vllm/model_executor/models/eagle.py +260 -0
- vllm/model_executor/models/exaone.py +551 -0
- vllm/model_executor/models/fairseq2_llama.py +154 -0
- vllm/model_executor/models/falcon.py +510 -0
- vllm/model_executor/models/falcon_h1.py +685 -0
- vllm/model_executor/models/florence2.py +1103 -0
- vllm/model_executor/models/fuyu.py +389 -0
- vllm/model_executor/models/gemma.py +425 -0
- vllm/model_executor/models/gemma2.py +425 -0
- vllm/model_executor/models/gemma3.py +533 -0
- vllm/model_executor/models/gemma3_mm.py +709 -0
- vllm/model_executor/models/glm.py +23 -0
- vllm/model_executor/models/glm4.py +305 -0
- vllm/model_executor/models/glm4v.py +648 -0
- vllm/model_executor/models/gpt2.py +328 -0
- vllm/model_executor/models/gpt_bigcode.py +335 -0
- vllm/model_executor/models/gpt_j.py +339 -0
- vllm/model_executor/models/gpt_neox.py +332 -0
- vllm/model_executor/models/granite.py +493 -0
- vllm/model_executor/models/granite_speech.py +779 -0
- vllm/model_executor/models/granitemoe.py +437 -0
- vllm/model_executor/models/granitemoehybrid.py +586 -0
- vllm/model_executor/models/granitemoeshared.py +341 -0
- vllm/model_executor/models/gritlm.py +224 -0
- vllm/model_executor/models/grok1.py +546 -0
- vllm/model_executor/models/h2ovl.py +546 -0
- vllm/model_executor/models/idefics2_vision_model.py +389 -0
- vllm/model_executor/models/idefics3.py +776 -0
- vllm/model_executor/models/interfaces.py +572 -0
- vllm/model_executor/models/interfaces_base.py +164 -0
- vllm/model_executor/models/intern_vit.py +480 -0
- vllm/model_executor/models/internlm2.py +455 -0
- vllm/model_executor/models/internlm2_ve.py +147 -0
- vllm/model_executor/models/internvl.py +1418 -0
- vllm/model_executor/models/jais.py +373 -0
- vllm/model_executor/models/jamba.py +592 -0
- vllm/model_executor/models/kimi_vl.py +577 -0
- vllm/model_executor/models/llama.py +644 -0
- vllm/model_executor/models/llama4.py +532 -0
- vllm/model_executor/models/llama_eagle.py +165 -0
- vllm/model_executor/models/llama_eagle3.py +263 -0
- vllm/model_executor/models/llava.py +866 -0
- vllm/model_executor/models/llava_next.py +586 -0
- vllm/model_executor/models/llava_next_video.py +471 -0
- vllm/model_executor/models/llava_onevision.py +956 -0
- vllm/model_executor/models/mamba.py +273 -0
- vllm/model_executor/models/mamba2.py +308 -0
- vllm/model_executor/models/mamba_cache.py +76 -0
- vllm/model_executor/models/medusa.py +219 -0
- vllm/model_executor/models/mimo.py +192 -0
- vllm/model_executor/models/mimo_mtp.py +285 -0
- vllm/model_executor/models/minicpm.py +592 -0
- vllm/model_executor/models/minicpm3.py +230 -0
- vllm/model_executor/models/minicpm_eagle.py +391 -0
- vllm/model_executor/models/minicpmo.py +759 -0
- vllm/model_executor/models/minicpmv.py +1287 -0
- vllm/model_executor/models/minimax_cache.py +36 -0
- vllm/model_executor/models/minimax_text_01.py +1301 -0
- vllm/model_executor/models/minimax_vl_01.py +364 -0
- vllm/model_executor/models/mistral3.py +604 -0
- vllm/model_executor/models/mixtral.py +488 -0
- vllm/model_executor/models/mixtral_quant.py +453 -0
- vllm/model_executor/models/mllama.py +1624 -0
- vllm/model_executor/models/mllama4.py +938 -0
- vllm/model_executor/models/mlp_speculator.py +206 -0
- vllm/model_executor/models/modernbert.py +331 -0
- vllm/model_executor/models/module_mapping.py +72 -0
- vllm/model_executor/models/molmo.py +1568 -0
- vllm/model_executor/models/moonvit.py +630 -0
- vllm/model_executor/models/mpt.py +331 -0
- vllm/model_executor/models/nemotron.py +508 -0
- vllm/model_executor/models/nemotron_h.py +573 -0
- vllm/model_executor/models/nemotron_nas.py +484 -0
- vllm/model_executor/models/nvlm_d.py +216 -0
- vllm/model_executor/models/olmo.py +389 -0
- vllm/model_executor/models/olmo2.py +414 -0
- vllm/model_executor/models/olmoe.py +468 -0
- vllm/model_executor/models/opt.py +412 -0
- vllm/model_executor/models/orion.py +349 -0
- vllm/model_executor/models/ovis.py +567 -0
- vllm/model_executor/models/paligemma.py +398 -0
- vllm/model_executor/models/persimmon.py +344 -0
- vllm/model_executor/models/phi.py +356 -0
- vllm/model_executor/models/phi3.py +19 -0
- vllm/model_executor/models/phi3_small.py +465 -0
- vllm/model_executor/models/phi3v.py +723 -0
- vllm/model_executor/models/phi4mm.py +1246 -0
- vllm/model_executor/models/phi4mm_audio.py +1233 -0
- vllm/model_executor/models/phi4mm_utils.py +1884 -0
- vllm/model_executor/models/phimoe.py +665 -0
- vllm/model_executor/models/pixtral.py +1316 -0
- vllm/model_executor/models/plamo2.py +738 -0
- vllm/model_executor/models/prithvi_geospatial_mae.py +232 -0
- vllm/model_executor/models/qwen.py +362 -0
- vllm/model_executor/models/qwen2.py +497 -0
- vllm/model_executor/models/qwen2_5_omni_thinker.py +904 -0
- vllm/model_executor/models/qwen2_5_vl.py +1166 -0
- vllm/model_executor/models/qwen2_audio.py +410 -0
- vllm/model_executor/models/qwen2_moe.py +540 -0
- vllm/model_executor/models/qwen2_rm.py +132 -0
- vllm/model_executor/models/qwen2_vl.py +1405 -0
- vllm/model_executor/models/qwen3.py +321 -0
- vllm/model_executor/models/qwen3_moe.py +535 -0
- vllm/model_executor/models/qwen_vl.py +785 -0
- vllm/model_executor/models/registry.py +622 -0
- vllm/model_executor/models/roberta.py +276 -0
- vllm/model_executor/models/siglip.py +524 -0
- vllm/model_executor/models/skyworkr1v.py +951 -0
- vllm/model_executor/models/smolvlm.py +52 -0
- vllm/model_executor/models/solar.py +506 -0
- vllm/model_executor/models/stablelm.py +343 -0
- vllm/model_executor/models/starcoder2.py +356 -0
- vllm/model_executor/models/tarsier.py +643 -0
- vllm/model_executor/models/telechat2.py +140 -0
- vllm/model_executor/models/teleflm.py +79 -0
- vllm/model_executor/models/transformers.py +508 -0
- vllm/model_executor/models/ultravox.py +656 -0
- vllm/model_executor/models/utils.py +731 -0
- vllm/model_executor/models/vision.py +147 -0
- vllm/model_executor/models/whisper.py +747 -0
- vllm/model_executor/models/zamba2.py +1009 -0
- vllm/model_executor/parameter.py +459 -0
- vllm/model_executor/pooling_metadata.py +72 -0
- vllm/model_executor/sampling_metadata.py +597 -0
- vllm/model_executor/utils.py +77 -0
- vllm/multimodal/__init__.py +33 -0
- vllm/multimodal/audio.py +106 -0
- vllm/multimodal/base.py +219 -0
- vllm/multimodal/hasher.py +118 -0
- vllm/multimodal/image.py +97 -0
- vllm/multimodal/inputs.py +876 -0
- vllm/multimodal/parse.py +461 -0
- vllm/multimodal/processing.py +1895 -0
- vllm/multimodal/profiling.py +258 -0
- vllm/multimodal/registry.py +331 -0
- vllm/multimodal/utils.py +436 -0
- vllm/multimodal/video.py +198 -0
- vllm/outputs.py +512 -0
- vllm/platforms/__init__.py +291 -0
- vllm/platforms/cpu.py +266 -0
- vllm/platforms/cuda.py +526 -0
- vllm/platforms/hpu.py +106 -0
- vllm/platforms/interface.py +538 -0
- vllm/platforms/neuron.py +150 -0
- vllm/platforms/rocm.py +435 -0
- vllm/platforms/tpu.py +216 -0
- vllm/platforms/xpu.py +156 -0
- vllm/plugins/__init__.py +94 -0
- vllm/plugins/lora_resolvers/README.md +15 -0
- vllm/plugins/lora_resolvers/__init__.py +0 -0
- vllm/plugins/lora_resolvers/filesystem_resolver.py +50 -0
- vllm/pooling_params.py +54 -0
- vllm/profiler/__init__.py +0 -0
- vllm/profiler/layerwise_profile.py +375 -0
- vllm/profiler/utils.py +148 -0
- vllm/prompt_adapter/__init__.py +0 -0
- vllm/prompt_adapter/layers.py +83 -0
- vllm/prompt_adapter/models.py +358 -0
- vllm/prompt_adapter/request.py +37 -0
- vllm/prompt_adapter/utils.py +98 -0
- vllm/prompt_adapter/worker_manager.py +179 -0
- vllm/py.typed +2 -0
- vllm/reasoning/__init__.py +15 -0
- vllm/reasoning/abs_reasoning_parsers.py +192 -0
- vllm/reasoning/deepseek_r1_reasoning_parser.py +173 -0
- vllm/reasoning/granite_reasoning_parser.py +363 -0
- vllm/reasoning/qwen3_reasoning_parser.py +151 -0
- vllm/sampling_params.py +602 -0
- vllm/scalar_type.py +347 -0
- vllm/scripts.py +15 -0
- vllm/sequence.py +1568 -0
- vllm/spec_decode/__init__.py +0 -0
- vllm/spec_decode/batch_expansion.py +506 -0
- vllm/spec_decode/draft_model_runner.py +349 -0
- vllm/spec_decode/interfaces.py +99 -0
- vllm/spec_decode/medusa_worker.py +138 -0
- vllm/spec_decode/metrics.py +213 -0
- vllm/spec_decode/mlp_speculator_worker.py +94 -0
- vllm/spec_decode/mqa_scorer.py +160 -0
- vllm/spec_decode/multi_step_worker.py +423 -0
- vllm/spec_decode/ngram_worker.py +196 -0
- vllm/spec_decode/proposer_worker_base.py +59 -0
- vllm/spec_decode/smaller_tp_proposer_worker.py +196 -0
- vllm/spec_decode/spec_decode_worker.py +1326 -0
- vllm/spec_decode/target_model_runner.py +45 -0
- vllm/spec_decode/top1_proposer.py +275 -0
- vllm/spec_decode/util.py +277 -0
- vllm/test_utils.py +130 -0
- vllm/third_party/__init__.py +0 -0
- vllm/third_party/pynvml.py +6140 -0
- vllm/tracing.py +131 -0
- vllm/transformers_utils/__init__.py +24 -0
- vllm/transformers_utils/chat_templates/__init__.py +5 -0
- vllm/transformers_utils/chat_templates/registry.py +60 -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/config.py +887 -0
- vllm/transformers_utils/configs/__init__.py +61 -0
- vllm/transformers_utils/configs/arctic.py +207 -0
- vllm/transformers_utils/configs/chatglm.py +72 -0
- vllm/transformers_utils/configs/cohere2.py +195 -0
- vllm/transformers_utils/configs/dbrx.py +280 -0
- vllm/transformers_utils/configs/deepseek_vl2.py +216 -0
- vllm/transformers_utils/configs/eagle.py +85 -0
- vllm/transformers_utils/configs/exaone.py +190 -0
- vllm/transformers_utils/configs/falcon.py +90 -0
- vllm/transformers_utils/configs/h2ovl.py +16 -0
- vllm/transformers_utils/configs/internvl.py +54 -0
- vllm/transformers_utils/configs/jais.py +238 -0
- vllm/transformers_utils/configs/kimi_vl.py +37 -0
- vllm/transformers_utils/configs/medusa.py +63 -0
- vllm/transformers_utils/configs/minimax_text_01.py +70 -0
- vllm/transformers_utils/configs/minimax_vl_01.py +71 -0
- vllm/transformers_utils/configs/mllama.py +31 -0
- vllm/transformers_utils/configs/mlp_speculator.py +68 -0
- vllm/transformers_utils/configs/moonvit.py +33 -0
- vllm/transformers_utils/configs/mpt.py +180 -0
- vllm/transformers_utils/configs/nemotron.py +205 -0
- vllm/transformers_utils/configs/nemotron_h.py +258 -0
- vllm/transformers_utils/configs/nvlm_d.py +15 -0
- vllm/transformers_utils/configs/ovis.py +184 -0
- vllm/transformers_utils/configs/skyworkr1v.py +54 -0
- vllm/transformers_utils/configs/solar.py +247 -0
- vllm/transformers_utils/configs/telechat2.py +64 -0
- vllm/transformers_utils/configs/ultravox.py +108 -0
- vllm/transformers_utils/detokenizer.py +168 -0
- vllm/transformers_utils/detokenizer_utils.py +189 -0
- vllm/transformers_utils/processor.py +221 -0
- vllm/transformers_utils/processors/__init__.py +8 -0
- vllm/transformers_utils/processors/deepseek_vl2.py +363 -0
- vllm/transformers_utils/processors/ovis.py +420 -0
- vllm/transformers_utils/s3_utils.py +162 -0
- vllm/transformers_utils/tokenizer.py +302 -0
- vllm/transformers_utils/tokenizer_base.py +149 -0
- vllm/transformers_utils/tokenizer_group.py +120 -0
- vllm/transformers_utils/tokenizers/__init__.py +10 -0
- vllm/transformers_utils/tokenizers/mistral.py +493 -0
- vllm/transformers_utils/utils.py +99 -0
- vllm/triton_utils/__init__.py +14 -0
- vllm/triton_utils/importing.py +50 -0
- vllm/usage/__init__.py +0 -0
- vllm/usage/usage_lib.py +256 -0
- vllm/utils.py +2910 -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 +163 -0
- vllm/v1/attention/backends/flash_attn.py +869 -0
- vllm/v1/attention/backends/flashinfer.py +651 -0
- vllm/v1/attention/backends/flex_attention.py +477 -0
- vllm/v1/attention/backends/mla/__init__.py +0 -0
- vllm/v1/attention/backends/mla/common.py +931 -0
- vllm/v1/attention/backends/mla/cutlass_mla.py +97 -0
- vllm/v1/attention/backends/mla/flashmla.py +152 -0
- vllm/v1/attention/backends/mla/rocm_aiter_mla.py +220 -0
- vllm/v1/attention/backends/mla/triton_mla.py +120 -0
- vllm/v1/attention/backends/pallas.py +240 -0
- vllm/v1/attention/backends/triton_attn.py +285 -0
- vllm/v1/attention/backends/utils.py +52 -0
- vllm/v1/core/__init__.py +0 -0
- vllm/v1/core/block_pool.py +349 -0
- vllm/v1/core/encoder_cache_manager.py +150 -0
- vllm/v1/core/kv_cache_coordinator.py +363 -0
- vllm/v1/core/kv_cache_manager.py +392 -0
- vllm/v1/core/kv_cache_utils.py +996 -0
- vllm/v1/core/sched/__init__.py +0 -0
- vllm/v1/core/sched/interface.py +150 -0
- vllm/v1/core/sched/output.py +154 -0
- vllm/v1/core/sched/scheduler.py +1044 -0
- vllm/v1/core/sched/utils.py +23 -0
- vllm/v1/core/single_type_kv_cache_manager.py +403 -0
- vllm/v1/engine/__init__.py +173 -0
- vllm/v1/engine/async_llm.py +558 -0
- vllm/v1/engine/coordinator.py +253 -0
- vllm/v1/engine/core.py +961 -0
- vllm/v1/engine/core_client.py +1129 -0
- vllm/v1/engine/detokenizer.py +261 -0
- vllm/v1/engine/exceptions.py +17 -0
- vllm/v1/engine/llm_engine.py +317 -0
- vllm/v1/engine/logprobs.py +199 -0
- vllm/v1/engine/mm_input_cache.py +91 -0
- vllm/v1/engine/output_processor.py +428 -0
- vllm/v1/engine/parallel_sampling.py +133 -0
- vllm/v1/engine/processor.py +407 -0
- vllm/v1/executor/__init__.py +0 -0
- vllm/v1/executor/abstract.py +113 -0
- vllm/v1/executor/multiproc_executor.py +537 -0
- vllm/v1/executor/ray_distributed_executor.py +62 -0
- vllm/v1/kv_cache_interface.py +194 -0
- vllm/v1/metrics/__init__.py +0 -0
- vllm/v1/metrics/loggers.py +523 -0
- vllm/v1/metrics/prometheus.py +82 -0
- vllm/v1/metrics/ray_wrappers.py +131 -0
- vllm/v1/metrics/reader.py +246 -0
- vllm/v1/metrics/stats.py +239 -0
- vllm/v1/outputs.py +116 -0
- vllm/v1/request.py +193 -0
- vllm/v1/sample/__init__.py +0 -0
- vllm/v1/sample/metadata.py +44 -0
- vllm/v1/sample/ops/__init__.py +0 -0
- vllm/v1/sample/ops/bad_words.py +39 -0
- vllm/v1/sample/ops/penalties.py +59 -0
- vllm/v1/sample/ops/topk_topp_sampler.py +293 -0
- vllm/v1/sample/rejection_sampler.py +631 -0
- vllm/v1/sample/sampler.py +286 -0
- vllm/v1/sample/tpu/__init__.py +0 -0
- vllm/v1/sample/tpu/metadata.py +124 -0
- vllm/v1/sample/tpu/sampler.py +145 -0
- vllm/v1/serial_utils.py +315 -0
- vllm/v1/spec_decode/__init__.py +0 -0
- vllm/v1/spec_decode/eagle.py +432 -0
- vllm/v1/spec_decode/medusa.py +62 -0
- vllm/v1/spec_decode/metadata.py +62 -0
- vllm/v1/spec_decode/metrics.py +178 -0
- vllm/v1/spec_decode/ngram_proposer.py +132 -0
- vllm/v1/spec_decode/utils.py +46 -0
- vllm/v1/structured_output/__init__.py +222 -0
- vllm/v1/structured_output/backend_guidance.py +245 -0
- vllm/v1/structured_output/backend_types.py +134 -0
- vllm/v1/structured_output/backend_xgrammar.py +318 -0
- vllm/v1/structured_output/request.py +86 -0
- vllm/v1/structured_output/utils.py +175 -0
- vllm/v1/utils.py +743 -0
- vllm/v1/worker/__init__.py +0 -0
- vllm/v1/worker/block_table.py +142 -0
- vllm/v1/worker/cpu_model_runner.py +86 -0
- vllm/v1/worker/cpu_worker.py +152 -0
- vllm/v1/worker/gpu_input_batch.py +681 -0
- vllm/v1/worker/gpu_model_runner.py +2320 -0
- vllm/v1/worker/gpu_worker.py +393 -0
- vllm/v1/worker/lora_model_runner_mixin.py +173 -0
- vllm/v1/worker/tpu_model_runner.py +1673 -0
- vllm/v1/worker/tpu_worker.py +299 -0
- vllm/v1/worker/utils.py +111 -0
- vllm/v1/worker/worker_base.py +65 -0
- vllm/version.py +41 -0
- vllm/vllm_flash_attn/.gitkeep +0 -0
- vllm/worker/__init__.py +0 -0
- vllm/worker/cache_engine.py +145 -0
- vllm/worker/cpu_enc_dec_model_runner.py +326 -0
- vllm/worker/cpu_model_runner.py +671 -0
- vllm/worker/cpu_pooling_model_runner.py +125 -0
- vllm/worker/cpu_worker.py +450 -0
- vllm/worker/enc_dec_model_runner.py +555 -0
- vllm/worker/hpu_model_runner.py +2320 -0
- vllm/worker/hpu_worker.py +484 -0
- vllm/worker/model_runner.py +2178 -0
- vllm/worker/model_runner_base.py +282 -0
- vllm/worker/multi_step_hpu_worker.py +123 -0
- vllm/worker/multi_step_model_runner.py +911 -0
- vllm/worker/multi_step_neuron_model_runner.py +84 -0
- vllm/worker/multi_step_neuronx_distributed_model_runner.py +63 -0
- vllm/worker/multi_step_tpu_worker.py +108 -0
- vllm/worker/multi_step_worker.py +197 -0
- vllm/worker/neuron_model_runner.py +460 -0
- vllm/worker/neuron_worker.py +193 -0
- vllm/worker/neuronx_distributed_model_runner.py +294 -0
- vllm/worker/pooling_model_runner.py +211 -0
- vllm/worker/tpu_model_runner.py +909 -0
- vllm/worker/tpu_worker.py +337 -0
- vllm/worker/utils.py +53 -0
- vllm/worker/worker.py +577 -0
- vllm/worker/worker_base.py +646 -0
- vllm/worker/xpu_model_runner.py +606 -0
- vllm/worker/xpu_worker.py +186 -0
- vllm_cpu_amxbf16-0.9.1.dist-info/METADATA +305 -0
- vllm_cpu_amxbf16-0.9.1.dist-info/RECORD +1197 -0
- vllm_cpu_amxbf16-0.9.1.dist-info/WHEEL +5 -0
- vllm_cpu_amxbf16-0.9.1.dist-info/entry_points.txt +5 -0
- vllm_cpu_amxbf16-0.9.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1260 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
3
|
+
|
|
4
|
+
import enum
|
|
5
|
+
import importlib
|
|
6
|
+
from enum import Enum
|
|
7
|
+
from typing import Callable, Optional
|
|
8
|
+
|
|
9
|
+
import torch
|
|
10
|
+
from compressed_tensors import CompressionFormat
|
|
11
|
+
from compressed_tensors.quantization import (ActivationOrdering,
|
|
12
|
+
QuantizationStrategy)
|
|
13
|
+
|
|
14
|
+
import vllm.envs as envs
|
|
15
|
+
from vllm import _custom_ops as ops
|
|
16
|
+
from vllm.logger import init_logger
|
|
17
|
+
from vllm.model_executor.layers.fused_moe import (FusedMoE, FusedMoEMethodBase,
|
|
18
|
+
FusedMoeWeightScaleSupported)
|
|
19
|
+
from vllm.model_executor.layers.quantization.compressed_tensors.schemes.compressed_tensors_wNa16 import ( # noqa
|
|
20
|
+
WNA16_SUPPORTED_BITS, WNA16_SUPPORTED_TYPES_MAP)
|
|
21
|
+
from vllm.model_executor.layers.quantization.utils import replace_parameter
|
|
22
|
+
from vllm.model_executor.layers.quantization.utils.marlin_utils import (
|
|
23
|
+
check_moe_marlin_supports_layer, marlin_make_workspace_new,
|
|
24
|
+
marlin_moe_permute_scales)
|
|
25
|
+
from vllm.model_executor.layers.quantization.utils.marlin_utils_fp8 import (
|
|
26
|
+
prepare_moe_fp8_layer_for_marlin)
|
|
27
|
+
from vllm.model_executor.layers.quantization.utils.w8a8_utils import (
|
|
28
|
+
all_close_1d, normalize_e4m3fn_to_e4m3fnuz, per_tensor_dequantize)
|
|
29
|
+
from vllm.model_executor.utils import set_weight_attrs
|
|
30
|
+
from vllm.platforms import current_platform
|
|
31
|
+
from vllm.scalar_type import scalar_types
|
|
32
|
+
|
|
33
|
+
has_pplx = importlib.util.find_spec("pplx_kernels") is not None
|
|
34
|
+
|
|
35
|
+
if current_platform.is_cuda_alike():
|
|
36
|
+
from vllm.model_executor.layers.fused_moe.fused_batched_moe import (
|
|
37
|
+
BatchedPrepareAndFinalize)
|
|
38
|
+
if has_pplx:
|
|
39
|
+
from vllm.model_executor.layers.fused_moe.pplx_prepare_finalize import (
|
|
40
|
+
PplxPrepareAndFinalize)
|
|
41
|
+
|
|
42
|
+
logger = init_logger(__name__)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class GPTQMarlinState(Enum):
|
|
46
|
+
REPACK = enum.auto()
|
|
47
|
+
READY = enum.auto()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
__all__ = [
|
|
51
|
+
"CompressedTensorsMoEMethod",
|
|
52
|
+
"CompressedTensorsW8A8Fp8MoEMethod",
|
|
53
|
+
"CompressedTensorsW8A8Fp8MoECutlassMethod",
|
|
54
|
+
"CompressedTensorsW8A8Int8MoEMethod",
|
|
55
|
+
"CompressedTensorsWNA16MarlinMoEMethod",
|
|
56
|
+
"CompressedTensorsWNA16MoEMethod",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class CompressedTensorsMoEMethod(FusedMoEMethodBase):
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
def get_moe_method(
|
|
64
|
+
quant_config: "CompressedTensorsConfig", # type: ignore # noqa E501
|
|
65
|
+
layer: torch.nn.Module,
|
|
66
|
+
) -> "CompressedTensorsMoEMethod":
|
|
67
|
+
# TODO: @dsikka: refactor this to use schemes as other kernels
|
|
68
|
+
# are supported + check if the layer is being ignored.
|
|
69
|
+
weight_quant = quant_config.target_scheme_map["Linear"].get("weights")
|
|
70
|
+
input_quant = quant_config.target_scheme_map["Linear"].get(
|
|
71
|
+
"input_activations")
|
|
72
|
+
|
|
73
|
+
if quant_config._is_wNa16_group_channel(weight_quant, input_quant):
|
|
74
|
+
# group_size=None means channelwise
|
|
75
|
+
group_size = weight_quant.group_size or -1
|
|
76
|
+
# Prefer to use the MarlinMoE kernel when it is supported.
|
|
77
|
+
if not check_moe_marlin_supports_layer(layer, group_size):
|
|
78
|
+
if (weight_quant.strategy in QuantizationStrategy.GROUP and
|
|
79
|
+
weight_quant.actorder in (ActivationOrdering.GROUP,
|
|
80
|
+
ActivationOrdering.DYNAMIC)):
|
|
81
|
+
raise ValueError(
|
|
82
|
+
"WNA16MoE is not supported with actorder=group/dynamic."
|
|
83
|
+
)
|
|
84
|
+
logger.info_once("Using CompressedTensorsWNA16MoEMethod")
|
|
85
|
+
return CompressedTensorsWNA16MoEMethod(quant_config)
|
|
86
|
+
else:
|
|
87
|
+
logger.info_once("Using CompressedTensorsWNA16MarlinMoEMethod")
|
|
88
|
+
return CompressedTensorsWNA16MarlinMoEMethod(quant_config)
|
|
89
|
+
elif quant_config._is_fp8_w8a8_sm90(weight_quant, input_quant):
|
|
90
|
+
return CompressedTensorsW8A8Fp8MoECutlassMethod(quant_config)
|
|
91
|
+
elif quant_config._is_fp8_w8a8(weight_quant, input_quant):
|
|
92
|
+
return CompressedTensorsW8A8Fp8MoEMethod(quant_config)
|
|
93
|
+
elif quant_config._is_dynamic_token_w8a8(weight_quant, input_quant):
|
|
94
|
+
return CompressedTensorsW8A8Int8MoEMethod(quant_config)
|
|
95
|
+
else:
|
|
96
|
+
raise RuntimeError(
|
|
97
|
+
f"Unsupported FusedMoe scheme: {weight_quant}, {input_quant}")
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class CompressedTensorsW8A8Fp8MoEMethod(CompressedTensorsMoEMethod):
|
|
101
|
+
|
|
102
|
+
def __init__(
|
|
103
|
+
self,
|
|
104
|
+
quant_config: "CompressedTensorsConfig" # type: ignore # noqa E501
|
|
105
|
+
):
|
|
106
|
+
self.quant_config = quant_config
|
|
107
|
+
self.weight_quant = self.quant_config.target_scheme_map["Linear"].get(
|
|
108
|
+
"weights")
|
|
109
|
+
self.input_quant = self.quant_config.target_scheme_map["Linear"].get(
|
|
110
|
+
"input_activations")
|
|
111
|
+
|
|
112
|
+
per_tensor = (self.weight_quant.strategy == QuantizationStrategy.TENSOR
|
|
113
|
+
and self.input_quant.strategy
|
|
114
|
+
== QuantizationStrategy.TENSOR)
|
|
115
|
+
per_channel = (
|
|
116
|
+
self.weight_quant.strategy == QuantizationStrategy.CHANNEL
|
|
117
|
+
and self.input_quant.strategy == QuantizationStrategy.TOKEN)
|
|
118
|
+
if not (per_tensor or per_channel):
|
|
119
|
+
raise ValueError(
|
|
120
|
+
"For FP8 Fused MoE layers, we require per tensor "
|
|
121
|
+
"or channelwise, dynamic per token quantization. Found "
|
|
122
|
+
f"{self.weight_quant}, {self.input_quant}")
|
|
123
|
+
|
|
124
|
+
self.static_input_scales = not self.input_quant.dynamic
|
|
125
|
+
if self.static_input_scales and per_channel:
|
|
126
|
+
raise ValueError(
|
|
127
|
+
"For FP8 Fused MoE layer, we require either per tensor or "
|
|
128
|
+
"channelwise, dynamic per token quantization.")
|
|
129
|
+
|
|
130
|
+
# For GPUs that lack FP8 hardware support, we can leverage the Marlin
|
|
131
|
+
# kernel for fast weight-only FP8 quantization
|
|
132
|
+
self.use_marlin = (not current_platform.has_device_capability(89)
|
|
133
|
+
or envs.VLLM_TEST_FORCE_FP8_MARLIN)
|
|
134
|
+
# Disable marlin for rocm
|
|
135
|
+
if current_platform.is_rocm():
|
|
136
|
+
self.use_marlin = False
|
|
137
|
+
from vllm.model_executor.layers.fused_moe.rocm_aiter_fused_moe import (
|
|
138
|
+
is_rocm_aiter_moe_enabled)
|
|
139
|
+
|
|
140
|
+
self.rocm_aiter_moe_enabled = is_rocm_aiter_moe_enabled()
|
|
141
|
+
|
|
142
|
+
def create_weights(self, layer: torch.nn.Module, num_experts: int,
|
|
143
|
+
hidden_size: int, intermediate_size_per_partition: int,
|
|
144
|
+
params_dtype: torch.dtype, **extra_weight_attrs):
|
|
145
|
+
|
|
146
|
+
layer.intermediate_size_per_partition = intermediate_size_per_partition
|
|
147
|
+
layer.hidden_size = hidden_size
|
|
148
|
+
layer.num_experts = num_experts
|
|
149
|
+
layer.orig_dtype = params_dtype
|
|
150
|
+
layer.weight_block_size = None
|
|
151
|
+
|
|
152
|
+
params_dtype = torch.float8_e4m3fn
|
|
153
|
+
|
|
154
|
+
# WEIGHTS
|
|
155
|
+
w13_weight = torch.nn.Parameter(torch.empty(
|
|
156
|
+
num_experts,
|
|
157
|
+
2 * intermediate_size_per_partition,
|
|
158
|
+
hidden_size,
|
|
159
|
+
dtype=params_dtype),
|
|
160
|
+
requires_grad=False)
|
|
161
|
+
layer.register_parameter("w13_weight", w13_weight)
|
|
162
|
+
set_weight_attrs(w13_weight, extra_weight_attrs)
|
|
163
|
+
|
|
164
|
+
w2_weight = torch.nn.Parameter(torch.empty(
|
|
165
|
+
num_experts,
|
|
166
|
+
hidden_size,
|
|
167
|
+
intermediate_size_per_partition,
|
|
168
|
+
dtype=params_dtype),
|
|
169
|
+
requires_grad=False)
|
|
170
|
+
layer.register_parameter("w2_weight", w2_weight)
|
|
171
|
+
set_weight_attrs(w2_weight, extra_weight_attrs)
|
|
172
|
+
|
|
173
|
+
# WEIGHT_SCALES
|
|
174
|
+
if self.weight_quant.strategy == QuantizationStrategy.TENSOR:
|
|
175
|
+
# Allocate 2 scales for w1 and w3 respectively.
|
|
176
|
+
# They are combined to a single scale after weight loading.
|
|
177
|
+
w13_weight_scale = torch.nn.Parameter(torch.ones(
|
|
178
|
+
num_experts, 2, dtype=torch.float32),
|
|
179
|
+
requires_grad=False)
|
|
180
|
+
layer.register_parameter("w13_weight_scale", w13_weight_scale)
|
|
181
|
+
w2_weight_scale = torch.nn.Parameter(torch.ones(
|
|
182
|
+
num_experts, dtype=torch.float32),
|
|
183
|
+
requires_grad=False)
|
|
184
|
+
layer.register_parameter("w2_weight_scale", w2_weight_scale)
|
|
185
|
+
# Add PER-TENSOR quantization for FusedMoE.weight_loader.
|
|
186
|
+
extra_weight_attrs.update(
|
|
187
|
+
{"quant_method": FusedMoeWeightScaleSupported.TENSOR.value})
|
|
188
|
+
set_weight_attrs(w13_weight_scale, extra_weight_attrs)
|
|
189
|
+
set_weight_attrs(w2_weight_scale, extra_weight_attrs)
|
|
190
|
+
|
|
191
|
+
elif self.weight_quant.strategy == QuantizationStrategy.CHANNEL:
|
|
192
|
+
w13_weight_scale = torch.nn.Parameter(torch.ones(
|
|
193
|
+
num_experts,
|
|
194
|
+
2 * intermediate_size_per_partition,
|
|
195
|
+
1,
|
|
196
|
+
dtype=torch.float32),
|
|
197
|
+
requires_grad=False)
|
|
198
|
+
layer.register_parameter("w13_weight_scale", w13_weight_scale)
|
|
199
|
+
w2_weight_scale = torch.nn.Parameter(torch.ones(
|
|
200
|
+
num_experts, hidden_size, 1, dtype=torch.float32),
|
|
201
|
+
requires_grad=False)
|
|
202
|
+
layer.register_parameter("w2_weight_scale", w2_weight_scale)
|
|
203
|
+
# Add PER-CHANNEL quantization for FusedMoE.weight_loader.
|
|
204
|
+
extra_weight_attrs.update(
|
|
205
|
+
{"quant_method": FusedMoeWeightScaleSupported.CHANNEL.value})
|
|
206
|
+
set_weight_attrs(w13_weight_scale, extra_weight_attrs)
|
|
207
|
+
set_weight_attrs(w2_weight_scale, extra_weight_attrs)
|
|
208
|
+
|
|
209
|
+
# INPUT_SCALES
|
|
210
|
+
if self.static_input_scales:
|
|
211
|
+
w13_input_scale = torch.nn.Parameter(torch.ones(
|
|
212
|
+
num_experts, dtype=torch.float32),
|
|
213
|
+
requires_grad=False)
|
|
214
|
+
layer.register_parameter("w13_input_scale", w13_input_scale)
|
|
215
|
+
set_weight_attrs(w13_input_scale, extra_weight_attrs)
|
|
216
|
+
|
|
217
|
+
w2_input_scale = torch.nn.Parameter(torch.ones(
|
|
218
|
+
num_experts, dtype=torch.float32),
|
|
219
|
+
requires_grad=False)
|
|
220
|
+
layer.register_parameter("w2_input_scale", w2_input_scale)
|
|
221
|
+
set_weight_attrs(w2_input_scale, extra_weight_attrs)
|
|
222
|
+
else:
|
|
223
|
+
layer.w13_input_scale = None
|
|
224
|
+
layer.w2_input_scale = None
|
|
225
|
+
|
|
226
|
+
def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
|
|
227
|
+
# Fp8 moe kernels require a single activation scale.
|
|
228
|
+
# We take the max of all the scales in case they differ.
|
|
229
|
+
if self.static_input_scales:
|
|
230
|
+
assert self.input_quant.strategy == QuantizationStrategy.TENSOR
|
|
231
|
+
if (layer.w13_input_scale is None or layer.w2_input_scale is None):
|
|
232
|
+
raise ValueError(
|
|
233
|
+
"QuantConfig has static quantization, but found "
|
|
234
|
+
"activation scales are None.")
|
|
235
|
+
if (not all_close_1d(layer.w13_input_scale)
|
|
236
|
+
or not all_close_1d(layer.w2_input_scale)):
|
|
237
|
+
logger.warning_once(
|
|
238
|
+
"Found input_scales that are not equal for "
|
|
239
|
+
"fp8 MoE layer. Using the maximum across experts "
|
|
240
|
+
"for each layer.")
|
|
241
|
+
layer.w13_input_scale = torch.nn.Parameter(
|
|
242
|
+
layer.w13_input_scale.max(), requires_grad=False)
|
|
243
|
+
layer.w2_input_scale = torch.nn.Parameter(
|
|
244
|
+
layer.w2_input_scale.max(), requires_grad=False)
|
|
245
|
+
|
|
246
|
+
if current_platform.is_fp8_fnuz():
|
|
247
|
+
# Normalize the weights and scales
|
|
248
|
+
w13_weight, w13_weight_scale, w13_input_scale = \
|
|
249
|
+
normalize_e4m3fn_to_e4m3fnuz(
|
|
250
|
+
layer.w13_weight, layer.w13_weight_scale,
|
|
251
|
+
layer.w13_input_scale)
|
|
252
|
+
w2_weight, w2_weight_scale, w2_input_scale = \
|
|
253
|
+
normalize_e4m3fn_to_e4m3fnuz(
|
|
254
|
+
layer.w2_weight, layer.w2_weight_scale,
|
|
255
|
+
layer.w2_input_scale)
|
|
256
|
+
# Reset the parameter
|
|
257
|
+
layer.w13_weight = torch.nn.Parameter(w13_weight,
|
|
258
|
+
requires_grad=False)
|
|
259
|
+
layer.w13_weight_scale = torch.nn.Parameter(w13_weight_scale,
|
|
260
|
+
requires_grad=False)
|
|
261
|
+
if w13_input_scale is not None:
|
|
262
|
+
layer.w13_input_scale = torch.nn.Parameter(w13_input_scale,
|
|
263
|
+
requires_grad=False)
|
|
264
|
+
layer.w2_weight = torch.nn.Parameter(w2_weight,
|
|
265
|
+
requires_grad=False)
|
|
266
|
+
layer.w2_weight_scale = torch.nn.Parameter(w2_weight_scale,
|
|
267
|
+
requires_grad=False)
|
|
268
|
+
if w2_input_scale is not None:
|
|
269
|
+
layer.w2_input_scale = torch.nn.Parameter(w2_input_scale,
|
|
270
|
+
requires_grad=False)
|
|
271
|
+
|
|
272
|
+
# For Per-TENSOR case, Fp8 moe kernel needs single weight scale
|
|
273
|
+
# for w13 per expert. Use max then dequant and requant each expert.
|
|
274
|
+
if self.weight_quant.strategy == QuantizationStrategy.TENSOR:
|
|
275
|
+
assert layer.w13_weight_scale is not None
|
|
276
|
+
shard_size = layer.intermediate_size_per_partition
|
|
277
|
+
max_w13_scales = layer.w13_weight_scale.max(dim=1).values
|
|
278
|
+
for expert_id in range(layer.local_num_experts):
|
|
279
|
+
start = 0
|
|
280
|
+
for shard_id in range(2):
|
|
281
|
+
dq_weight = per_tensor_dequantize(
|
|
282
|
+
layer.w13_weight[expert_id][start:start +
|
|
283
|
+
shard_size, :],
|
|
284
|
+
layer.w13_weight_scale[expert_id][shard_id])
|
|
285
|
+
layer.w13_weight[expert_id][
|
|
286
|
+
start:start + shard_size, :], _ = ops.scaled_fp8_quant(
|
|
287
|
+
dq_weight, max_w13_scales[expert_id])
|
|
288
|
+
start += shard_size
|
|
289
|
+
layer.w13_weight_scale = torch.nn.Parameter(max_w13_scales,
|
|
290
|
+
requires_grad=False)
|
|
291
|
+
|
|
292
|
+
# Property to determine if AITER is used
|
|
293
|
+
if self.rocm_aiter_moe_enabled:
|
|
294
|
+
from vllm.model_executor.layers.fused_moe.rocm_aiter_fused_moe import ( # noqa E501
|
|
295
|
+
rocm_aiter_fused_experts, shuffle_weights)
|
|
296
|
+
|
|
297
|
+
# reshaping weights is required for aiter moe kernel.
|
|
298
|
+
shuffled_w13, shuffled_w2 = shuffle_weights(
|
|
299
|
+
layer.w13_weight.data, layer.w2_weight.data)
|
|
300
|
+
|
|
301
|
+
layer.w13_weight = torch.nn.Parameter(shuffled_w13,
|
|
302
|
+
requires_grad=False)
|
|
303
|
+
layer.w2_weight = torch.nn.Parameter(shuffled_w2,
|
|
304
|
+
requires_grad=False)
|
|
305
|
+
|
|
306
|
+
self.rocm_aiter_fused_experts_func = rocm_aiter_fused_experts
|
|
307
|
+
else:
|
|
308
|
+
from vllm.model_executor.layers.fused_moe import fused_experts
|
|
309
|
+
self.fused_experts_func = fused_experts
|
|
310
|
+
|
|
311
|
+
if self.use_marlin:
|
|
312
|
+
prepare_moe_fp8_layer_for_marlin(layer, False)
|
|
313
|
+
# Activations not quantized for marlin.
|
|
314
|
+
del layer.w13_input_scale
|
|
315
|
+
del layer.w2_input_scale
|
|
316
|
+
|
|
317
|
+
def apply(
|
|
318
|
+
self,
|
|
319
|
+
layer: torch.nn.Module,
|
|
320
|
+
x: torch.Tensor,
|
|
321
|
+
router_logits: torch.Tensor,
|
|
322
|
+
top_k: int,
|
|
323
|
+
renormalize: bool,
|
|
324
|
+
use_grouped_topk: bool = False,
|
|
325
|
+
topk_group: Optional[int] = None,
|
|
326
|
+
num_expert_group: Optional[int] = None,
|
|
327
|
+
global_num_experts: int = -1,
|
|
328
|
+
expert_map: Optional[torch.Tensor] = None,
|
|
329
|
+
custom_routing_function: Optional[Callable] = None,
|
|
330
|
+
scoring_func: str = "softmax",
|
|
331
|
+
e_score_correction_bias: Optional[torch.Tensor] = None,
|
|
332
|
+
apply_router_weight_on_input: bool = False,
|
|
333
|
+
activation: str = "silu",
|
|
334
|
+
) -> torch.Tensor:
|
|
335
|
+
|
|
336
|
+
topk_weights, topk_ids = FusedMoE.select_experts(
|
|
337
|
+
hidden_states=x,
|
|
338
|
+
router_logits=router_logits,
|
|
339
|
+
use_grouped_topk=use_grouped_topk,
|
|
340
|
+
top_k=top_k,
|
|
341
|
+
renormalize=renormalize,
|
|
342
|
+
topk_group=topk_group,
|
|
343
|
+
num_expert_group=num_expert_group,
|
|
344
|
+
custom_routing_function=custom_routing_function,
|
|
345
|
+
scoring_func=scoring_func,
|
|
346
|
+
e_score_correction_bias=e_score_correction_bias)
|
|
347
|
+
|
|
348
|
+
if self.rocm_aiter_moe_enabled:
|
|
349
|
+
return self.rocm_aiter_fused_experts_func(
|
|
350
|
+
hidden_states=x,
|
|
351
|
+
w1=layer.w13_weight,
|
|
352
|
+
w2=layer.w2_weight,
|
|
353
|
+
topk_weights=topk_weights,
|
|
354
|
+
topk_ids=topk_ids,
|
|
355
|
+
activation=activation,
|
|
356
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
357
|
+
use_fp8_w8a8=True,
|
|
358
|
+
per_channel_quant=self.weight_quant.strategy ==
|
|
359
|
+
QuantizationStrategy.CHANNEL,
|
|
360
|
+
w1_scale=layer.w13_weight_scale,
|
|
361
|
+
w2_scale=layer.w2_weight_scale,
|
|
362
|
+
a1_scale=layer.w13_input_scale,
|
|
363
|
+
a2_scale=layer.w2_input_scale)
|
|
364
|
+
if self.use_marlin:
|
|
365
|
+
assert activation == "silu", (
|
|
366
|
+
f"{activation} not supported for Marlin MoE.")
|
|
367
|
+
assert not apply_router_weight_on_input, (
|
|
368
|
+
"Apply router weight on input not supported for Marlin MoE.")
|
|
369
|
+
return torch.ops.vllm.fused_marlin_moe(
|
|
370
|
+
x,
|
|
371
|
+
layer.w13_weight,
|
|
372
|
+
layer.w2_weight,
|
|
373
|
+
layer.w13_weight_scale,
|
|
374
|
+
layer.w2_weight_scale,
|
|
375
|
+
router_logits,
|
|
376
|
+
topk_weights,
|
|
377
|
+
topk_ids,
|
|
378
|
+
quant_type_id=scalar_types.float8_e4m3fn.id,
|
|
379
|
+
global_num_experts=global_num_experts,
|
|
380
|
+
expert_map=expert_map)
|
|
381
|
+
|
|
382
|
+
return self.fused_experts_func(
|
|
383
|
+
hidden_states=x,
|
|
384
|
+
w1=layer.w13_weight,
|
|
385
|
+
w2=layer.w2_weight,
|
|
386
|
+
topk_weights=topk_weights,
|
|
387
|
+
topk_ids=topk_ids,
|
|
388
|
+
inplace=True,
|
|
389
|
+
activation=activation,
|
|
390
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
391
|
+
use_fp8_w8a8=True,
|
|
392
|
+
per_channel_quant=self.weight_quant.strategy ==
|
|
393
|
+
QuantizationStrategy.CHANNEL,
|
|
394
|
+
global_num_experts=global_num_experts,
|
|
395
|
+
expert_map=expert_map,
|
|
396
|
+
w1_scale=layer.w13_weight_scale,
|
|
397
|
+
w2_scale=layer.w2_weight_scale,
|
|
398
|
+
a1_scale=layer.w13_input_scale,
|
|
399
|
+
a2_scale=layer.w2_input_scale)
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
class CompressedTensorsW8A8Fp8MoECutlassMethod(CompressedTensorsMoEMethod):
|
|
403
|
+
|
|
404
|
+
def __init__(
|
|
405
|
+
self,
|
|
406
|
+
quant_config: "CompressedTensorsConfig" # type: ignore # noqa E501
|
|
407
|
+
):
|
|
408
|
+
self.quant_config = quant_config
|
|
409
|
+
self.weight_quant = self.quant_config.target_scheme_map["Linear"].get(
|
|
410
|
+
"weights")
|
|
411
|
+
self.input_quant = self.quant_config.target_scheme_map["Linear"].get(
|
|
412
|
+
"input_activations")
|
|
413
|
+
|
|
414
|
+
per_tensor = (self.weight_quant.strategy == QuantizationStrategy.TENSOR
|
|
415
|
+
and self.input_quant.strategy
|
|
416
|
+
== QuantizationStrategy.TENSOR)
|
|
417
|
+
per_channel = (
|
|
418
|
+
self.weight_quant.strategy == QuantizationStrategy.CHANNEL
|
|
419
|
+
and self.input_quant.strategy == QuantizationStrategy.TOKEN)
|
|
420
|
+
if not (per_tensor or per_channel):
|
|
421
|
+
raise ValueError(
|
|
422
|
+
"For FP8 Fused MoE layers, we require per tensor "
|
|
423
|
+
"or channelwise, dynamic per token quantization. Found "
|
|
424
|
+
f"{self.weight_quant}, {self.input_quant}")
|
|
425
|
+
|
|
426
|
+
self.static_input_scales = not self.input_quant.dynamic
|
|
427
|
+
if self.static_input_scales and per_channel:
|
|
428
|
+
raise ValueError(
|
|
429
|
+
"For FP8 Fused MoE layer, we require either per tensor or "
|
|
430
|
+
"channelwise, dynamic per token quantization.")
|
|
431
|
+
|
|
432
|
+
from vllm.model_executor.layers.fused_moe.cutlass_moe import (
|
|
433
|
+
cutlass_moe_fp8)
|
|
434
|
+
self.fused_experts = cutlass_moe_fp8 # type: ignore
|
|
435
|
+
self.disable_expert_map = False
|
|
436
|
+
|
|
437
|
+
def create_weights(self, layer: torch.nn.Module, num_experts: int,
|
|
438
|
+
hidden_size: int, intermediate_size_per_partition: int,
|
|
439
|
+
params_dtype: torch.dtype, **extra_weight_attrs):
|
|
440
|
+
|
|
441
|
+
params_dtype = torch.float8_e4m3fn
|
|
442
|
+
|
|
443
|
+
# WEIGHTS
|
|
444
|
+
w13_weight = torch.nn.Parameter(torch.empty(
|
|
445
|
+
num_experts,
|
|
446
|
+
2 * intermediate_size_per_partition,
|
|
447
|
+
hidden_size,
|
|
448
|
+
dtype=params_dtype),
|
|
449
|
+
requires_grad=False)
|
|
450
|
+
layer.register_parameter("w13_weight", w13_weight)
|
|
451
|
+
set_weight_attrs(w13_weight, extra_weight_attrs)
|
|
452
|
+
|
|
453
|
+
w2_weight = torch.nn.Parameter(torch.empty(
|
|
454
|
+
num_experts,
|
|
455
|
+
hidden_size,
|
|
456
|
+
intermediate_size_per_partition,
|
|
457
|
+
dtype=params_dtype),
|
|
458
|
+
requires_grad=False)
|
|
459
|
+
layer.register_parameter("w2_weight", w2_weight)
|
|
460
|
+
set_weight_attrs(w2_weight, extra_weight_attrs)
|
|
461
|
+
|
|
462
|
+
# WEIGHT_SCALES
|
|
463
|
+
if self.weight_quant.strategy == QuantizationStrategy.TENSOR:
|
|
464
|
+
# Allocate 2 scales for w1 and w3 respectively.
|
|
465
|
+
# They are combined to a single scale after weight loading.
|
|
466
|
+
w13_weight_scale = torch.nn.Parameter(torch.ones(
|
|
467
|
+
num_experts, 2, dtype=torch.float32),
|
|
468
|
+
requires_grad=False)
|
|
469
|
+
layer.register_parameter("w13_weight_scale", w13_weight_scale)
|
|
470
|
+
w2_weight_scale = torch.nn.Parameter(torch.ones(
|
|
471
|
+
num_experts, dtype=torch.float32),
|
|
472
|
+
requires_grad=False)
|
|
473
|
+
layer.register_parameter("w2_weight_scale", w2_weight_scale)
|
|
474
|
+
# Add PER-TENSOR quantization for FusedMoE.weight_loader.
|
|
475
|
+
extra_weight_attrs.update(
|
|
476
|
+
{"quant_method": FusedMoeWeightScaleSupported.TENSOR.value})
|
|
477
|
+
set_weight_attrs(w13_weight_scale, extra_weight_attrs)
|
|
478
|
+
set_weight_attrs(w2_weight_scale, extra_weight_attrs)
|
|
479
|
+
|
|
480
|
+
elif self.weight_quant.strategy == QuantizationStrategy.CHANNEL:
|
|
481
|
+
w13_weight_scale = torch.nn.Parameter(torch.ones(
|
|
482
|
+
num_experts,
|
|
483
|
+
2 * intermediate_size_per_partition,
|
|
484
|
+
1,
|
|
485
|
+
dtype=torch.float32),
|
|
486
|
+
requires_grad=False)
|
|
487
|
+
layer.register_parameter("w13_weight_scale", w13_weight_scale)
|
|
488
|
+
w2_weight_scale = torch.nn.Parameter(torch.ones(
|
|
489
|
+
num_experts, hidden_size, 1, dtype=torch.float32),
|
|
490
|
+
requires_grad=False)
|
|
491
|
+
layer.register_parameter("w2_weight_scale", w2_weight_scale)
|
|
492
|
+
# Add PER-CHANNEL quantization for FusedMoE.weight_loader.
|
|
493
|
+
extra_weight_attrs.update(
|
|
494
|
+
{"quant_method": FusedMoeWeightScaleSupported.CHANNEL.value})
|
|
495
|
+
set_weight_attrs(w13_weight_scale, extra_weight_attrs)
|
|
496
|
+
set_weight_attrs(w2_weight_scale, extra_weight_attrs)
|
|
497
|
+
|
|
498
|
+
# INPUT_SCALES
|
|
499
|
+
if self.static_input_scales:
|
|
500
|
+
w13_input_scale = torch.nn.Parameter(torch.ones(
|
|
501
|
+
num_experts, dtype=torch.float32),
|
|
502
|
+
requires_grad=False)
|
|
503
|
+
layer.register_parameter("w13_input_scale", w13_input_scale)
|
|
504
|
+
set_weight_attrs(w13_input_scale, extra_weight_attrs)
|
|
505
|
+
|
|
506
|
+
w2_input_scale = torch.nn.Parameter(torch.ones(
|
|
507
|
+
num_experts, dtype=torch.float32),
|
|
508
|
+
requires_grad=False)
|
|
509
|
+
layer.register_parameter("w2_input_scale", w2_input_scale)
|
|
510
|
+
set_weight_attrs(w2_input_scale, extra_weight_attrs)
|
|
511
|
+
else:
|
|
512
|
+
layer.w13_input_scale = None
|
|
513
|
+
layer.w2_input_scale = None
|
|
514
|
+
|
|
515
|
+
def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
|
|
516
|
+
# Fp8 moe kernels require a single activation scale.
|
|
517
|
+
# We take the max of all the scales in case they differ.
|
|
518
|
+
if self.static_input_scales:
|
|
519
|
+
assert self.input_quant.strategy == QuantizationStrategy.TENSOR
|
|
520
|
+
if (layer.w13_input_scale is None or layer.w2_input_scale is None):
|
|
521
|
+
raise ValueError(
|
|
522
|
+
"QuantConfig has static quantization, but found "
|
|
523
|
+
"activation scales are None.")
|
|
524
|
+
if (not all_close_1d(layer.w13_input_scale)
|
|
525
|
+
or not all_close_1d(layer.w2_input_scale)):
|
|
526
|
+
logger.warning_once(
|
|
527
|
+
"Found input_scales that are not equal for "
|
|
528
|
+
"fp8 MoE layer. Using the maximum across experts "
|
|
529
|
+
"for each layer.")
|
|
530
|
+
layer.w13_input_scale = torch.nn.Parameter(
|
|
531
|
+
layer.w13_input_scale.max(), requires_grad=False)
|
|
532
|
+
layer.w2_input_scale = torch.nn.Parameter(
|
|
533
|
+
layer.w2_input_scale.max(), requires_grad=False)
|
|
534
|
+
|
|
535
|
+
# For Per-TENSOR case, Fp8 moe kernel needs single weight scale
|
|
536
|
+
# for w13 per expert. Use max then dequant and requant each expert.
|
|
537
|
+
if self.weight_quant.strategy == QuantizationStrategy.TENSOR:
|
|
538
|
+
assert layer.w13_weight_scale is not None
|
|
539
|
+
shard_size = layer.intermediate_size_per_partition
|
|
540
|
+
max_w13_scales = layer.w13_weight_scale.max(dim=1).values
|
|
541
|
+
for expert_id in range(layer.local_num_experts):
|
|
542
|
+
start = 0
|
|
543
|
+
for shard_id in range(2):
|
|
544
|
+
dq_weight = per_tensor_dequantize(
|
|
545
|
+
layer.w13_weight[expert_id][start:start +
|
|
546
|
+
shard_size, :],
|
|
547
|
+
layer.w13_weight_scale[expert_id][shard_id])
|
|
548
|
+
layer.w13_weight[expert_id][
|
|
549
|
+
start:start + shard_size, :], _ = ops.scaled_fp8_quant(
|
|
550
|
+
dq_weight, max_w13_scales[expert_id])
|
|
551
|
+
start += shard_size
|
|
552
|
+
layer.w13_weight_scale = torch.nn.Parameter(max_w13_scales,
|
|
553
|
+
requires_grad=False)
|
|
554
|
+
|
|
555
|
+
def select_gemm_impl(self, prepare_finalize, moe):
|
|
556
|
+
from vllm.model_executor.layers.fused_moe.cutlass_moe import (
|
|
557
|
+
CutlassExpertsFp8)
|
|
558
|
+
|
|
559
|
+
assert moe is not None
|
|
560
|
+
|
|
561
|
+
max_experts_per_worker = (
|
|
562
|
+
(moe.num_experts + prepare_finalize.world_size - 1) //
|
|
563
|
+
prepare_finalize.world_size)
|
|
564
|
+
experts = CutlassExpertsFp8(
|
|
565
|
+
max_experts_per_worker, moe.in_dtype,
|
|
566
|
+
self.input_quant.strategy == QuantizationStrategy.TOKEN,
|
|
567
|
+
self.weight_quant.strategy == QuantizationStrategy.CHANNEL)
|
|
568
|
+
|
|
569
|
+
if has_pplx and isinstance(
|
|
570
|
+
prepare_finalize,
|
|
571
|
+
(BatchedPrepareAndFinalize, PplxPrepareAndFinalize)):
|
|
572
|
+
# no expert_map support in this case
|
|
573
|
+
self.disable_expert_map = True
|
|
574
|
+
return experts
|
|
575
|
+
|
|
576
|
+
def apply(
|
|
577
|
+
self,
|
|
578
|
+
layer: torch.nn.Module,
|
|
579
|
+
x: torch.Tensor,
|
|
580
|
+
router_logits: torch.Tensor,
|
|
581
|
+
top_k: int,
|
|
582
|
+
renormalize: bool,
|
|
583
|
+
use_grouped_topk: bool = False,
|
|
584
|
+
topk_group: Optional[int] = None,
|
|
585
|
+
num_expert_group: Optional[int] = None,
|
|
586
|
+
global_num_experts: int = -1,
|
|
587
|
+
expert_map: Optional[torch.Tensor] = None,
|
|
588
|
+
custom_routing_function: Optional[Callable] = None,
|
|
589
|
+
scoring_func: str = "softmax",
|
|
590
|
+
e_score_correction_bias: Optional[torch.Tensor] = None,
|
|
591
|
+
apply_router_weight_on_input: bool = False,
|
|
592
|
+
activation: str = "silu",
|
|
593
|
+
) -> torch.Tensor:
|
|
594
|
+
|
|
595
|
+
topk_weights, topk_ids = FusedMoE.select_experts(
|
|
596
|
+
hidden_states=x,
|
|
597
|
+
router_logits=router_logits,
|
|
598
|
+
use_grouped_topk=use_grouped_topk,
|
|
599
|
+
top_k=top_k,
|
|
600
|
+
renormalize=renormalize,
|
|
601
|
+
topk_group=topk_group,
|
|
602
|
+
num_expert_group=num_expert_group,
|
|
603
|
+
custom_routing_function=custom_routing_function,
|
|
604
|
+
scoring_func=scoring_func,
|
|
605
|
+
e_score_correction_bias=e_score_correction_bias,
|
|
606
|
+
indices_type=torch.uint32)
|
|
607
|
+
|
|
608
|
+
return self.fused_experts(
|
|
609
|
+
x,
|
|
610
|
+
layer.w13_weight,
|
|
611
|
+
layer.w2_weight,
|
|
612
|
+
topk_weights,
|
|
613
|
+
topk_ids,
|
|
614
|
+
activation=activation,
|
|
615
|
+
global_num_experts=global_num_experts,
|
|
616
|
+
expert_map=None if self.disable_expert_map else expert_map,
|
|
617
|
+
w1_scale=layer.w13_weight_scale,
|
|
618
|
+
w2_scale=layer.w2_weight_scale,
|
|
619
|
+
a1_scale=layer.w13_input_scale,
|
|
620
|
+
a2_scale=layer.w2_input_scale,
|
|
621
|
+
)
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
class CompressedTensorsW8A8Int8MoEMethod(CompressedTensorsMoEMethod):
|
|
625
|
+
|
|
626
|
+
def __init__(
|
|
627
|
+
self,
|
|
628
|
+
quant_config: "CompressedTensorsConfig" # type: ignore # noqa E501
|
|
629
|
+
):
|
|
630
|
+
self.quant_config = quant_config
|
|
631
|
+
self.weight_quant = self.quant_config.target_scheme_map["Linear"].get(
|
|
632
|
+
"weights")
|
|
633
|
+
self.input_quant = self.quant_config.target_scheme_map["Linear"].get(
|
|
634
|
+
"input_activations")
|
|
635
|
+
|
|
636
|
+
per_channel = (
|
|
637
|
+
self.weight_quant.strategy == QuantizationStrategy.CHANNEL
|
|
638
|
+
and self.input_quant.strategy == QuantizationStrategy.TOKEN)
|
|
639
|
+
if not per_channel:
|
|
640
|
+
raise ValueError(
|
|
641
|
+
"For INT8 Fused MoE layers, we require channelwise, "
|
|
642
|
+
"dynamic per token quantization. Found "
|
|
643
|
+
f"{self.weight_quant}, {self.input_quant}")
|
|
644
|
+
|
|
645
|
+
self.static_input_scales = not self.input_quant.dynamic
|
|
646
|
+
if self.static_input_scales:
|
|
647
|
+
raise ValueError(
|
|
648
|
+
"For INT8 Fused MoE layers, we require channelwise, "
|
|
649
|
+
"dynamic per token quantization. Found static input scales.")
|
|
650
|
+
|
|
651
|
+
def create_weights(self, layer: torch.nn.Module, num_experts: int,
|
|
652
|
+
hidden_size: int, intermediate_size_per_partition: int,
|
|
653
|
+
params_dtype: torch.dtype, **extra_weight_attrs):
|
|
654
|
+
|
|
655
|
+
params_dtype = torch.int8
|
|
656
|
+
|
|
657
|
+
# WEIGHTS
|
|
658
|
+
w13_weight = torch.nn.Parameter(torch.empty(
|
|
659
|
+
num_experts,
|
|
660
|
+
2 * intermediate_size_per_partition,
|
|
661
|
+
hidden_size,
|
|
662
|
+
dtype=params_dtype),
|
|
663
|
+
requires_grad=False)
|
|
664
|
+
layer.register_parameter("w13_weight", w13_weight)
|
|
665
|
+
set_weight_attrs(w13_weight, extra_weight_attrs)
|
|
666
|
+
|
|
667
|
+
w2_weight = torch.nn.Parameter(torch.empty(
|
|
668
|
+
num_experts,
|
|
669
|
+
hidden_size,
|
|
670
|
+
intermediate_size_per_partition,
|
|
671
|
+
dtype=params_dtype),
|
|
672
|
+
requires_grad=False)
|
|
673
|
+
layer.register_parameter("w2_weight", w2_weight)
|
|
674
|
+
set_weight_attrs(w2_weight, extra_weight_attrs)
|
|
675
|
+
|
|
676
|
+
# WEIGHT_SCALES
|
|
677
|
+
assert self.weight_quant.strategy == QuantizationStrategy.CHANNEL
|
|
678
|
+
w13_weight_scale = torch.nn.Parameter(torch.ones(
|
|
679
|
+
num_experts,
|
|
680
|
+
2 * intermediate_size_per_partition,
|
|
681
|
+
1,
|
|
682
|
+
dtype=torch.float32),
|
|
683
|
+
requires_grad=False)
|
|
684
|
+
layer.register_parameter("w13_weight_scale", w13_weight_scale)
|
|
685
|
+
w2_weight_scale = torch.nn.Parameter(torch.ones(num_experts,
|
|
686
|
+
hidden_size,
|
|
687
|
+
1,
|
|
688
|
+
dtype=torch.float32),
|
|
689
|
+
requires_grad=False)
|
|
690
|
+
layer.register_parameter("w2_weight_scale", w2_weight_scale)
|
|
691
|
+
# Add PER-CHANNEL quantization for FusedMoE.weight_loader.
|
|
692
|
+
extra_weight_attrs.update(
|
|
693
|
+
{"quant_method": FusedMoeWeightScaleSupported.CHANNEL.value})
|
|
694
|
+
set_weight_attrs(w13_weight_scale, extra_weight_attrs)
|
|
695
|
+
set_weight_attrs(w2_weight_scale, extra_weight_attrs)
|
|
696
|
+
|
|
697
|
+
# INPUT_SCALES
|
|
698
|
+
assert not self.static_input_scales
|
|
699
|
+
layer.w13_input_scale = None
|
|
700
|
+
layer.w2_input_scale = None
|
|
701
|
+
|
|
702
|
+
def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
|
|
703
|
+
pass
|
|
704
|
+
|
|
705
|
+
def apply(
|
|
706
|
+
self,
|
|
707
|
+
layer: torch.nn.Module,
|
|
708
|
+
x: torch.Tensor,
|
|
709
|
+
router_logits: torch.Tensor,
|
|
710
|
+
top_k: int,
|
|
711
|
+
renormalize: bool,
|
|
712
|
+
use_grouped_topk: bool = False,
|
|
713
|
+
topk_group: Optional[int] = None,
|
|
714
|
+
num_expert_group: Optional[int] = None,
|
|
715
|
+
global_num_experts: int = -1,
|
|
716
|
+
expert_map: Optional[torch.Tensor] = None,
|
|
717
|
+
custom_routing_function: Optional[Callable] = None,
|
|
718
|
+
scoring_func: str = "softmax",
|
|
719
|
+
e_score_correction_bias: Optional[torch.Tensor] = None,
|
|
720
|
+
apply_router_weight_on_input: bool = False,
|
|
721
|
+
activation: str = "silu",
|
|
722
|
+
) -> torch.Tensor:
|
|
723
|
+
from vllm.model_executor.layers.fused_moe import fused_experts
|
|
724
|
+
|
|
725
|
+
topk_weights, topk_ids = FusedMoE.select_experts(
|
|
726
|
+
hidden_states=x,
|
|
727
|
+
router_logits=router_logits,
|
|
728
|
+
use_grouped_topk=use_grouped_topk,
|
|
729
|
+
top_k=top_k,
|
|
730
|
+
renormalize=renormalize,
|
|
731
|
+
topk_group=topk_group,
|
|
732
|
+
num_expert_group=num_expert_group,
|
|
733
|
+
custom_routing_function=custom_routing_function,
|
|
734
|
+
scoring_func=scoring_func,
|
|
735
|
+
e_score_correction_bias=e_score_correction_bias)
|
|
736
|
+
|
|
737
|
+
return fused_experts(
|
|
738
|
+
hidden_states=x,
|
|
739
|
+
w1=layer.w13_weight,
|
|
740
|
+
w2=layer.w2_weight,
|
|
741
|
+
topk_weights=topk_weights,
|
|
742
|
+
topk_ids=topk_ids,
|
|
743
|
+
inplace=True,
|
|
744
|
+
activation=activation,
|
|
745
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
746
|
+
use_int8_w8a8=True,
|
|
747
|
+
per_channel_quant=True,
|
|
748
|
+
global_num_experts=global_num_experts,
|
|
749
|
+
expert_map=expert_map,
|
|
750
|
+
w1_scale=layer.w13_weight_scale,
|
|
751
|
+
w2_scale=layer.w2_weight_scale,
|
|
752
|
+
a1_scale=layer.w13_input_scale,
|
|
753
|
+
a2_scale=layer.w2_input_scale)
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
class CompressedTensorsWNA16MarlinMoEMethod(CompressedTensorsMoEMethod):
|
|
757
|
+
|
|
758
|
+
def __init__(
|
|
759
|
+
self,
|
|
760
|
+
quant_config: "CompressedTensorsConfig" # type: ignore # noqa E501
|
|
761
|
+
):
|
|
762
|
+
self.quant_config = quant_config
|
|
763
|
+
# TODO: @dsikka: refactor this to use schemes as other kernels
|
|
764
|
+
# are supported + check if the layer is being ignored.
|
|
765
|
+
config = self.quant_config.target_scheme_map["Linear"].get("weights")
|
|
766
|
+
self.num_bits = config.num_bits
|
|
767
|
+
self.packed_factor = 32 // config.num_bits
|
|
768
|
+
self.strategy = config.strategy
|
|
769
|
+
self.group_size = config.group_size
|
|
770
|
+
self.actorder = config.actorder
|
|
771
|
+
assert config.symmetric, (
|
|
772
|
+
"Only symmetric quantization is supported for MoE")
|
|
773
|
+
|
|
774
|
+
if not (self.quant_config.quant_format
|
|
775
|
+
== CompressionFormat.pack_quantized.value
|
|
776
|
+
and self.num_bits in WNA16_SUPPORTED_BITS):
|
|
777
|
+
raise ValueError("For Fused MoE layers, only ",
|
|
778
|
+
f"{CompressionFormat.pack_quantized.value} ",
|
|
779
|
+
"is supported for the following bits: ",
|
|
780
|
+
f"{WNA16_SUPPORTED_BITS}")
|
|
781
|
+
self.quant_type = WNA16_SUPPORTED_TYPES_MAP[self.num_bits]
|
|
782
|
+
|
|
783
|
+
def create_weights(self, layer: torch.nn.Module, num_experts: int,
|
|
784
|
+
hidden_size: int, intermediate_size_per_partition: int,
|
|
785
|
+
params_dtype: torch.dtype, **extra_weight_attrs):
|
|
786
|
+
|
|
787
|
+
intermediate_size_full = extra_weight_attrs.pop(
|
|
788
|
+
"intermediate_size_full")
|
|
789
|
+
|
|
790
|
+
# Will transpose the loaded weight along the
|
|
791
|
+
# intermediate and hidden dim sizes. Will
|
|
792
|
+
# shard for TP along the transposed dims
|
|
793
|
+
extra_weight_attrs.update({
|
|
794
|
+
"is_transposed": True,
|
|
795
|
+
"quant_method": self.strategy
|
|
796
|
+
})
|
|
797
|
+
w13_weight = torch.nn.Parameter(torch.empty(
|
|
798
|
+
num_experts,
|
|
799
|
+
hidden_size // self.packed_factor,
|
|
800
|
+
2 * intermediate_size_per_partition,
|
|
801
|
+
dtype=torch.int32),
|
|
802
|
+
requires_grad=False)
|
|
803
|
+
layer.register_parameter("w13_weight_packed", w13_weight)
|
|
804
|
+
set_weight_attrs(w13_weight, extra_weight_attrs)
|
|
805
|
+
|
|
806
|
+
w2_weight = torch.nn.Parameter(torch.empty(
|
|
807
|
+
num_experts,
|
|
808
|
+
intermediate_size_per_partition // self.packed_factor,
|
|
809
|
+
hidden_size,
|
|
810
|
+
dtype=torch.int32),
|
|
811
|
+
requires_grad=False)
|
|
812
|
+
layer.register_parameter("w2_weight_packed", w2_weight)
|
|
813
|
+
set_weight_attrs(w2_weight, extra_weight_attrs)
|
|
814
|
+
|
|
815
|
+
# In the case where we have actorder/g_idx,
|
|
816
|
+
# we do not partition the w2 scales
|
|
817
|
+
load_full_w2 = self.actorder and self.group_size != -1
|
|
818
|
+
w2_scales_size = (intermediate_size_full
|
|
819
|
+
if load_full_w2 else intermediate_size_per_partition)
|
|
820
|
+
|
|
821
|
+
self.is_k_full = (not self.actorder) or (
|
|
822
|
+
intermediate_size_per_partition == intermediate_size_full)
|
|
823
|
+
|
|
824
|
+
if self.strategy == "channel":
|
|
825
|
+
num_groups_w2 = num_groups_w13 = 1
|
|
826
|
+
self.group_size = -1
|
|
827
|
+
else:
|
|
828
|
+
num_groups_w2 = w2_scales_size // self.group_size
|
|
829
|
+
num_groups_w13 = hidden_size // self.group_size
|
|
830
|
+
|
|
831
|
+
w13_scale = torch.nn.Parameter(torch.ones(
|
|
832
|
+
num_experts,
|
|
833
|
+
num_groups_w13,
|
|
834
|
+
2 * intermediate_size_per_partition,
|
|
835
|
+
dtype=params_dtype),
|
|
836
|
+
requires_grad=False)
|
|
837
|
+
layer.register_parameter("w13_weight_scale", w13_scale)
|
|
838
|
+
set_weight_attrs(w13_scale, extra_weight_attrs)
|
|
839
|
+
|
|
840
|
+
w2_scale = torch.nn.Parameter(torch.ones(num_experts,
|
|
841
|
+
num_groups_w2,
|
|
842
|
+
hidden_size,
|
|
843
|
+
dtype=params_dtype),
|
|
844
|
+
requires_grad=False)
|
|
845
|
+
layer.register_parameter("w2_weight_scale", w2_scale)
|
|
846
|
+
set_weight_attrs(w2_scale, extra_weight_attrs)
|
|
847
|
+
set_weight_attrs(w2_scale, {"load_full_w2": load_full_w2})
|
|
848
|
+
|
|
849
|
+
w2_weight_shape = torch.nn.Parameter(torch.empty(num_experts, 2),
|
|
850
|
+
requires_grad=False)
|
|
851
|
+
layer.register_parameter("w2_weight_shape", w2_weight_shape)
|
|
852
|
+
set_weight_attrs(w2_weight_shape, extra_weight_attrs)
|
|
853
|
+
w13_weight_shape = torch.nn.Parameter(torch.empty(num_experts, 2),
|
|
854
|
+
requires_grad=False)
|
|
855
|
+
|
|
856
|
+
layer.register_parameter("w13_weight_shape", w13_weight_shape)
|
|
857
|
+
set_weight_attrs(w13_weight_shape, extra_weight_attrs)
|
|
858
|
+
|
|
859
|
+
w13_g_idx = torch.nn.Parameter(
|
|
860
|
+
torch.empty(
|
|
861
|
+
num_experts,
|
|
862
|
+
hidden_size,
|
|
863
|
+
dtype=torch.int32,
|
|
864
|
+
),
|
|
865
|
+
requires_grad=False,
|
|
866
|
+
)
|
|
867
|
+
layer.register_parameter("w13_weight_g_idx", w13_g_idx)
|
|
868
|
+
set_weight_attrs(w13_g_idx, extra_weight_attrs)
|
|
869
|
+
|
|
870
|
+
w2_g_idx = torch.nn.Parameter(
|
|
871
|
+
torch.empty(
|
|
872
|
+
num_experts,
|
|
873
|
+
intermediate_size_per_partition,
|
|
874
|
+
dtype=torch.int32,
|
|
875
|
+
),
|
|
876
|
+
requires_grad=False,
|
|
877
|
+
)
|
|
878
|
+
layer.register_parameter("w2_weight_g_idx", w2_g_idx)
|
|
879
|
+
set_weight_attrs(w2_g_idx, extra_weight_attrs)
|
|
880
|
+
|
|
881
|
+
w13_g_idx_sort_indices = torch.nn.Parameter(
|
|
882
|
+
torch.empty(
|
|
883
|
+
num_experts,
|
|
884
|
+
hidden_size,
|
|
885
|
+
dtype=torch.int32,
|
|
886
|
+
),
|
|
887
|
+
requires_grad=False,
|
|
888
|
+
)
|
|
889
|
+
layer.register_parameter("w13_g_idx_sort_indices",
|
|
890
|
+
w13_g_idx_sort_indices)
|
|
891
|
+
set_weight_attrs(w13_g_idx_sort_indices, extra_weight_attrs)
|
|
892
|
+
|
|
893
|
+
w2_g_idx_sort_indices = torch.nn.Parameter(
|
|
894
|
+
torch.empty(
|
|
895
|
+
num_experts,
|
|
896
|
+
intermediate_size_per_partition,
|
|
897
|
+
dtype=torch.int32,
|
|
898
|
+
),
|
|
899
|
+
requires_grad=False,
|
|
900
|
+
)
|
|
901
|
+
layer.register_parameter("w2_g_idx_sort_indices",
|
|
902
|
+
w2_g_idx_sort_indices)
|
|
903
|
+
set_weight_attrs(w2_g_idx_sort_indices, extra_weight_attrs)
|
|
904
|
+
|
|
905
|
+
layer.a13_scale = None
|
|
906
|
+
layer.a2_scale = None
|
|
907
|
+
layer.marlin_state = GPTQMarlinState.REPACK
|
|
908
|
+
|
|
909
|
+
def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
|
|
910
|
+
num_experts = layer.w13_weight_g_idx.shape[0]
|
|
911
|
+
device = layer.w13_weight_g_idx.device
|
|
912
|
+
|
|
913
|
+
# when running models with grouped act order,
|
|
914
|
+
# resort to g_idx values provided in checkpoint
|
|
915
|
+
if self.actorder == "group":
|
|
916
|
+
w13_g_idx_sort_indices = torch.empty_like(layer.w13_weight_g_idx)
|
|
917
|
+
w2_g_idx_sort_indices = torch.empty_like(layer.w2_weight_g_idx)
|
|
918
|
+
w13_sorted_g_idx = torch.empty_like(layer.w13_weight_g_idx)
|
|
919
|
+
w2_sorted_g_idx = torch.empty_like(layer.w2_weight_g_idx)
|
|
920
|
+
|
|
921
|
+
for e in range(num_experts):
|
|
922
|
+
w13_g_idx_sort_indices[e] = torch.argsort(
|
|
923
|
+
layer.w13_weight_g_idx[e]).to(torch.int32)
|
|
924
|
+
w2_g_idx_sort_indices[e] = torch.argsort(
|
|
925
|
+
layer.w2_weight_g_idx[e]).to(torch.int32)
|
|
926
|
+
w13_sorted_g_idx[e] = layer.w13_weight_g_idx[e][
|
|
927
|
+
w13_g_idx_sort_indices[e]]
|
|
928
|
+
w2_sorted_g_idx[e] = layer.w2_weight_g_idx[e][
|
|
929
|
+
w2_g_idx_sort_indices[e]]
|
|
930
|
+
|
|
931
|
+
replace_parameter(layer, "w13_weight_g_idx", w13_sorted_g_idx)
|
|
932
|
+
replace_parameter(layer, "w2_weight_g_idx", w2_sorted_g_idx)
|
|
933
|
+
replace_parameter(layer, "w13_g_idx_sort_indices",
|
|
934
|
+
w13_g_idx_sort_indices)
|
|
935
|
+
replace_parameter(layer, "w2_g_idx_sort_indices",
|
|
936
|
+
w2_g_idx_sort_indices)
|
|
937
|
+
|
|
938
|
+
else:
|
|
939
|
+
layer.w13_weight_g_idx = torch.nn.Parameter(
|
|
940
|
+
torch.empty((num_experts, 0), dtype=torch.int32,
|
|
941
|
+
device=device),
|
|
942
|
+
requires_grad=False,
|
|
943
|
+
)
|
|
944
|
+
layer.w2_weight_g_idx = torch.nn.Parameter(
|
|
945
|
+
torch.empty((num_experts, 0), dtype=torch.int32,
|
|
946
|
+
device=device),
|
|
947
|
+
requires_grad=False,
|
|
948
|
+
)
|
|
949
|
+
layer.w13_g_idx_sort_indices = torch.nn.Parameter(
|
|
950
|
+
torch.empty((num_experts, 0), dtype=torch.int32,
|
|
951
|
+
device=device),
|
|
952
|
+
requires_grad=False,
|
|
953
|
+
)
|
|
954
|
+
layer.w2_g_idx_sort_indices = torch.nn.Parameter(
|
|
955
|
+
torch.empty((num_experts, 0), dtype=torch.int32,
|
|
956
|
+
device=device),
|
|
957
|
+
requires_grad=False,
|
|
958
|
+
)
|
|
959
|
+
|
|
960
|
+
marlin_w13_qweight = ops.gptq_marlin_moe_repack(
|
|
961
|
+
layer.w13_weight_packed,
|
|
962
|
+
layer.w13_g_idx_sort_indices,
|
|
963
|
+
layer.w13_weight_packed.shape[1] * self.packed_factor,
|
|
964
|
+
layer.w13_weight_packed.shape[2],
|
|
965
|
+
self.num_bits,
|
|
966
|
+
)
|
|
967
|
+
replace_parameter(layer, "w13_weight_packed", marlin_w13_qweight)
|
|
968
|
+
marlin_w2_qweight = ops.gptq_marlin_moe_repack(
|
|
969
|
+
layer.w2_weight_packed,
|
|
970
|
+
layer.w2_g_idx_sort_indices,
|
|
971
|
+
layer.w2_weight_packed.shape[1] * self.packed_factor,
|
|
972
|
+
layer.w2_weight_packed.shape[2],
|
|
973
|
+
self.num_bits,
|
|
974
|
+
)
|
|
975
|
+
replace_parameter(layer, "w2_weight_packed", marlin_w2_qweight)
|
|
976
|
+
# Repack scales
|
|
977
|
+
marlin_w13_scales = marlin_moe_permute_scales(
|
|
978
|
+
s=layer.w13_weight_scale,
|
|
979
|
+
size_k=layer.w13_weight_packed.shape[2],
|
|
980
|
+
size_n=layer.w13_weight_scale.shape[2],
|
|
981
|
+
group_size=self.group_size,
|
|
982
|
+
)
|
|
983
|
+
replace_parameter(layer, "w13_weight_scale", marlin_w13_scales)
|
|
984
|
+
marlin_w2_scales = marlin_moe_permute_scales(
|
|
985
|
+
s=layer.w2_weight_scale,
|
|
986
|
+
size_k=layer.w2_weight_scale.shape[1] *
|
|
987
|
+
(self.group_size if self.group_size != -1 else self.packed_factor),
|
|
988
|
+
size_n=layer.w2_weight_scale.shape[2],
|
|
989
|
+
group_size=self.group_size,
|
|
990
|
+
)
|
|
991
|
+
replace_parameter(layer, "w2_weight_scale", marlin_w2_scales)
|
|
992
|
+
|
|
993
|
+
layer.workspace = marlin_make_workspace_new(device, 4)
|
|
994
|
+
|
|
995
|
+
def apply(
|
|
996
|
+
self,
|
|
997
|
+
layer: torch.nn.Module,
|
|
998
|
+
x: torch.Tensor,
|
|
999
|
+
router_logits: torch.Tensor,
|
|
1000
|
+
top_k: int,
|
|
1001
|
+
renormalize: bool,
|
|
1002
|
+
use_grouped_topk: bool = False,
|
|
1003
|
+
topk_group: Optional[int] = None,
|
|
1004
|
+
num_expert_group: Optional[int] = None,
|
|
1005
|
+
global_num_experts: int = -1,
|
|
1006
|
+
expert_map: Optional[torch.Tensor] = None,
|
|
1007
|
+
custom_routing_function: Optional[Callable] = None,
|
|
1008
|
+
scoring_func: str = "softmax",
|
|
1009
|
+
e_score_correction_bias: Optional[torch.Tensor] = None,
|
|
1010
|
+
apply_router_weight_on_input: bool = False,
|
|
1011
|
+
activation: str = "silu",
|
|
1012
|
+
) -> torch.Tensor:
|
|
1013
|
+
assert activation == "silu", (
|
|
1014
|
+
f"{activation} not supported for Marlin MoE.")
|
|
1015
|
+
assert not apply_router_weight_on_input, (
|
|
1016
|
+
"Apply router weight on input not supported for Marlin MoE.")
|
|
1017
|
+
|
|
1018
|
+
topk_weights, topk_ids = FusedMoE.select_experts(
|
|
1019
|
+
hidden_states=x,
|
|
1020
|
+
router_logits=router_logits,
|
|
1021
|
+
use_grouped_topk=use_grouped_topk,
|
|
1022
|
+
top_k=top_k,
|
|
1023
|
+
renormalize=renormalize,
|
|
1024
|
+
topk_group=topk_group,
|
|
1025
|
+
num_expert_group=num_expert_group,
|
|
1026
|
+
custom_routing_function=custom_routing_function,
|
|
1027
|
+
scoring_func=scoring_func,
|
|
1028
|
+
e_score_correction_bias=e_score_correction_bias)
|
|
1029
|
+
|
|
1030
|
+
return torch.ops.vllm.fused_marlin_moe(
|
|
1031
|
+
x,
|
|
1032
|
+
layer.w13_weight_packed,
|
|
1033
|
+
layer.w2_weight_packed,
|
|
1034
|
+
layer.w13_weight_scale,
|
|
1035
|
+
layer.w2_weight_scale,
|
|
1036
|
+
router_logits,
|
|
1037
|
+
topk_weights,
|
|
1038
|
+
topk_ids,
|
|
1039
|
+
quant_type_id=self.quant_type.id,
|
|
1040
|
+
global_num_experts=global_num_experts,
|
|
1041
|
+
expert_map=expert_map,
|
|
1042
|
+
g_idx1=layer.w13_weight_g_idx,
|
|
1043
|
+
g_idx2=layer.w2_weight_g_idx,
|
|
1044
|
+
sort_indices1=layer.w13_g_idx_sort_indices,
|
|
1045
|
+
sort_indices2=layer.w2_g_idx_sort_indices,
|
|
1046
|
+
workspace=layer.workspace,
|
|
1047
|
+
is_k_full=self.is_k_full)
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
class CompressedTensorsWNA16MoEMethod(CompressedTensorsMoEMethod):
|
|
1051
|
+
|
|
1052
|
+
def __init__(
|
|
1053
|
+
self,
|
|
1054
|
+
quant_config: "CompressedTensorsConfig" # type: ignore # noqa E501
|
|
1055
|
+
):
|
|
1056
|
+
self.quant_config = quant_config
|
|
1057
|
+
# TODO: @dsikka: refactor this to use schemes as other kernels
|
|
1058
|
+
# are supported + check if the layer is being ignored.
|
|
1059
|
+
config = self.quant_config.target_scheme_map["Linear"].get("weights")
|
|
1060
|
+
self.num_bits = config.num_bits
|
|
1061
|
+
self.packed_factor = 32 // config.num_bits
|
|
1062
|
+
self.strategy = config.strategy
|
|
1063
|
+
# channelwise is not supported by this kernel
|
|
1064
|
+
assert config.strategy == "group"
|
|
1065
|
+
self.group_size = config.group_size
|
|
1066
|
+
# grouped actorder isn't supported by this kernel
|
|
1067
|
+
assert config.actorder != "group"
|
|
1068
|
+
assert config.symmetric, (
|
|
1069
|
+
"Only symmetric quantization is supported for MoE")
|
|
1070
|
+
|
|
1071
|
+
if not (self.quant_config.quant_format
|
|
1072
|
+
== CompressionFormat.pack_quantized.value
|
|
1073
|
+
and self.num_bits in WNA16_SUPPORTED_BITS):
|
|
1074
|
+
raise ValueError("For Fused MoE layers, only ",
|
|
1075
|
+
f"{CompressionFormat.pack_quantized.value} ",
|
|
1076
|
+
"is supported for the following bits: ",
|
|
1077
|
+
f"{WNA16_SUPPORTED_BITS}")
|
|
1078
|
+
|
|
1079
|
+
def create_weights(self, layer: torch.nn.Module, num_experts: int,
|
|
1080
|
+
hidden_size: int, intermediate_size_per_partition: int,
|
|
1081
|
+
params_dtype: torch.dtype, **extra_weight_attrs):
|
|
1082
|
+
|
|
1083
|
+
# Will transpose the loaded weight along the
|
|
1084
|
+
# intermediate and hidden dim sizes. Will
|
|
1085
|
+
# shard for TP along the transposed dims
|
|
1086
|
+
extra_weight_attrs.update({
|
|
1087
|
+
"is_transposed": True,
|
|
1088
|
+
"quant_method": self.strategy
|
|
1089
|
+
})
|
|
1090
|
+
w13_weight = torch.nn.Parameter(torch.empty(
|
|
1091
|
+
num_experts,
|
|
1092
|
+
hidden_size // self.packed_factor,
|
|
1093
|
+
2 * intermediate_size_per_partition,
|
|
1094
|
+
dtype=torch.int32),
|
|
1095
|
+
requires_grad=False)
|
|
1096
|
+
layer.register_parameter("w13_weight_packed", w13_weight)
|
|
1097
|
+
set_weight_attrs(w13_weight, extra_weight_attrs)
|
|
1098
|
+
|
|
1099
|
+
w2_weight = torch.nn.Parameter(torch.empty(
|
|
1100
|
+
num_experts,
|
|
1101
|
+
intermediate_size_per_partition // self.packed_factor,
|
|
1102
|
+
hidden_size,
|
|
1103
|
+
dtype=torch.int32),
|
|
1104
|
+
requires_grad=False)
|
|
1105
|
+
layer.register_parameter("w2_weight_packed", w2_weight)
|
|
1106
|
+
set_weight_attrs(w2_weight, extra_weight_attrs)
|
|
1107
|
+
|
|
1108
|
+
w2_scales_size = intermediate_size_per_partition
|
|
1109
|
+
|
|
1110
|
+
if self.strategy == "channel":
|
|
1111
|
+
num_groups_w2 = num_groups_w13 = 1
|
|
1112
|
+
self.group_size = -1
|
|
1113
|
+
else:
|
|
1114
|
+
num_groups_w2 = w2_scales_size // self.group_size
|
|
1115
|
+
num_groups_w13 = hidden_size // self.group_size
|
|
1116
|
+
|
|
1117
|
+
w13_scale = torch.nn.Parameter(torch.ones(
|
|
1118
|
+
num_experts,
|
|
1119
|
+
num_groups_w13,
|
|
1120
|
+
2 * intermediate_size_per_partition,
|
|
1121
|
+
dtype=params_dtype),
|
|
1122
|
+
requires_grad=False)
|
|
1123
|
+
layer.register_parameter("w13_weight_scale", w13_scale)
|
|
1124
|
+
set_weight_attrs(w13_scale, extra_weight_attrs)
|
|
1125
|
+
|
|
1126
|
+
w2_scale = torch.nn.Parameter(torch.ones(num_experts,
|
|
1127
|
+
num_groups_w2,
|
|
1128
|
+
hidden_size,
|
|
1129
|
+
dtype=params_dtype),
|
|
1130
|
+
requires_grad=False)
|
|
1131
|
+
layer.register_parameter("w2_weight_scale", w2_scale)
|
|
1132
|
+
set_weight_attrs(w2_scale, extra_weight_attrs)
|
|
1133
|
+
set_weight_attrs(w2_scale, {"load_full_w2": False})
|
|
1134
|
+
|
|
1135
|
+
w2_weight_shape = torch.nn.Parameter(torch.empty(num_experts, 2),
|
|
1136
|
+
requires_grad=False)
|
|
1137
|
+
layer.register_parameter("w2_weight_shape", w2_weight_shape)
|
|
1138
|
+
set_weight_attrs(w2_weight_shape, extra_weight_attrs)
|
|
1139
|
+
w13_weight_shape = torch.nn.Parameter(torch.empty(num_experts, 2),
|
|
1140
|
+
requires_grad=False)
|
|
1141
|
+
|
|
1142
|
+
layer.register_parameter("w13_weight_shape", w13_weight_shape)
|
|
1143
|
+
set_weight_attrs(w13_weight_shape, extra_weight_attrs)
|
|
1144
|
+
|
|
1145
|
+
w13_g_idx = torch.nn.Parameter(
|
|
1146
|
+
torch.empty(
|
|
1147
|
+
num_experts,
|
|
1148
|
+
hidden_size,
|
|
1149
|
+
dtype=torch.int32,
|
|
1150
|
+
),
|
|
1151
|
+
requires_grad=False,
|
|
1152
|
+
)
|
|
1153
|
+
layer.register_parameter("w13_weight_g_idx", w13_g_idx)
|
|
1154
|
+
set_weight_attrs(w13_g_idx, extra_weight_attrs)
|
|
1155
|
+
|
|
1156
|
+
w2_g_idx = torch.nn.Parameter(
|
|
1157
|
+
torch.empty(
|
|
1158
|
+
num_experts,
|
|
1159
|
+
intermediate_size_per_partition,
|
|
1160
|
+
dtype=torch.int32,
|
|
1161
|
+
),
|
|
1162
|
+
requires_grad=False,
|
|
1163
|
+
)
|
|
1164
|
+
layer.register_parameter("w2_weight_g_idx", w2_g_idx)
|
|
1165
|
+
set_weight_attrs(w2_g_idx, extra_weight_attrs)
|
|
1166
|
+
|
|
1167
|
+
w13_g_idx_sort_indices = torch.nn.Parameter(
|
|
1168
|
+
torch.empty(
|
|
1169
|
+
num_experts,
|
|
1170
|
+
hidden_size,
|
|
1171
|
+
dtype=torch.int32,
|
|
1172
|
+
),
|
|
1173
|
+
requires_grad=False,
|
|
1174
|
+
)
|
|
1175
|
+
layer.register_parameter("w13_g_idx_sort_indices",
|
|
1176
|
+
w13_g_idx_sort_indices)
|
|
1177
|
+
set_weight_attrs(w13_g_idx_sort_indices, extra_weight_attrs)
|
|
1178
|
+
|
|
1179
|
+
w2_g_idx_sort_indices = torch.nn.Parameter(
|
|
1180
|
+
torch.empty(
|
|
1181
|
+
num_experts,
|
|
1182
|
+
intermediate_size_per_partition,
|
|
1183
|
+
dtype=torch.int32,
|
|
1184
|
+
),
|
|
1185
|
+
requires_grad=False,
|
|
1186
|
+
)
|
|
1187
|
+
layer.register_parameter("w2_g_idx_sort_indices",
|
|
1188
|
+
w2_g_idx_sort_indices)
|
|
1189
|
+
set_weight_attrs(w2_g_idx_sort_indices, extra_weight_attrs)
|
|
1190
|
+
|
|
1191
|
+
layer.a13_scale = None
|
|
1192
|
+
layer.a2_scale = None
|
|
1193
|
+
|
|
1194
|
+
def process_weights_after_loading(self, layer: torch.nn.Module) -> None:
|
|
1195
|
+
# Reconfigure packed weights and scales to match moe_wna16 format
|
|
1196
|
+
layer.w13_weight_packed = torch.nn.Parameter(
|
|
1197
|
+
layer.w13_weight_packed.transpose(1, 2).contiguous().view(
|
|
1198
|
+
torch.uint8),
|
|
1199
|
+
requires_grad=False)
|
|
1200
|
+
layer.w2_weight_packed = torch.nn.Parameter(
|
|
1201
|
+
layer.w2_weight_packed.transpose(1,
|
|
1202
|
+
2).contiguous().view(torch.uint8),
|
|
1203
|
+
requires_grad=False)
|
|
1204
|
+
layer.w13_weight_scale = torch.nn.Parameter(
|
|
1205
|
+
layer.w13_weight_scale.transpose(1, 2).contiguous(),
|
|
1206
|
+
requires_grad=False)
|
|
1207
|
+
layer.w2_weight_scale = torch.nn.Parameter(
|
|
1208
|
+
layer.w2_weight_scale.transpose(1, 2).contiguous(),
|
|
1209
|
+
requires_grad=False)
|
|
1210
|
+
|
|
1211
|
+
def apply(
|
|
1212
|
+
self,
|
|
1213
|
+
layer: torch.nn.Module,
|
|
1214
|
+
x: torch.Tensor,
|
|
1215
|
+
router_logits: torch.Tensor,
|
|
1216
|
+
top_k: int,
|
|
1217
|
+
renormalize: bool,
|
|
1218
|
+
use_grouped_topk: bool = False,
|
|
1219
|
+
topk_group: Optional[int] = None,
|
|
1220
|
+
num_expert_group: Optional[int] = None,
|
|
1221
|
+
global_num_experts: int = -1,
|
|
1222
|
+
expert_map: Optional[torch.Tensor] = None,
|
|
1223
|
+
custom_routing_function: Optional[Callable] = None,
|
|
1224
|
+
scoring_func: str = "softmax",
|
|
1225
|
+
e_score_correction_bias: Optional[torch.Tensor] = None,
|
|
1226
|
+
apply_router_weight_on_input: bool = False,
|
|
1227
|
+
activation: str = "silu",
|
|
1228
|
+
) -> torch.Tensor:
|
|
1229
|
+
from vllm.model_executor.layers.fused_moe import fused_experts
|
|
1230
|
+
|
|
1231
|
+
topk_weights, topk_ids = FusedMoE.select_experts(
|
|
1232
|
+
hidden_states=x,
|
|
1233
|
+
router_logits=router_logits,
|
|
1234
|
+
use_grouped_topk=use_grouped_topk,
|
|
1235
|
+
top_k=top_k,
|
|
1236
|
+
renormalize=renormalize,
|
|
1237
|
+
topk_group=topk_group,
|
|
1238
|
+
num_expert_group=num_expert_group,
|
|
1239
|
+
custom_routing_function=custom_routing_function,
|
|
1240
|
+
scoring_func=scoring_func,
|
|
1241
|
+
e_score_correction_bias=e_score_correction_bias)
|
|
1242
|
+
|
|
1243
|
+
return fused_experts(
|
|
1244
|
+
x,
|
|
1245
|
+
layer.w13_weight_packed,
|
|
1246
|
+
layer.w2_weight_packed,
|
|
1247
|
+
topk_weights=topk_weights,
|
|
1248
|
+
topk_ids=topk_ids,
|
|
1249
|
+
inplace=True,
|
|
1250
|
+
activation=activation,
|
|
1251
|
+
use_int4_w4a16=self.num_bits == 4,
|
|
1252
|
+
use_int8_w8a16=self.num_bits == 8,
|
|
1253
|
+
global_num_experts=global_num_experts,
|
|
1254
|
+
apply_router_weight_on_input=apply_router_weight_on_input,
|
|
1255
|
+
expert_map=expert_map,
|
|
1256
|
+
w1_scale=layer.w13_weight_scale,
|
|
1257
|
+
w2_scale=layer.w2_weight_scale,
|
|
1258
|
+
w1_zp=None,
|
|
1259
|
+
w2_zp=None,
|
|
1260
|
+
block_shape=[0, self.group_size])
|