vllm-cpu-amxbf16 0.11.2.post2__cp310-cp310-manylinux_2_17_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vllm/_C.abi3.so +0 -0
- vllm/__init__.py +225 -0
- vllm/_aiter_ops.py +983 -0
- vllm/_bc_linter.py +54 -0
- vllm/_custom_ops.py +2863 -0
- vllm/_ipex_ops.py +457 -0
- vllm/_version.py +34 -0
- vllm/assets/__init__.py +0 -0
- vllm/assets/audio.py +43 -0
- vllm/assets/base.py +40 -0
- vllm/assets/image.py +59 -0
- vllm/assets/video.py +149 -0
- vllm/attention/__init__.py +18 -0
- vllm/attention/backends/__init__.py +0 -0
- vllm/attention/backends/abstract.py +391 -0
- vllm/attention/backends/registry.py +195 -0
- vllm/attention/backends/utils.py +33 -0
- vllm/attention/layer.py +1052 -0
- vllm/attention/layers/__init__.py +0 -0
- vllm/attention/layers/chunked_local_attention.py +121 -0
- vllm/attention/layers/cross_attention.py +178 -0
- vllm/attention/layers/encoder_only_attention.py +103 -0
- vllm/attention/ops/__init__.py +0 -0
- vllm/attention/ops/chunked_prefill_paged_decode.py +401 -0
- vllm/attention/ops/common.py +414 -0
- vllm/attention/ops/flashmla.py +251 -0
- vllm/attention/ops/merge_attn_states.py +47 -0
- vllm/attention/ops/paged_attn.py +262 -0
- vllm/attention/ops/pallas_kv_cache_update.py +130 -0
- vllm/attention/ops/prefix_prefill.py +814 -0
- vllm/attention/ops/rocm_aiter_paged_attn.py +123 -0
- vllm/attention/ops/triton_decode_attention.py +712 -0
- vllm/attention/ops/triton_merge_attn_states.py +105 -0
- vllm/attention/ops/triton_reshape_and_cache_flash.py +184 -0
- vllm/attention/ops/triton_unified_attention.py +941 -0
- vllm/attention/ops/vit_attn_wrappers.py +178 -0
- vllm/attention/selector.py +231 -0
- vllm/attention/utils/__init__.py +0 -0
- vllm/attention/utils/fa_utils.py +109 -0
- vllm/attention/utils/kv_sharing_utils.py +33 -0
- vllm/attention/utils/kv_transfer_utils.py +60 -0
- vllm/beam_search.py +88 -0
- vllm/benchmarks/__init__.py +0 -0
- vllm/benchmarks/datasets.py +3222 -0
- vllm/benchmarks/latency.py +172 -0
- vllm/benchmarks/lib/__init__.py +3 -0
- vllm/benchmarks/lib/endpoint_request_func.py +777 -0
- vllm/benchmarks/lib/ready_checker.py +72 -0
- vllm/benchmarks/lib/utils.py +79 -0
- vllm/benchmarks/serve.py +1531 -0
- vllm/benchmarks/sweep/__init__.py +0 -0
- vllm/benchmarks/sweep/cli.py +38 -0
- vllm/benchmarks/sweep/param_sweep.py +91 -0
- vllm/benchmarks/sweep/plot.py +580 -0
- vllm/benchmarks/sweep/serve.py +416 -0
- vllm/benchmarks/sweep/serve_sla.py +492 -0
- vllm/benchmarks/sweep/server.py +114 -0
- vllm/benchmarks/sweep/sla_sweep.py +132 -0
- vllm/benchmarks/sweep/utils.py +4 -0
- vllm/benchmarks/throughput.py +799 -0
- vllm/collect_env.py +857 -0
- vllm/compilation/__init__.py +0 -0
- vllm/compilation/activation_quant_fusion.py +209 -0
- vllm/compilation/backends.py +759 -0
- vllm/compilation/base_static_graph.py +57 -0
- vllm/compilation/caching.py +178 -0
- vllm/compilation/collective_fusion.py +1234 -0
- vllm/compilation/compiler_interface.py +639 -0
- vllm/compilation/counter.py +48 -0
- vllm/compilation/cuda_graph.py +208 -0
- vllm/compilation/decorators.py +571 -0
- vllm/compilation/fix_functionalization.py +253 -0
- vllm/compilation/fusion.py +374 -0
- vllm/compilation/fusion_attn.py +359 -0
- vllm/compilation/fx_utils.py +91 -0
- vllm/compilation/inductor_pass.py +133 -0
- vllm/compilation/matcher_utils.py +317 -0
- vllm/compilation/monitor.py +62 -0
- vllm/compilation/noop_elimination.py +134 -0
- vllm/compilation/partition_rules.py +72 -0
- vllm/compilation/pass_manager.py +135 -0
- vllm/compilation/piecewise_backend.py +121 -0
- vllm/compilation/post_cleanup.py +21 -0
- vllm/compilation/qk_norm_rope_fusion.py +238 -0
- vllm/compilation/sequence_parallelism.py +363 -0
- vllm/compilation/torch25_custom_graph_pass.py +44 -0
- vllm/compilation/vllm_inductor_pass.py +173 -0
- vllm/compilation/wrapper.py +238 -0
- vllm/config/__init__.py +102 -0
- vllm/config/cache.py +207 -0
- vllm/config/compilation.py +975 -0
- vllm/config/device.py +75 -0
- vllm/config/ec_transfer.py +110 -0
- vllm/config/kv_events.py +56 -0
- vllm/config/kv_transfer.py +114 -0
- vllm/config/load.py +124 -0
- vllm/config/lora.py +112 -0
- vllm/config/model.py +2162 -0
- vllm/config/multimodal.py +248 -0
- vllm/config/observability.py +123 -0
- vllm/config/parallel.py +655 -0
- vllm/config/pooler.py +122 -0
- vllm/config/scheduler.py +298 -0
- vllm/config/speculative.py +654 -0
- vllm/config/speech_to_text.py +38 -0
- vllm/config/structured_outputs.py +92 -0
- vllm/config/utils.py +178 -0
- vllm/config/vllm.py +1166 -0
- vllm/connections.py +189 -0
- vllm/device_allocator/__init__.py +0 -0
- vllm/device_allocator/cumem.py +327 -0
- vllm/distributed/__init__.py +6 -0
- vllm/distributed/communication_op.py +43 -0
- vllm/distributed/device_communicators/__init__.py +0 -0
- vllm/distributed/device_communicators/all2all.py +490 -0
- vllm/distributed/device_communicators/all_reduce_utils.py +344 -0
- vllm/distributed/device_communicators/base_device_communicator.py +297 -0
- vllm/distributed/device_communicators/cpu_communicator.py +209 -0
- vllm/distributed/device_communicators/cuda_communicator.py +340 -0
- vllm/distributed/device_communicators/cuda_wrapper.py +216 -0
- vllm/distributed/device_communicators/custom_all_reduce.py +326 -0
- vllm/distributed/device_communicators/mnnvl_compat.py +27 -0
- vllm/distributed/device_communicators/pynccl.py +386 -0
- vllm/distributed/device_communicators/pynccl_allocator.py +191 -0
- vllm/distributed/device_communicators/pynccl_wrapper.py +564 -0
- vllm/distributed/device_communicators/quick_all_reduce.py +290 -0
- vllm/distributed/device_communicators/ray_communicator.py +259 -0
- vllm/distributed/device_communicators/shm_broadcast.py +733 -0
- vllm/distributed/device_communicators/shm_object_storage.py +660 -0
- vllm/distributed/device_communicators/symm_mem.py +156 -0
- vllm/distributed/device_communicators/tpu_communicator.py +107 -0
- vllm/distributed/device_communicators/xpu_communicator.py +95 -0
- vllm/distributed/ec_transfer/__init__.py +14 -0
- vllm/distributed/ec_transfer/ec_connector/__init__.py +0 -0
- vllm/distributed/ec_transfer/ec_connector/base.py +247 -0
- vllm/distributed/ec_transfer/ec_connector/factory.py +88 -0
- vllm/distributed/ec_transfer/ec_connector/shared_storage_connector.py +201 -0
- vllm/distributed/ec_transfer/ec_transfer_state.py +42 -0
- vllm/distributed/eplb/__init__.py +8 -0
- vllm/distributed/eplb/eplb_state.py +837 -0
- vllm/distributed/eplb/rebalance_algo.py +260 -0
- vllm/distributed/eplb/rebalance_execute.py +431 -0
- vllm/distributed/kv_events.py +371 -0
- vllm/distributed/kv_transfer/README.md +29 -0
- vllm/distributed/kv_transfer/__init__.py +20 -0
- vllm/distributed/kv_transfer/disagg_prefill_workflow.jpg +0 -0
- vllm/distributed/kv_transfer/kv_connector/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_connector/base.py +10 -0
- vllm/distributed/kv_transfer/kv_connector/factory.py +192 -0
- vllm/distributed/kv_transfer/kv_connector/utils.py +268 -0
- vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +19 -0
- vllm/distributed/kv_transfer/kv_connector/v1/base.py +546 -0
- vllm/distributed/kv_transfer/kv_connector/v1/decode_bench_connector.py +419 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +216 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/__init__.py +18 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/multi_process_adapter.py +379 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/utils.py +221 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/vllm_v1_adapter.py +1411 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_mp_connector.py +867 -0
- vllm/distributed/kv_transfer/kv_connector/v1/metrics.py +189 -0
- vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +454 -0
- vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +2440 -0
- vllm/distributed/kv_transfer/kv_connector/v1/offloading_connector.py +504 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_connector.py +531 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py +632 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/tensor_memory_pool.py +273 -0
- vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py +450 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/base.py +179 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/mooncake_store.py +164 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py +242 -0
- vllm/distributed/kv_transfer/kv_pipe/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_pipe/base.py +66 -0
- vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py +295 -0
- vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +285 -0
- vllm/distributed/kv_transfer/kv_transfer_state.py +78 -0
- vllm/distributed/parallel_state.py +1759 -0
- vllm/distributed/tpu_distributed_utils.py +188 -0
- vllm/distributed/utils.py +543 -0
- vllm/engine/__init__.py +0 -0
- vllm/engine/arg_utils.py +2144 -0
- vllm/engine/async_llm_engine.py +6 -0
- vllm/engine/llm_engine.py +6 -0
- vllm/engine/protocol.py +170 -0
- vllm/entrypoints/__init__.py +0 -0
- vllm/entrypoints/anthropic/__init__.py +0 -0
- vllm/entrypoints/anthropic/protocol.py +162 -0
- vllm/entrypoints/anthropic/serving_messages.py +460 -0
- vllm/entrypoints/api_server.py +184 -0
- vllm/entrypoints/chat_utils.py +1690 -0
- vllm/entrypoints/cli/__init__.py +13 -0
- vllm/entrypoints/cli/benchmark/__init__.py +0 -0
- vllm/entrypoints/cli/benchmark/base.py +25 -0
- vllm/entrypoints/cli/benchmark/latency.py +21 -0
- vllm/entrypoints/cli/benchmark/main.py +56 -0
- vllm/entrypoints/cli/benchmark/serve.py +21 -0
- vllm/entrypoints/cli/benchmark/sweep.py +21 -0
- vllm/entrypoints/cli/benchmark/throughput.py +21 -0
- vllm/entrypoints/cli/collect_env.py +38 -0
- vllm/entrypoints/cli/main.py +79 -0
- vllm/entrypoints/cli/openai.py +256 -0
- vllm/entrypoints/cli/run_batch.py +68 -0
- vllm/entrypoints/cli/serve.py +249 -0
- vllm/entrypoints/cli/types.py +29 -0
- vllm/entrypoints/constants.py +10 -0
- vllm/entrypoints/context.py +572 -0
- vllm/entrypoints/dynamic_lora.py +57 -0
- vllm/entrypoints/harmony_utils.py +535 -0
- vllm/entrypoints/launcher.py +175 -0
- vllm/entrypoints/llm.py +1768 -0
- vllm/entrypoints/logger.py +84 -0
- vllm/entrypoints/openai/__init__.py +0 -0
- vllm/entrypoints/openai/api_server.py +2096 -0
- vllm/entrypoints/openai/cli_args.py +302 -0
- vllm/entrypoints/openai/orca_metrics.py +120 -0
- vllm/entrypoints/openai/protocol.py +3299 -0
- vllm/entrypoints/openai/run_batch.py +547 -0
- vllm/entrypoints/openai/serving_chat.py +1772 -0
- vllm/entrypoints/openai/serving_classification.py +235 -0
- vllm/entrypoints/openai/serving_completion.py +715 -0
- vllm/entrypoints/openai/serving_embedding.py +695 -0
- vllm/entrypoints/openai/serving_engine.py +1433 -0
- vllm/entrypoints/openai/serving_models.py +304 -0
- vllm/entrypoints/openai/serving_pooling.py +346 -0
- vllm/entrypoints/openai/serving_responses.py +2021 -0
- vllm/entrypoints/openai/serving_score.py +503 -0
- vllm/entrypoints/openai/serving_tokenization.py +203 -0
- vllm/entrypoints/openai/serving_tokens.py +269 -0
- vllm/entrypoints/openai/serving_transcription.py +148 -0
- vllm/entrypoints/openai/speech_to_text.py +405 -0
- vllm/entrypoints/openai/tool_parsers/__init__.py +142 -0
- vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +273 -0
- vllm/entrypoints/openai/tool_parsers/deepseekv31_tool_parser.py +390 -0
- vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py +390 -0
- vllm/entrypoints/openai/tool_parsers/ernie45_tool_parser.py +210 -0
- vllm/entrypoints/openai/tool_parsers/glm4_moe_tool_parser.py +200 -0
- vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py +273 -0
- vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py +253 -0
- vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py +494 -0
- vllm/entrypoints/openai/tool_parsers/hunyuan_a13b_tool_parser.py +420 -0
- vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py +227 -0
- vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py +323 -0
- vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py +590 -0
- vllm/entrypoints/openai/tool_parsers/llama4_pythonic_tool_parser.py +341 -0
- vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +290 -0
- vllm/entrypoints/openai/tool_parsers/longcat_tool_parser.py +37 -0
- vllm/entrypoints/openai/tool_parsers/minimax_m2_tool_parser.py +643 -0
- vllm/entrypoints/openai/tool_parsers/minimax_tool_parser.py +849 -0
- vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +390 -0
- vllm/entrypoints/openai/tool_parsers/olmo3_tool_parser.py +366 -0
- vllm/entrypoints/openai/tool_parsers/openai_tool_parser.py +97 -0
- vllm/entrypoints/openai/tool_parsers/phi4mini_tool_parser.py +120 -0
- vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py +332 -0
- vllm/entrypoints/openai/tool_parsers/qwen3coder_tool_parser.py +781 -0
- vllm/entrypoints/openai/tool_parsers/qwen3xml_tool_parser.py +1316 -0
- vllm/entrypoints/openai/tool_parsers/seed_oss_tool_parser.py +744 -0
- vllm/entrypoints/openai/tool_parsers/step3_tool_parser.py +303 -0
- vllm/entrypoints/openai/tool_parsers/utils.py +229 -0
- vllm/entrypoints/openai/tool_parsers/xlam_tool_parser.py +556 -0
- vllm/entrypoints/renderer.py +409 -0
- vllm/entrypoints/responses_utils.py +77 -0
- vllm/entrypoints/sagemaker/__init__.py +4 -0
- vllm/entrypoints/sagemaker/routes.py +72 -0
- vllm/entrypoints/score_utils.py +242 -0
- vllm/entrypoints/ssl.py +78 -0
- vllm/entrypoints/tool.py +143 -0
- vllm/entrypoints/tool_server.py +209 -0
- vllm/entrypoints/utils.py +319 -0
- vllm/env_override.py +378 -0
- vllm/envs.py +1659 -0
- vllm/forward_context.py +356 -0
- vllm/inputs/__init__.py +44 -0
- vllm/inputs/data.py +359 -0
- vllm/inputs/parse.py +137 -0
- vllm/inputs/preprocess.py +727 -0
- vllm/logger.py +267 -0
- vllm/logging_utils/__init__.py +10 -0
- vllm/logging_utils/dump_input.py +83 -0
- vllm/logging_utils/formatter.py +77 -0
- vllm/logging_utils/log_time.py +34 -0
- vllm/logits_process.py +121 -0
- vllm/logprobs.py +208 -0
- vllm/lora/__init__.py +0 -0
- vllm/lora/layers/__init__.py +41 -0
- vllm/lora/layers/base.py +67 -0
- vllm/lora/layers/base_linear.py +164 -0
- vllm/lora/layers/column_parallel_linear.py +578 -0
- vllm/lora/layers/fused_moe.py +472 -0
- vllm/lora/layers/logits_processor.py +252 -0
- vllm/lora/layers/replicated_linear.py +70 -0
- vllm/lora/layers/row_parallel_linear.py +181 -0
- vllm/lora/layers/utils.py +65 -0
- vllm/lora/layers/vocal_parallel_embedding.py +166 -0
- vllm/lora/lora_weights.py +198 -0
- vllm/lora/models.py +890 -0
- vllm/lora/ops/__init__.py +0 -0
- vllm/lora/ops/ipex_ops/__init__.py +6 -0
- vllm/lora/ops/ipex_ops/lora_ops.py +57 -0
- vllm/lora/ops/torch_ops/__init__.py +20 -0
- vllm/lora/ops/torch_ops/lora_ops.py +128 -0
- vllm/lora/ops/triton_ops/README_TUNING.md +60 -0
- vllm/lora/ops/triton_ops/__init__.py +21 -0
- vllm/lora/ops/triton_ops/fused_moe_lora_op.py +641 -0
- vllm/lora/ops/triton_ops/kernel_utils.py +340 -0
- vllm/lora/ops/triton_ops/lora_expand_op.py +310 -0
- vllm/lora/ops/triton_ops/lora_kernel_metadata.py +154 -0
- vllm/lora/ops/triton_ops/lora_shrink_op.py +287 -0
- vllm/lora/ops/triton_ops/utils.py +295 -0
- vllm/lora/ops/xla_ops/__init__.py +6 -0
- vllm/lora/ops/xla_ops/lora_ops.py +141 -0
- vllm/lora/peft_helper.py +128 -0
- vllm/lora/punica_wrapper/__init__.py +10 -0
- vllm/lora/punica_wrapper/punica_base.py +492 -0
- vllm/lora/punica_wrapper/punica_cpu.py +351 -0
- vllm/lora/punica_wrapper/punica_gpu.py +411 -0
- vllm/lora/punica_wrapper/punica_selector.py +21 -0
- vllm/lora/punica_wrapper/punica_tpu.py +359 -0
- vllm/lora/punica_wrapper/punica_xpu.py +279 -0
- vllm/lora/punica_wrapper/utils.py +150 -0
- vllm/lora/request.py +100 -0
- vllm/lora/resolver.py +88 -0
- vllm/lora/utils.py +293 -0
- vllm/lora/worker_manager.py +279 -0
- vllm/model_executor/__init__.py +11 -0
- vllm/model_executor/custom_op.py +194 -0
- vllm/model_executor/layers/__init__.py +0 -0
- vllm/model_executor/layers/activation.py +569 -0
- vllm/model_executor/layers/attention_layer_base.py +35 -0
- vllm/model_executor/layers/batch_invariant.py +854 -0
- vllm/model_executor/layers/conv.py +236 -0
- vllm/model_executor/layers/fla/__init__.py +8 -0
- vllm/model_executor/layers/fla/ops/__init__.py +17 -0
- vllm/model_executor/layers/fla/ops/chunk.py +240 -0
- vllm/model_executor/layers/fla/ops/chunk_delta_h.py +344 -0
- vllm/model_executor/layers/fla/ops/chunk_o.py +183 -0
- vllm/model_executor/layers/fla/ops/chunk_scaled_dot_kkt.py +154 -0
- vllm/model_executor/layers/fla/ops/cumsum.py +280 -0
- vllm/model_executor/layers/fla/ops/fused_recurrent.py +390 -0
- vllm/model_executor/layers/fla/ops/index.py +41 -0
- vllm/model_executor/layers/fla/ops/kda.py +1351 -0
- vllm/model_executor/layers/fla/ops/l2norm.py +146 -0
- vllm/model_executor/layers/fla/ops/layernorm_guard.py +396 -0
- vllm/model_executor/layers/fla/ops/op.py +60 -0
- vllm/model_executor/layers/fla/ops/solve_tril.py +556 -0
- vllm/model_executor/layers/fla/ops/utils.py +194 -0
- vllm/model_executor/layers/fla/ops/wy_fast.py +158 -0
- vllm/model_executor/layers/fused_moe/__init__.py +106 -0
- vllm/model_executor/layers/fused_moe/all2all_utils.py +160 -0
- vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +406 -0
- vllm/model_executor/layers/fused_moe/batched_triton_or_deep_gemm_moe.py +180 -0
- vllm/model_executor/layers/fused_moe/config.py +916 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H200,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H100,dtype=fp8_w8a8.json +123 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1856,device_name=NVIDIA_H100_80GB_HBM3.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1856,device_name=NVIDIA_L40S.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=352,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +122 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +114 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI308X.json +213 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=bf16.json +82 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +82 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=928,device_name=NVIDIA_H100_80GB_HBM3.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=928,device_name=NVIDIA_L40S.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2048,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=float8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H200,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=float8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=AMD_Instinct_MI300X.json +201 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=AMD_Instinct_MI350_OAM,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=320,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI350_OAM,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI355_OAM,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=32,N=1408,device_name=NVIDIA_B200.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=32,N=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=32,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=40,N=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_A100-SXM4-80GB.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_A100-SXM4-80GB.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=128,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1408,device_name=NVIDIA_B200.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H100_PCIe,dtype=fp8_w8a8,block_shape=[128,128].json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=896,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=bf16.json +82 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=8960,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +82 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=192,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +154 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/README +12 -0
- vllm/model_executor/layers/fused_moe/cpu_fused_moe.py +354 -0
- vllm/model_executor/layers/fused_moe/cutlass_moe.py +1052 -0
- vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +387 -0
- vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +416 -0
- vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +420 -0
- vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +367 -0
- vllm/model_executor/layers/fused_moe/flashinfer_cutlass_moe.py +307 -0
- vllm/model_executor/layers/fused_moe/flashinfer_cutlass_prepare_finalize.py +362 -0
- vllm/model_executor/layers/fused_moe/flashinfer_trtllm_moe.py +192 -0
- vllm/model_executor/layers/fused_moe/fused_batched_moe.py +1012 -0
- vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +792 -0
- vllm/model_executor/layers/fused_moe/fused_moe.py +2175 -0
- vllm/model_executor/layers/fused_moe/fused_moe_method_base.py +112 -0
- vllm/model_executor/layers/fused_moe/fused_moe_modular_method.py +164 -0
- vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py +316 -0
- vllm/model_executor/layers/fused_moe/layer.py +1944 -0
- vllm/model_executor/layers/fused_moe/modular_kernel.py +1222 -0
- vllm/model_executor/layers/fused_moe/moe_align_block_size.py +174 -0
- vllm/model_executor/layers/fused_moe/moe_pallas.py +83 -0
- vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +229 -0
- vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
- vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +362 -0
- vllm/model_executor/layers/fused_moe/prepare_finalize.py +77 -0
- vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +265 -0
- vllm/model_executor/layers/fused_moe/routing_simulator.py +310 -0
- vllm/model_executor/layers/fused_moe/shared_fused_moe.py +97 -0
- vllm/model_executor/layers/fused_moe/topk_weight_and_reduce.py +171 -0
- vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +163 -0
- vllm/model_executor/layers/fused_moe/trtllm_moe.py +143 -0
- vllm/model_executor/layers/fused_moe/unquantized_fused_moe_method.py +578 -0
- vllm/model_executor/layers/fused_moe/utils.py +332 -0
- vllm/model_executor/layers/kda.py +448 -0
- vllm/model_executor/layers/layernorm.py +442 -0
- vllm/model_executor/layers/lightning_attn.py +729 -0
- vllm/model_executor/layers/linear.py +1424 -0
- vllm/model_executor/layers/logits_processor.py +106 -0
- vllm/model_executor/layers/mamba/__init__.py +0 -0
- vllm/model_executor/layers/mamba/abstract.py +71 -0
- vllm/model_executor/layers/mamba/linear_attn.py +402 -0
- vllm/model_executor/layers/mamba/mamba_mixer.py +535 -0
- vllm/model_executor/layers/mamba/mamba_mixer2.py +928 -0
- vllm/model_executor/layers/mamba/mamba_utils.py +225 -0
- vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
- vllm/model_executor/layers/mamba/ops/causal_conv1d.py +1240 -0
- vllm/model_executor/layers/mamba/ops/layernorm_gated.py +172 -0
- vllm/model_executor/layers/mamba/ops/mamba_ssm.py +478 -0
- vllm/model_executor/layers/mamba/ops/ssd_bmm.py +211 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +456 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +700 -0
- vllm/model_executor/layers/mamba/ops/ssd_combined.py +230 -0
- vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +157 -0
- vllm/model_executor/layers/mamba/short_conv.py +264 -0
- vllm/model_executor/layers/mla.py +168 -0
- vllm/model_executor/layers/pooler.py +817 -0
- vllm/model_executor/layers/quantization/__init__.py +174 -0
- vllm/model_executor/layers/quantization/auto_round.py +454 -0
- vllm/model_executor/layers/quantization/awq.py +277 -0
- vllm/model_executor/layers/quantization/awq_marlin.py +659 -0
- vllm/model_executor/layers/quantization/awq_triton.py +337 -0
- vllm/model_executor/layers/quantization/base_config.py +170 -0
- vllm/model_executor/layers/quantization/bitblas.py +502 -0
- vllm/model_executor/layers/quantization/bitsandbytes.py +658 -0
- vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +3 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +914 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +2284 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +35 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +392 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +55 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +176 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_nvfp4.py +124 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +218 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_fp8.py +183 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_int.py +153 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +138 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +200 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +125 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +219 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/linear.py +260 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/module.py +173 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/linear_qutlass_nvfp4.py +64 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/utils.py +13 -0
- vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +224 -0
- vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
- vllm/model_executor/layers/quantization/deepspeedfp.py +218 -0
- vllm/model_executor/layers/quantization/experts_int8.py +240 -0
- vllm/model_executor/layers/quantization/fbgemm_fp8.py +195 -0
- vllm/model_executor/layers/quantization/fp8.py +1333 -0
- vllm/model_executor/layers/quantization/fp_quant.py +420 -0
- vllm/model_executor/layers/quantization/gguf.py +643 -0
- vllm/model_executor/layers/quantization/gptq.py +393 -0
- vllm/model_executor/layers/quantization/gptq_bitblas.py +482 -0
- vllm/model_executor/layers/quantization/gptq_marlin.py +789 -0
- vllm/model_executor/layers/quantization/gptq_marlin_24.py +320 -0
- vllm/model_executor/layers/quantization/hqq_marlin.py +371 -0
- vllm/model_executor/layers/quantization/inc.py +65 -0
- vllm/model_executor/layers/quantization/input_quant_fp8.py +171 -0
- vllm/model_executor/layers/quantization/ipex_quant.py +467 -0
- vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +94 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +105 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +115 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +323 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/conch.py +98 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/cutlass.py +119 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/dynamic_4bit.py +111 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +161 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +159 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +166 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +73 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +97 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +120 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/cpu.py +219 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +140 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +42 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +105 -0
- vllm/model_executor/layers/quantization/kv_cache.py +146 -0
- vllm/model_executor/layers/quantization/modelopt.py +1788 -0
- vllm/model_executor/layers/quantization/moe_wna16.py +541 -0
- vllm/model_executor/layers/quantization/mxfp4.py +1162 -0
- vllm/model_executor/layers/quantization/petit.py +320 -0
- vllm/model_executor/layers/quantization/ptpc_fp8.py +137 -0
- vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
- vllm/model_executor/layers/quantization/quark/quark.py +528 -0
- vllm/model_executor/layers/quantization/quark/quark_moe.py +683 -0
- vllm/model_executor/layers/quantization/quark/schemes/__init__.py +9 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_ocp_mx.py +306 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +55 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +179 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +139 -0
- vllm/model_executor/layers/quantization/quark/utils.py +105 -0
- vllm/model_executor/layers/quantization/qutlass_utils.py +185 -0
- vllm/model_executor/layers/quantization/rtn.py +652 -0
- vllm/model_executor/layers/quantization/schema.py +90 -0
- vllm/model_executor/layers/quantization/torchao.py +380 -0
- vllm/model_executor/layers/quantization/tpu_int8.py +139 -0
- vllm/model_executor/layers/quantization/utils/__init__.py +6 -0
- vllm/model_executor/layers/quantization/utils/allspark_utils.py +67 -0
- vllm/model_executor/layers/quantization/utils/bitblas_utils.py +229 -0
- vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +18 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/README.md +3 -0
- vllm/model_executor/layers/quantization/utils/flashinfer_fp4_moe.py +89 -0
- vllm/model_executor/layers/quantization/utils/flashinfer_utils.py +298 -0
- vllm/model_executor/layers/quantization/utils/fp8_utils.py +1203 -0
- vllm/model_executor/layers/quantization/utils/gptq_utils.py +158 -0
- vllm/model_executor/layers/quantization/utils/int8_utils.py +489 -0
- vllm/model_executor/layers/quantization/utils/layer_utils.py +41 -0
- vllm/model_executor/layers/quantization/utils/machete_utils.py +56 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils.py +575 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +397 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +351 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +161 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +467 -0
- vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +181 -0
- vllm/model_executor/layers/quantization/utils/mxfp6_utils.py +142 -0
- vllm/model_executor/layers/quantization/utils/mxfp8_utils.py +24 -0
- vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +142 -0
- vllm/model_executor/layers/quantization/utils/nvfp4_moe_support.py +63 -0
- vllm/model_executor/layers/quantization/utils/ocp_mx_utils.py +51 -0
- vllm/model_executor/layers/quantization/utils/petit_utils.py +124 -0
- vllm/model_executor/layers/quantization/utils/quant_utils.py +687 -0
- vllm/model_executor/layers/quantization/utils/w8a8_utils.py +516 -0
- vllm/model_executor/layers/resampler.py +283 -0
- vllm/model_executor/layers/rotary_embedding/__init__.py +278 -0
- vllm/model_executor/layers/rotary_embedding/base.py +235 -0
- vllm/model_executor/layers/rotary_embedding/common.py +188 -0
- vllm/model_executor/layers/rotary_embedding/deepseek_scaling_rope.py +165 -0
- vllm/model_executor/layers/rotary_embedding/dual_chunk_rope.py +215 -0
- vllm/model_executor/layers/rotary_embedding/dynamic_ntk_alpha_rope.py +43 -0
- vllm/model_executor/layers/rotary_embedding/dynamic_ntk_scaling_rope.py +68 -0
- vllm/model_executor/layers/rotary_embedding/ernie45_vl_rope.py +75 -0
- vllm/model_executor/layers/rotary_embedding/linear_scaling_rope.py +115 -0
- vllm/model_executor/layers/rotary_embedding/llama3_rope.py +54 -0
- vllm/model_executor/layers/rotary_embedding/llama4_vision_rope.py +80 -0
- vllm/model_executor/layers/rotary_embedding/mrope.py +397 -0
- vllm/model_executor/layers/rotary_embedding/ntk_scaling_rope.py +47 -0
- vllm/model_executor/layers/rotary_embedding/phi3_long_rope_scaled_rope.py +159 -0
- vllm/model_executor/layers/rotary_embedding/yarn_scaling_rope.py +81 -0
- vllm/model_executor/layers/utils.py +251 -0
- vllm/model_executor/layers/vocab_parallel_embedding.py +558 -0
- vllm/model_executor/model_loader/__init__.py +148 -0
- vllm/model_executor/model_loader/base_loader.py +57 -0
- vllm/model_executor/model_loader/bitsandbytes_loader.py +822 -0
- vllm/model_executor/model_loader/default_loader.py +327 -0
- vllm/model_executor/model_loader/dummy_loader.py +28 -0
- vllm/model_executor/model_loader/gguf_loader.py +176 -0
- vllm/model_executor/model_loader/online_quantization.py +224 -0
- vllm/model_executor/model_loader/runai_streamer_loader.py +116 -0
- vllm/model_executor/model_loader/sharded_state_loader.py +206 -0
- vllm/model_executor/model_loader/tensorizer.py +790 -0
- vllm/model_executor/model_loader/tensorizer_loader.py +151 -0
- vllm/model_executor/model_loader/tpu.py +118 -0
- vllm/model_executor/model_loader/utils.py +288 -0
- vllm/model_executor/model_loader/weight_utils.py +1084 -0
- vllm/model_executor/models/__init__.py +44 -0
- vllm/model_executor/models/adapters.py +543 -0
- vllm/model_executor/models/afmoe.py +711 -0
- vllm/model_executor/models/aimv2.py +247 -0
- vllm/model_executor/models/apertus.py +587 -0
- vllm/model_executor/models/arcee.py +439 -0
- vllm/model_executor/models/arctic.py +635 -0
- vllm/model_executor/models/aria.py +655 -0
- vllm/model_executor/models/aya_vision.py +450 -0
- vllm/model_executor/models/baichuan.py +496 -0
- vllm/model_executor/models/bailing_moe.py +646 -0
- vllm/model_executor/models/bamba.py +522 -0
- vllm/model_executor/models/bee.py +157 -0
- vllm/model_executor/models/bert.py +925 -0
- vllm/model_executor/models/bert_with_rope.py +732 -0
- vllm/model_executor/models/blip.py +349 -0
- vllm/model_executor/models/blip2.py +695 -0
- vllm/model_executor/models/bloom.py +390 -0
- vllm/model_executor/models/chameleon.py +1120 -0
- vllm/model_executor/models/chatglm.py +498 -0
- vllm/model_executor/models/clip.py +965 -0
- vllm/model_executor/models/cohere2_vision.py +472 -0
- vllm/model_executor/models/commandr.py +473 -0
- vllm/model_executor/models/config.py +503 -0
- vllm/model_executor/models/dbrx.py +482 -0
- vllm/model_executor/models/deepencoder.py +673 -0
- vllm/model_executor/models/deepseek_eagle.py +260 -0
- vllm/model_executor/models/deepseek_mtp.py +360 -0
- vllm/model_executor/models/deepseek_ocr.py +593 -0
- vllm/model_executor/models/deepseek_v2.py +1649 -0
- vllm/model_executor/models/deepseek_vl2.py +655 -0
- vllm/model_executor/models/dots1.py +574 -0
- vllm/model_executor/models/dots_ocr.py +900 -0
- vllm/model_executor/models/ernie45.py +53 -0
- vllm/model_executor/models/ernie45_moe.py +759 -0
- vllm/model_executor/models/ernie45_vl.py +1742 -0
- vllm/model_executor/models/ernie45_vl_moe.py +803 -0
- vllm/model_executor/models/ernie_mtp.py +279 -0
- vllm/model_executor/models/exaone.py +545 -0
- vllm/model_executor/models/exaone4.py +531 -0
- vllm/model_executor/models/fairseq2_llama.py +154 -0
- vllm/model_executor/models/falcon.py +545 -0
- vllm/model_executor/models/falcon_h1.py +685 -0
- vllm/model_executor/models/flex_olmo.py +155 -0
- vllm/model_executor/models/fuyu.py +373 -0
- vllm/model_executor/models/gemma.py +426 -0
- vllm/model_executor/models/gemma2.py +439 -0
- vllm/model_executor/models/gemma3.py +571 -0
- vllm/model_executor/models/gemma3_mm.py +741 -0
- vllm/model_executor/models/gemma3n.py +1165 -0
- vllm/model_executor/models/gemma3n_mm.py +811 -0
- vllm/model_executor/models/glm.py +23 -0
- vllm/model_executor/models/glm4.py +305 -0
- vllm/model_executor/models/glm4_1v.py +1821 -0
- vllm/model_executor/models/glm4_moe.py +747 -0
- vllm/model_executor/models/glm4_moe_mtp.py +359 -0
- vllm/model_executor/models/glm4v.py +784 -0
- vllm/model_executor/models/gpt2.py +397 -0
- vllm/model_executor/models/gpt_bigcode.py +339 -0
- vllm/model_executor/models/gpt_j.py +346 -0
- vllm/model_executor/models/gpt_neox.py +344 -0
- vllm/model_executor/models/gpt_oss.py +738 -0
- vllm/model_executor/models/granite.py +516 -0
- vllm/model_executor/models/granite_speech.py +913 -0
- vllm/model_executor/models/granitemoe.py +569 -0
- vllm/model_executor/models/granitemoehybrid.py +709 -0
- vllm/model_executor/models/granitemoeshared.py +333 -0
- vllm/model_executor/models/gritlm.py +245 -0
- vllm/model_executor/models/grok1.py +558 -0
- vllm/model_executor/models/h2ovl.py +554 -0
- vllm/model_executor/models/hunyuan_v1.py +1053 -0
- vllm/model_executor/models/hyperclovax_vision.py +1166 -0
- vllm/model_executor/models/idefics2_vision_model.py +426 -0
- vllm/model_executor/models/idefics3.py +717 -0
- vllm/model_executor/models/interfaces.py +1092 -0
- vllm/model_executor/models/interfaces_base.py +214 -0
- vllm/model_executor/models/intern_vit.py +453 -0
- vllm/model_executor/models/internlm2.py +460 -0
- vllm/model_executor/models/internlm2_ve.py +142 -0
- vllm/model_executor/models/interns1.py +830 -0
- vllm/model_executor/models/interns1_vit.py +432 -0
- vllm/model_executor/models/internvl.py +1452 -0
- vllm/model_executor/models/jais.py +397 -0
- vllm/model_executor/models/jamba.py +610 -0
- vllm/model_executor/models/jina_vl.py +147 -0
- vllm/model_executor/models/keye.py +1761 -0
- vllm/model_executor/models/keye_vl1_5.py +726 -0
- vllm/model_executor/models/kimi_linear.py +663 -0
- vllm/model_executor/models/kimi_vl.py +578 -0
- vllm/model_executor/models/lfm2.py +532 -0
- vllm/model_executor/models/lfm2_moe.py +762 -0
- vllm/model_executor/models/lightonocr.py +195 -0
- vllm/model_executor/models/llama.py +732 -0
- vllm/model_executor/models/llama4.py +859 -0
- vllm/model_executor/models/llama4_eagle.py +223 -0
- vllm/model_executor/models/llama_eagle.py +218 -0
- vllm/model_executor/models/llama_eagle3.py +367 -0
- vllm/model_executor/models/llava.py +842 -0
- vllm/model_executor/models/llava_next.py +583 -0
- vllm/model_executor/models/llava_next_video.py +467 -0
- vllm/model_executor/models/llava_onevision.py +923 -0
- vllm/model_executor/models/longcat_flash.py +749 -0
- vllm/model_executor/models/longcat_flash_mtp.py +349 -0
- vllm/model_executor/models/mamba.py +276 -0
- vllm/model_executor/models/mamba2.py +289 -0
- vllm/model_executor/models/medusa.py +179 -0
- vllm/model_executor/models/midashenglm.py +827 -0
- vllm/model_executor/models/mimo.py +188 -0
- vllm/model_executor/models/mimo_mtp.py +294 -0
- vllm/model_executor/models/minicpm.py +664 -0
- vllm/model_executor/models/minicpm3.py +242 -0
- vllm/model_executor/models/minicpm_eagle.py +389 -0
- vllm/model_executor/models/minicpmo.py +768 -0
- vllm/model_executor/models/minicpmv.py +1745 -0
- vllm/model_executor/models/minimax_m2.py +552 -0
- vllm/model_executor/models/minimax_text_01.py +1012 -0
- vllm/model_executor/models/minimax_vl_01.py +396 -0
- vllm/model_executor/models/mistral3.py +637 -0
- vllm/model_executor/models/mixtral.py +621 -0
- vllm/model_executor/models/mllama4.py +1147 -0
- vllm/model_executor/models/mlp_speculator.py +235 -0
- vllm/model_executor/models/modernbert.py +450 -0
- vllm/model_executor/models/module_mapping.py +74 -0
- vllm/model_executor/models/molmo.py +1555 -0
- vllm/model_executor/models/moonvit.py +677 -0
- vllm/model_executor/models/mpt.py +335 -0
- vllm/model_executor/models/nano_nemotron_vl.py +1740 -0
- vllm/model_executor/models/nemotron.py +518 -0
- vllm/model_executor/models/nemotron_h.py +852 -0
- vllm/model_executor/models/nemotron_nas.py +491 -0
- vllm/model_executor/models/nemotron_vl.py +653 -0
- vllm/model_executor/models/nvlm_d.py +216 -0
- vllm/model_executor/models/olmo.py +414 -0
- vllm/model_executor/models/olmo2.py +454 -0
- vllm/model_executor/models/olmoe.py +498 -0
- vllm/model_executor/models/openpangu.py +1062 -0
- vllm/model_executor/models/openpangu_mtp.py +265 -0
- vllm/model_executor/models/opt.py +426 -0
- vllm/model_executor/models/orion.py +372 -0
- vllm/model_executor/models/ouro.py +516 -0
- vllm/model_executor/models/ovis.py +559 -0
- vllm/model_executor/models/ovis2_5.py +673 -0
- vllm/model_executor/models/paddleocr_vl.py +1407 -0
- vllm/model_executor/models/paligemma.py +412 -0
- vllm/model_executor/models/persimmon.py +377 -0
- vllm/model_executor/models/phi.py +374 -0
- vllm/model_executor/models/phi3.py +18 -0
- vllm/model_executor/models/phi3v.py +737 -0
- vllm/model_executor/models/phi4_multimodal.py +1447 -0
- vllm/model_executor/models/phi4mm.py +1253 -0
- vllm/model_executor/models/phi4mm_audio.py +1296 -0
- vllm/model_executor/models/phi4mm_utils.py +1907 -0
- vllm/model_executor/models/phimoe.py +675 -0
- vllm/model_executor/models/pixtral.py +1352 -0
- vllm/model_executor/models/plamo2.py +981 -0
- vllm/model_executor/models/qwen.py +368 -0
- vllm/model_executor/models/qwen2.py +541 -0
- vllm/model_executor/models/qwen2_5_omni_thinker.py +1246 -0
- vllm/model_executor/models/qwen2_5_vl.py +1613 -0
- vllm/model_executor/models/qwen2_audio.py +473 -0
- vllm/model_executor/models/qwen2_moe.py +596 -0
- vllm/model_executor/models/qwen2_rm.py +123 -0
- vllm/model_executor/models/qwen2_vl.py +1670 -0
- vllm/model_executor/models/qwen3.py +336 -0
- vllm/model_executor/models/qwen3_moe.py +744 -0
- vllm/model_executor/models/qwen3_next.py +1395 -0
- vllm/model_executor/models/qwen3_next_mtp.py +296 -0
- vllm/model_executor/models/qwen3_omni_moe_thinker.py +1721 -0
- vllm/model_executor/models/qwen3_vl.py +1673 -0
- vllm/model_executor/models/qwen3_vl_moe.py +415 -0
- vllm/model_executor/models/qwen_vl.py +802 -0
- vllm/model_executor/models/radio.py +555 -0
- vllm/model_executor/models/registry.py +1155 -0
- vllm/model_executor/models/roberta.py +259 -0
- vllm/model_executor/models/rvl.py +107 -0
- vllm/model_executor/models/seed_oss.py +497 -0
- vllm/model_executor/models/siglip.py +1174 -0
- vllm/model_executor/models/siglip2navit.py +724 -0
- vllm/model_executor/models/skyworkr1v.py +953 -0
- vllm/model_executor/models/smolvlm.py +38 -0
- vllm/model_executor/models/solar.py +502 -0
- vllm/model_executor/models/stablelm.py +359 -0
- vllm/model_executor/models/starcoder2.py +367 -0
- vllm/model_executor/models/step3_text.py +559 -0
- vllm/model_executor/models/step3_vl.py +1148 -0
- vllm/model_executor/models/swin.py +514 -0
- vllm/model_executor/models/tarsier.py +619 -0
- vllm/model_executor/models/telechat2.py +153 -0
- vllm/model_executor/models/teleflm.py +78 -0
- vllm/model_executor/models/terratorch.py +319 -0
- vllm/model_executor/models/transformers/__init__.py +127 -0
- vllm/model_executor/models/transformers/base.py +464 -0
- vllm/model_executor/models/transformers/causal.py +65 -0
- vllm/model_executor/models/transformers/legacy.py +90 -0
- vllm/model_executor/models/transformers/moe.py +318 -0
- vllm/model_executor/models/transformers/multimodal.py +411 -0
- vllm/model_executor/models/transformers/pooling.py +119 -0
- vllm/model_executor/models/transformers/utils.py +207 -0
- vllm/model_executor/models/ultravox.py +681 -0
- vllm/model_executor/models/utils.py +877 -0
- vllm/model_executor/models/vision.py +552 -0
- vllm/model_executor/models/voxtral.py +845 -0
- vllm/model_executor/models/whisper.py +959 -0
- vllm/model_executor/models/zamba2.py +986 -0
- vllm/model_executor/parameter.py +642 -0
- vllm/model_executor/utils.py +94 -0
- vllm/model_executor/warmup/__init__.py +0 -0
- vllm/model_executor/warmup/deep_gemm_warmup.py +314 -0
- vllm/model_executor/warmup/kernel_warmup.py +98 -0
- vllm/multimodal/__init__.py +40 -0
- vllm/multimodal/audio.py +118 -0
- vllm/multimodal/base.py +26 -0
- vllm/multimodal/cache.py +755 -0
- vllm/multimodal/evs.py +294 -0
- vllm/multimodal/hasher.py +106 -0
- vllm/multimodal/image.py +130 -0
- vllm/multimodal/inputs.py +1036 -0
- vllm/multimodal/parse.py +544 -0
- vllm/multimodal/processing.py +2186 -0
- vllm/multimodal/profiling.py +369 -0
- vllm/multimodal/registry.py +360 -0
- vllm/multimodal/utils.py +512 -0
- vllm/multimodal/video.py +306 -0
- vllm/outputs.py +345 -0
- vllm/platforms/__init__.py +277 -0
- vllm/platforms/cpu.py +414 -0
- vllm/platforms/cuda.py +657 -0
- vllm/platforms/interface.py +639 -0
- vllm/platforms/rocm.py +466 -0
- vllm/platforms/tpu.py +276 -0
- vllm/platforms/xpu.py +274 -0
- vllm/plugins/__init__.py +78 -0
- vllm/plugins/io_processors/__init__.py +68 -0
- vllm/plugins/io_processors/interface.py +77 -0
- vllm/plugins/lora_resolvers/__init__.py +0 -0
- vllm/plugins/lora_resolvers/filesystem_resolver.py +52 -0
- vllm/pooling_params.py +228 -0
- vllm/profiler/__init__.py +0 -0
- vllm/profiler/gpu_profiler.py +37 -0
- vllm/profiler/layerwise_profile.py +392 -0
- vllm/profiler/utils.py +151 -0
- vllm/py.typed +2 -0
- vllm/ray/__init__.py +0 -0
- vllm/ray/lazy_utils.py +26 -0
- vllm/ray/ray_env.py +79 -0
- vllm/reasoning/__init__.py +92 -0
- vllm/reasoning/abs_reasoning_parsers.py +290 -0
- vllm/reasoning/basic_parsers.py +162 -0
- vllm/reasoning/deepseek_r1_reasoning_parser.py +67 -0
- vllm/reasoning/deepseek_v3_reasoning_parser.py +62 -0
- vllm/reasoning/ernie45_reasoning_parser.py +165 -0
- vllm/reasoning/glm4_moe_reasoning_parser.py +171 -0
- vllm/reasoning/gptoss_reasoning_parser.py +173 -0
- vllm/reasoning/granite_reasoning_parser.py +363 -0
- vllm/reasoning/hunyuan_a13b_reasoning_parser.py +237 -0
- vllm/reasoning/identity_reasoning_parser.py +58 -0
- vllm/reasoning/minimax_m2_reasoning_parser.py +67 -0
- vllm/reasoning/mistral_reasoning_parser.py +55 -0
- vllm/reasoning/olmo3_reasoning_parser.py +302 -0
- vllm/reasoning/qwen3_reasoning_parser.py +67 -0
- vllm/reasoning/seedoss_reasoning_parser.py +27 -0
- vllm/reasoning/step3_reasoning_parser.py +107 -0
- vllm/sampling_params.py +669 -0
- vllm/scalar_type.py +355 -0
- vllm/scripts.py +17 -0
- vllm/sequence.py +98 -0
- vllm/tasks.py +13 -0
- vllm/third_party/__init__.py +0 -0
- vllm/third_party/pynvml.py +6140 -0
- vllm/tracing.py +135 -0
- vllm/transformers_utils/__init__.py +26 -0
- vllm/transformers_utils/chat_templates/__init__.py +5 -0
- vllm/transformers_utils/chat_templates/registry.py +73 -0
- vllm/transformers_utils/chat_templates/template_basic.jinja +3 -0
- vllm/transformers_utils/chat_templates/template_blip2.jinja +11 -0
- vllm/transformers_utils/chat_templates/template_chatml.jinja +10 -0
- vllm/transformers_utils/chat_templates/template_deepseek_ocr.jinja +14 -0
- vllm/transformers_utils/chat_templates/template_deepseek_vl2.jinja +23 -0
- vllm/transformers_utils/chat_templates/template_fuyu.jinja +3 -0
- vllm/transformers_utils/chat_templates/template_minicpmv45.jinja +93 -0
- vllm/transformers_utils/config.py +1203 -0
- vllm/transformers_utils/config_parser_base.py +20 -0
- vllm/transformers_utils/configs/__init__.py +70 -0
- vllm/transformers_utils/configs/afmoe.py +84 -0
- vllm/transformers_utils/configs/arctic.py +206 -0
- vllm/transformers_utils/configs/chatglm.py +75 -0
- vllm/transformers_utils/configs/deepseek_vl2.py +126 -0
- vllm/transformers_utils/configs/dotsocr.py +71 -0
- vllm/transformers_utils/configs/eagle.py +84 -0
- vllm/transformers_utils/configs/falcon.py +89 -0
- vllm/transformers_utils/configs/flex_olmo.py +77 -0
- vllm/transformers_utils/configs/jais.py +243 -0
- vllm/transformers_utils/configs/kimi_linear.py +144 -0
- vllm/transformers_utils/configs/kimi_vl.py +38 -0
- vllm/transformers_utils/configs/lfm2_moe.py +159 -0
- vllm/transformers_utils/configs/medusa.py +65 -0
- vllm/transformers_utils/configs/midashenglm.py +103 -0
- vllm/transformers_utils/configs/mistral.py +174 -0
- vllm/transformers_utils/configs/mlp_speculator.py +69 -0
- vllm/transformers_utils/configs/moonvit.py +33 -0
- vllm/transformers_utils/configs/nemotron.py +212 -0
- vllm/transformers_utils/configs/nemotron_h.py +282 -0
- vllm/transformers_utils/configs/olmo3.py +79 -0
- vllm/transformers_utils/configs/ovis.py +182 -0
- vllm/transformers_utils/configs/qwen3_next.py +274 -0
- vllm/transformers_utils/configs/radio.py +89 -0
- vllm/transformers_utils/configs/speculators/__init__.py +2 -0
- vllm/transformers_utils/configs/speculators/algos.py +38 -0
- vllm/transformers_utils/configs/speculators/base.py +114 -0
- vllm/transformers_utils/configs/step3_vl.py +174 -0
- vllm/transformers_utils/configs/ultravox.py +118 -0
- vllm/transformers_utils/detokenizer_utils.py +198 -0
- vllm/transformers_utils/dynamic_module.py +59 -0
- vllm/transformers_utils/processor.py +402 -0
- vllm/transformers_utils/processors/__init__.py +15 -0
- vllm/transformers_utils/processors/deepseek_ocr.py +438 -0
- vllm/transformers_utils/processors/deepseek_vl2.py +406 -0
- vllm/transformers_utils/processors/ovis.py +453 -0
- vllm/transformers_utils/processors/ovis2_5.py +468 -0
- vllm/transformers_utils/runai_utils.py +104 -0
- vllm/transformers_utils/s3_utils.py +95 -0
- vllm/transformers_utils/tokenizer.py +293 -0
- vllm/transformers_utils/tokenizer_base.py +155 -0
- vllm/transformers_utils/tokenizers/__init__.py +16 -0
- vllm/transformers_utils/tokenizers/mistral.py +502 -0
- vllm/transformers_utils/utils.py +130 -0
- vllm/triton_utils/__init__.py +19 -0
- vllm/triton_utils/importing.py +103 -0
- vllm/usage/__init__.py +0 -0
- vllm/usage/usage_lib.py +294 -0
- vllm/utils/__init__.py +82 -0
- vllm/utils/argparse_utils.py +487 -0
- vllm/utils/async_utils.py +303 -0
- vllm/utils/cache.py +214 -0
- vllm/utils/collection_utils.py +139 -0
- vllm/utils/counter.py +45 -0
- vllm/utils/deep_gemm.py +391 -0
- vllm/utils/flashinfer.py +490 -0
- vllm/utils/func_utils.py +236 -0
- vllm/utils/gc_utils.py +147 -0
- vllm/utils/hashing.py +63 -0
- vllm/utils/import_utils.py +411 -0
- vllm/utils/jsontree.py +165 -0
- vllm/utils/math_utils.py +32 -0
- vllm/utils/mem_constants.py +13 -0
- vllm/utils/mem_utils.py +232 -0
- vllm/utils/nccl.py +64 -0
- vllm/utils/network_utils.py +331 -0
- vllm/utils/platform_utils.py +59 -0
- vllm/utils/profiling.py +56 -0
- vllm/utils/registry.py +49 -0
- vllm/utils/serial_utils.py +169 -0
- vllm/utils/system_utils.py +229 -0
- vllm/utils/tensor_schema.py +255 -0
- vllm/utils/torch_utils.py +657 -0
- vllm/v1/__init__.py +0 -0
- vllm/v1/attention/__init__.py +0 -0
- vllm/v1/attention/backends/__init__.py +0 -0
- vllm/v1/attention/backends/cpu_attn.py +496 -0
- vllm/v1/attention/backends/flash_attn.py +1028 -0
- vllm/v1/attention/backends/flashinfer.py +1572 -0
- vllm/v1/attention/backends/flex_attention.py +926 -0
- vllm/v1/attention/backends/gdn_attn.py +387 -0
- vllm/v1/attention/backends/linear_attn.py +74 -0
- vllm/v1/attention/backends/mamba1_attn.py +165 -0
- vllm/v1/attention/backends/mamba2_attn.py +354 -0
- vllm/v1/attention/backends/mamba_attn.py +115 -0
- vllm/v1/attention/backends/mla/__init__.py +0 -0
- vllm/v1/attention/backends/mla/common.py +2031 -0
- vllm/v1/attention/backends/mla/cutlass_mla.py +275 -0
- vllm/v1/attention/backends/mla/flashattn_mla.py +337 -0
- vllm/v1/attention/backends/mla/flashinfer_mla.py +171 -0
- vllm/v1/attention/backends/mla/flashmla.py +314 -0
- vllm/v1/attention/backends/mla/flashmla_sparse.py +548 -0
- vllm/v1/attention/backends/mla/indexer.py +362 -0
- vllm/v1/attention/backends/mla/rocm_aiter_mla.py +294 -0
- vllm/v1/attention/backends/mla/triton_mla.py +171 -0
- vllm/v1/attention/backends/pallas.py +436 -0
- vllm/v1/attention/backends/rocm_aiter_fa.py +816 -0
- vllm/v1/attention/backends/rocm_aiter_unified_attn.py +196 -0
- vllm/v1/attention/backends/rocm_attn.py +362 -0
- vllm/v1/attention/backends/short_conv_attn.py +105 -0
- vllm/v1/attention/backends/tree_attn.py +425 -0
- vllm/v1/attention/backends/triton_attn.py +373 -0
- vllm/v1/attention/backends/utils.py +1116 -0
- vllm/v1/attention/backends/xformers.py +417 -0
- vllm/v1/core/__init__.py +0 -0
- vllm/v1/core/block_pool.py +428 -0
- vllm/v1/core/encoder_cache_manager.py +343 -0
- vllm/v1/core/kv_cache_coordinator.py +480 -0
- vllm/v1/core/kv_cache_manager.py +420 -0
- vllm/v1/core/kv_cache_utils.py +1340 -0
- vllm/v1/core/sched/__init__.py +0 -0
- vllm/v1/core/sched/async_scheduler.py +62 -0
- vllm/v1/core/sched/interface.py +181 -0
- vllm/v1/core/sched/output.py +202 -0
- vllm/v1/core/sched/request_queue.py +221 -0
- vllm/v1/core/sched/scheduler.py +1617 -0
- vllm/v1/core/sched/utils.py +72 -0
- vllm/v1/core/single_type_kv_cache_manager.py +736 -0
- vllm/v1/cudagraph_dispatcher.py +148 -0
- vllm/v1/engine/__init__.py +206 -0
- vllm/v1/engine/async_llm.py +797 -0
- vllm/v1/engine/coordinator.py +377 -0
- vllm/v1/engine/core.py +1420 -0
- vllm/v1/engine/core_client.py +1400 -0
- vllm/v1/engine/detokenizer.py +351 -0
- vllm/v1/engine/exceptions.py +18 -0
- vllm/v1/engine/llm_engine.py +408 -0
- vllm/v1/engine/logprobs.py +182 -0
- vllm/v1/engine/output_processor.py +642 -0
- vllm/v1/engine/parallel_sampling.py +145 -0
- vllm/v1/engine/processor.py +621 -0
- vllm/v1/engine/utils.py +1072 -0
- vllm/v1/executor/__init__.py +6 -0
- vllm/v1/executor/abstract.py +352 -0
- vllm/v1/executor/multiproc_executor.py +877 -0
- vllm/v1/executor/ray_distributed_executor.py +8 -0
- vllm/v1/executor/ray_executor.py +626 -0
- vllm/v1/executor/ray_utils.py +465 -0
- vllm/v1/executor/uniproc_executor.py +183 -0
- vllm/v1/kv_cache_interface.py +403 -0
- vllm/v1/kv_offload/__init__.py +0 -0
- vllm/v1/kv_offload/abstract.py +161 -0
- vllm/v1/kv_offload/arc_manager.py +237 -0
- vllm/v1/kv_offload/backend.py +97 -0
- vllm/v1/kv_offload/backends/__init__.py +0 -0
- vllm/v1/kv_offload/backends/cpu.py +62 -0
- vllm/v1/kv_offload/cpu.py +93 -0
- vllm/v1/kv_offload/factory.py +56 -0
- vllm/v1/kv_offload/lru_manager.py +139 -0
- vllm/v1/kv_offload/mediums.py +39 -0
- vllm/v1/kv_offload/spec.py +62 -0
- vllm/v1/kv_offload/worker/__init__.py +0 -0
- vllm/v1/kv_offload/worker/cpu_gpu.py +185 -0
- vllm/v1/kv_offload/worker/worker.py +144 -0
- vllm/v1/metrics/__init__.py +0 -0
- vllm/v1/metrics/loggers.py +1238 -0
- vllm/v1/metrics/prometheus.py +82 -0
- vllm/v1/metrics/ray_wrappers.py +169 -0
- vllm/v1/metrics/reader.py +257 -0
- vllm/v1/metrics/stats.py +420 -0
- vllm/v1/outputs.py +249 -0
- vllm/v1/pool/__init__.py +0 -0
- vllm/v1/pool/metadata.py +82 -0
- vllm/v1/request.py +259 -0
- vllm/v1/sample/__init__.py +0 -0
- vllm/v1/sample/logits_processor/__init__.py +352 -0
- vllm/v1/sample/logits_processor/builtin.py +274 -0
- vllm/v1/sample/logits_processor/interface.py +106 -0
- vllm/v1/sample/logits_processor/state.py +165 -0
- vllm/v1/sample/metadata.py +44 -0
- vllm/v1/sample/ops/__init__.py +0 -0
- vllm/v1/sample/ops/bad_words.py +52 -0
- vllm/v1/sample/ops/logprobs.py +25 -0
- vllm/v1/sample/ops/penalties.py +57 -0
- vllm/v1/sample/ops/topk_topp_sampler.py +290 -0
- vllm/v1/sample/rejection_sampler.py +793 -0
- vllm/v1/sample/sampler.py +316 -0
- vllm/v1/sample/tpu/__init__.py +0 -0
- vllm/v1/sample/tpu/metadata.py +120 -0
- vllm/v1/sample/tpu/sampler.py +215 -0
- vllm/v1/serial_utils.py +532 -0
- vllm/v1/spec_decode/__init__.py +0 -0
- vllm/v1/spec_decode/eagle.py +1225 -0
- vllm/v1/spec_decode/medusa.py +73 -0
- vllm/v1/spec_decode/metadata.py +66 -0
- vllm/v1/spec_decode/metrics.py +224 -0
- vllm/v1/spec_decode/ngram_proposer.py +291 -0
- vllm/v1/spec_decode/suffix_decoding.py +103 -0
- vllm/v1/spec_decode/utils.py +16 -0
- vllm/v1/structured_output/__init__.py +338 -0
- vllm/v1/structured_output/backend_guidance.py +265 -0
- vllm/v1/structured_output/backend_lm_format_enforcer.py +177 -0
- vllm/v1/structured_output/backend_outlines.py +324 -0
- vllm/v1/structured_output/backend_types.py +136 -0
- vllm/v1/structured_output/backend_xgrammar.py +362 -0
- vllm/v1/structured_output/request.py +94 -0
- vllm/v1/structured_output/utils.py +469 -0
- vllm/v1/utils.py +414 -0
- vllm/v1/worker/__init__.py +0 -0
- vllm/v1/worker/block_table.py +327 -0
- vllm/v1/worker/cpu_model_runner.py +122 -0
- vllm/v1/worker/cpu_worker.py +206 -0
- vllm/v1/worker/dp_utils.py +230 -0
- vllm/v1/worker/ec_connector_model_runner_mixin.py +87 -0
- vllm/v1/worker/gpu_input_batch.py +975 -0
- vllm/v1/worker/gpu_model_runner.py +5102 -0
- vllm/v1/worker/gpu_ubatch_wrapper.py +466 -0
- vllm/v1/worker/gpu_worker.py +894 -0
- vllm/v1/worker/kv_connector_model_runner_mixin.py +144 -0
- vllm/v1/worker/lora_model_runner_mixin.py +213 -0
- vllm/v1/worker/tpu_input_batch.py +593 -0
- vllm/v1/worker/tpu_model_runner.py +2173 -0
- vllm/v1/worker/tpu_worker.py +355 -0
- vllm/v1/worker/ubatch_utils.py +73 -0
- vllm/v1/worker/ubatching.py +231 -0
- vllm/v1/worker/utils.py +366 -0
- vllm/v1/worker/worker_base.py +375 -0
- vllm/v1/worker/xpu_model_runner.py +55 -0
- vllm/v1/worker/xpu_worker.py +189 -0
- vllm/version.py +39 -0
- vllm/vllm_flash_attn/.gitkeep +0 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/METADATA +345 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/RECORD +1536 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/WHEEL +5 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/entry_points.txt +5 -0
- vllm_cpu_amxbf16-0.11.2.post2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1447 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
3
|
+
import math
|
|
4
|
+
from collections.abc import Iterable, Mapping, Sequence
|
|
5
|
+
from typing import Annotated, Any, Literal, TypeAlias
|
|
6
|
+
|
|
7
|
+
import numpy as np
|
|
8
|
+
import torch
|
|
9
|
+
import torch.nn as nn
|
|
10
|
+
import torch.nn.functional as F
|
|
11
|
+
from transformers import (
|
|
12
|
+
BatchFeature,
|
|
13
|
+
Phi4MultimodalAudioConfig,
|
|
14
|
+
Phi4MultimodalConfig,
|
|
15
|
+
Phi4MultimodalFeatureExtractor,
|
|
16
|
+
Phi4MultimodalImageProcessorFast,
|
|
17
|
+
)
|
|
18
|
+
from transformers import Phi4MultimodalProcessor as Phi4MMProcessor
|
|
19
|
+
from transformers.models.phi4_multimodal.modeling_phi4_multimodal import (
|
|
20
|
+
Phi4MultimodalAudioConvModule,
|
|
21
|
+
Phi4MultimodalAudioNemoConvSubsampling,
|
|
22
|
+
Phi4MultimodalAudioRelativeAttentionBias,
|
|
23
|
+
adaptive_enc_mask,
|
|
24
|
+
unfold_tensor,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
from vllm.config import VllmConfig
|
|
28
|
+
from vllm.config.multimodal import BaseDummyOptions
|
|
29
|
+
from vllm.distributed import (
|
|
30
|
+
divide,
|
|
31
|
+
get_tensor_model_parallel_rank,
|
|
32
|
+
get_tensor_model_parallel_world_size,
|
|
33
|
+
)
|
|
34
|
+
from vllm.model_executor.layers.activation import MulAndSilu, get_act_fn
|
|
35
|
+
from vllm.model_executor.layers.linear import (
|
|
36
|
+
ColumnParallelLinear,
|
|
37
|
+
MergedColumnParallelLinear,
|
|
38
|
+
QKVParallelLinear,
|
|
39
|
+
RowParallelLinear,
|
|
40
|
+
)
|
|
41
|
+
from vllm.model_executor.layers.quantization import QuantizationConfig
|
|
42
|
+
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
|
|
43
|
+
from vllm.model_executor.models.module_mapping import MultiModelKeys
|
|
44
|
+
from vllm.multimodal import MULTIMODAL_REGISTRY
|
|
45
|
+
from vllm.multimodal.inputs import (
|
|
46
|
+
MultiModalDataDict,
|
|
47
|
+
MultiModalFieldConfig,
|
|
48
|
+
MultiModalKwargsItems,
|
|
49
|
+
NestedTensors,
|
|
50
|
+
)
|
|
51
|
+
from vllm.multimodal.parse import (
|
|
52
|
+
AudioProcessorItems,
|
|
53
|
+
ImageEmbeddingItems,
|
|
54
|
+
ImageProcessorItems,
|
|
55
|
+
ImageSize,
|
|
56
|
+
MultiModalDataItems,
|
|
57
|
+
MultiModalDataParser,
|
|
58
|
+
)
|
|
59
|
+
from vllm.multimodal.processing import (
|
|
60
|
+
BaseMultiModalProcessor,
|
|
61
|
+
BaseProcessingInfo,
|
|
62
|
+
PromptReplacement,
|
|
63
|
+
PromptUpdate,
|
|
64
|
+
)
|
|
65
|
+
from vllm.multimodal.profiling import BaseDummyInputsBuilder
|
|
66
|
+
from vllm.sequence import IntermediateTensors
|
|
67
|
+
from vllm.utils.tensor_schema import TensorSchema, TensorShape
|
|
68
|
+
|
|
69
|
+
from .idefics2_vision_model import Idefics2VisionTransformer
|
|
70
|
+
from .interfaces import MultiModalEmbeddings, SupportsLoRA, SupportsMultiModal
|
|
71
|
+
from .utils import (
|
|
72
|
+
AutoWeightsLoader,
|
|
73
|
+
WeightsMapper,
|
|
74
|
+
init_vllm_registered_model,
|
|
75
|
+
maybe_prefix,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
_AUDIO_MAX_SOUNDFILE_SIZE = 241_000
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _get_padding_size(
|
|
82
|
+
orig_width: int, orig_height: int, target_height: int, target_width: int
|
|
83
|
+
):
|
|
84
|
+
ratio_width = target_width / orig_width
|
|
85
|
+
ratio_height = target_height / orig_height
|
|
86
|
+
|
|
87
|
+
if ratio_width < ratio_height:
|
|
88
|
+
padding_width = 0
|
|
89
|
+
padding_height = target_height - int(orig_height * ratio_width)
|
|
90
|
+
else:
|
|
91
|
+
padding_width = target_width - int(orig_width * ratio_height)
|
|
92
|
+
padding_height = 0
|
|
93
|
+
return padding_height, padding_width
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class Phi4MMProjector(nn.Module):
|
|
97
|
+
def __init__(self, input_size: int, hidden_size: int):
|
|
98
|
+
super().__init__()
|
|
99
|
+
self.up = ColumnParallelLinear(input_size, hidden_size)
|
|
100
|
+
self.down = RowParallelLinear(hidden_size, hidden_size)
|
|
101
|
+
self.act = get_act_fn("gelu")
|
|
102
|
+
|
|
103
|
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
|
104
|
+
x, _ = self.up(x)
|
|
105
|
+
x = self.act(x)
|
|
106
|
+
x, _ = self.down(x)
|
|
107
|
+
return x
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class Phi4MMImageEmbedding(nn.Module):
|
|
111
|
+
"""Image embedding."""
|
|
112
|
+
|
|
113
|
+
def __init__(self, config: Phi4MultimodalConfig):
|
|
114
|
+
super().__init__()
|
|
115
|
+
self.config = config
|
|
116
|
+
self.layer_idx = config.vision_config.feature_layer
|
|
117
|
+
self.crop_size = config.vision_config.crop_size
|
|
118
|
+
self.image_dim_out = config.vision_config.hidden_size
|
|
119
|
+
|
|
120
|
+
n_patches = config.vision_config.image_size // config.vision_config.patch_size
|
|
121
|
+
if n_patches % 2 != 0:
|
|
122
|
+
self.img_processor_padding = nn.ReflectionPad2d((0, 1, 0, 1))
|
|
123
|
+
n_patches += 1
|
|
124
|
+
self.num_img_tokens = (n_patches // 2) ** 2
|
|
125
|
+
|
|
126
|
+
num_hidden_layers = (
|
|
127
|
+
config.vision_config.num_hidden_layers + self.layer_idx + 1
|
|
128
|
+
if self.layer_idx < 0
|
|
129
|
+
else self.layer_idx + 1
|
|
130
|
+
)
|
|
131
|
+
self.img_processor = Idefics2VisionTransformer(
|
|
132
|
+
config.vision_config,
|
|
133
|
+
require_post_norm=False,
|
|
134
|
+
num_hidden_layers_override=num_hidden_layers,
|
|
135
|
+
)
|
|
136
|
+
self.image_token_compression = nn.AvgPool2d(kernel_size=2, stride=2)
|
|
137
|
+
self.img_projection = Phi4MMProjector(self.image_dim_out, config.hidden_size)
|
|
138
|
+
self.global_img_feature_extensor = nn.Parameter(
|
|
139
|
+
torch.zeros([1, 1, self.image_dim_out])
|
|
140
|
+
)
|
|
141
|
+
self.sub_img_feature_extensor = nn.Parameter(
|
|
142
|
+
torch.zeros([1, 1, 1, self.image_dim_out])
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
def get_img_features(
|
|
146
|
+
self,
|
|
147
|
+
img_embeds: torch.FloatTensor,
|
|
148
|
+
attention_mask: torch.Tensor | None = None,
|
|
149
|
+
) -> torch.FloatTensor:
|
|
150
|
+
img_feature = self.img_processor(
|
|
151
|
+
img_embeds, patch_attention_mask=attention_mask
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
patch_feature = img_feature
|
|
155
|
+
# reshape to 2D tensor
|
|
156
|
+
width = int(math.sqrt(patch_feature.size(1)))
|
|
157
|
+
patch_feature = patch_feature.view(-1, width, width, patch_feature.size(-1))
|
|
158
|
+
# convert to NCHW
|
|
159
|
+
patch_feature = patch_feature.permute(0, 3, 1, 2)
|
|
160
|
+
if getattr(self, "img_processor_padding", None) is not None:
|
|
161
|
+
patch_feature = self.img_processor_padding(patch_feature)
|
|
162
|
+
patch_feature = self.image_token_compression(patch_feature)
|
|
163
|
+
# convert to NHWC
|
|
164
|
+
patch_feature = patch_feature.permute(0, 2, 3, 1)
|
|
165
|
+
patch_feature = patch_feature.view(
|
|
166
|
+
-1, patch_feature.size(1) * patch_feature.size(2), patch_feature.size(-1)
|
|
167
|
+
)
|
|
168
|
+
return patch_feature
|
|
169
|
+
|
|
170
|
+
def forward(
|
|
171
|
+
self,
|
|
172
|
+
image_pixel_values: torch.FloatTensor,
|
|
173
|
+
image_sizes: torch.Tensor | None = None,
|
|
174
|
+
image_attention_mask: torch.Tensor | None = None,
|
|
175
|
+
) -> torch.FloatTensor:
|
|
176
|
+
image_pixel_values = image_pixel_values.to(
|
|
177
|
+
self.img_processor.embeddings.patch_embedding.weight.dtype
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
target_device = self.img_projection.up.bias.device
|
|
181
|
+
target_dtype = self.img_projection.up.bias.dtype
|
|
182
|
+
|
|
183
|
+
batch_size = image_pixel_values.shape[0]
|
|
184
|
+
|
|
185
|
+
img_features = self.get_img_features(
|
|
186
|
+
image_pixel_values.flatten(0, 1),
|
|
187
|
+
attention_mask=image_attention_mask.flatten(0, 1).to(
|
|
188
|
+
dtype=bool, device=target_device
|
|
189
|
+
),
|
|
190
|
+
)
|
|
191
|
+
base_feat_size = int(np.sqrt(img_features.shape[1]))
|
|
192
|
+
img_features = img_features.view(
|
|
193
|
+
batch_size, -1, base_feat_size**2, self.image_dim_out
|
|
194
|
+
)
|
|
195
|
+
image_sizes = image_sizes.view(-1, 2)
|
|
196
|
+
|
|
197
|
+
output_imgs = []
|
|
198
|
+
for idx in range(batch_size):
|
|
199
|
+
height, width = image_sizes[idx]
|
|
200
|
+
height_ratio = height // self.crop_size
|
|
201
|
+
width_ratio = width // self.crop_size
|
|
202
|
+
area_ratio = height_ratio * width_ratio
|
|
203
|
+
|
|
204
|
+
global_img = img_features[idx, :1]
|
|
205
|
+
global_img = global_img.reshape(
|
|
206
|
+
1, base_feat_size, base_feat_size, self.image_dim_out
|
|
207
|
+
).contiguous()
|
|
208
|
+
temporary_extensor = self.sub_img_feature_extensor.repeat(
|
|
209
|
+
1, base_feat_size, 1, 1
|
|
210
|
+
)
|
|
211
|
+
global_img = torch.cat([global_img, temporary_extensor], dim=2).reshape(
|
|
212
|
+
1, -1, self.image_dim_out
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
sub_img = img_features[idx, 1:]
|
|
216
|
+
sub_img = sub_img[:area_ratio]
|
|
217
|
+
sub_img = (
|
|
218
|
+
sub_img.reshape(
|
|
219
|
+
height_ratio,
|
|
220
|
+
width_ratio,
|
|
221
|
+
base_feat_size,
|
|
222
|
+
base_feat_size,
|
|
223
|
+
self.image_dim_out,
|
|
224
|
+
)
|
|
225
|
+
.transpose(1, 2)
|
|
226
|
+
.reshape(
|
|
227
|
+
1,
|
|
228
|
+
height_ratio * base_feat_size,
|
|
229
|
+
width_ratio * base_feat_size,
|
|
230
|
+
self.image_dim_out,
|
|
231
|
+
)
|
|
232
|
+
.contiguous()
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
if image_attention_mask is not None:
|
|
236
|
+
reshaped_image_attention_mask = (
|
|
237
|
+
image_attention_mask[idx, 1 : area_ratio + 1, 0::2, 0::2]
|
|
238
|
+
.reshape(height_ratio, width_ratio, base_feat_size, base_feat_size)
|
|
239
|
+
.transpose(1, 2)
|
|
240
|
+
.reshape(
|
|
241
|
+
1, height_ratio * base_feat_size, width_ratio * base_feat_size
|
|
242
|
+
)
|
|
243
|
+
)
|
|
244
|
+
useful_height = int(reshaped_image_attention_mask[0, :, 0].sum().item())
|
|
245
|
+
useful_width = int(reshaped_image_attention_mask[0, 0, :].sum().item())
|
|
246
|
+
sub_img = sub_img[:, :useful_height, :useful_width]
|
|
247
|
+
temporary_extensor = self.sub_img_feature_extensor.repeat(
|
|
248
|
+
1, useful_height, 1, 1
|
|
249
|
+
)
|
|
250
|
+
else:
|
|
251
|
+
temporary_extensor = self.sub_img_feature_extensor.repeat(
|
|
252
|
+
1, height_ratio * base_feat_size, 1, 1
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
sub_img = torch.cat([sub_img, temporary_extensor], dim=2).reshape(
|
|
256
|
+
1, -1, self.image_dim_out
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
# Merge global and sub
|
|
260
|
+
output_imgs.append(
|
|
261
|
+
torch.cat(
|
|
262
|
+
[sub_img, self.global_img_feature_extensor, global_img], dim=1
|
|
263
|
+
)
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
img_set_tensor = []
|
|
267
|
+
for output_img in output_imgs:
|
|
268
|
+
output_img = output_img.to(device=target_device, dtype=target_dtype)
|
|
269
|
+
img_feature_proj = self.img_projection(output_img)
|
|
270
|
+
img_set_tensor.append(img_feature_proj.flatten(0, 1))
|
|
271
|
+
|
|
272
|
+
return img_set_tensor
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
class Phi4MultimodalAudioMLP(nn.Module):
|
|
276
|
+
def __init__(
|
|
277
|
+
self,
|
|
278
|
+
config: Phi4MultimodalAudioConfig,
|
|
279
|
+
quant_config: QuantizationConfig | None = None,
|
|
280
|
+
prefix: str = "",
|
|
281
|
+
):
|
|
282
|
+
super().__init__()
|
|
283
|
+
self.layer_norm = nn.LayerNorm(config.hidden_size)
|
|
284
|
+
self.act_fn = MulAndSilu()
|
|
285
|
+
self.gate_up_proj = MergedColumnParallelLinear(
|
|
286
|
+
config.hidden_size,
|
|
287
|
+
[config.intermediate_size] * 2,
|
|
288
|
+
bias=True,
|
|
289
|
+
quant_config=quant_config,
|
|
290
|
+
prefix=f"{prefix}.gate_up_proj",
|
|
291
|
+
)
|
|
292
|
+
self.down_proj = RowParallelLinear(
|
|
293
|
+
config.intermediate_size,
|
|
294
|
+
config.hidden_size,
|
|
295
|
+
bias=True,
|
|
296
|
+
quant_config=quant_config,
|
|
297
|
+
prefix=f"{prefix}.down_proj",
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
|
301
|
+
hidden_states = self.layer_norm(hidden_states)
|
|
302
|
+
hidden_states, _ = self.gate_up_proj(hidden_states)
|
|
303
|
+
hidden_states = self.act_fn(hidden_states)
|
|
304
|
+
hidden_states, _ = self.down_proj(hidden_states)
|
|
305
|
+
return hidden_states
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
class Phi4MultimodalAudioAttention(nn.Module):
|
|
309
|
+
def __init__(
|
|
310
|
+
self,
|
|
311
|
+
config: Phi4MultimodalAudioConfig,
|
|
312
|
+
quant_config: QuantizationConfig | None = None,
|
|
313
|
+
prefix: str = "",
|
|
314
|
+
):
|
|
315
|
+
super().__init__()
|
|
316
|
+
self.config = config
|
|
317
|
+
self.embed_dim = config.hidden_size
|
|
318
|
+
self.total_num_heads = config.num_attention_heads
|
|
319
|
+
self.head_dim = self.embed_dim // self.total_num_heads
|
|
320
|
+
if self.head_dim * self.total_num_heads != self.embed_dim:
|
|
321
|
+
raise ValueError(
|
|
322
|
+
"embed_dim must be divisible by num_heads "
|
|
323
|
+
f"(got `embed_dim`: {self.embed_dim} and `num_heads`:"
|
|
324
|
+
f" {self.num_heads})."
|
|
325
|
+
)
|
|
326
|
+
self.scale = self.head_dim**-0.5
|
|
327
|
+
|
|
328
|
+
self.qkv_proj = QKVParallelLinear(
|
|
329
|
+
hidden_size=self.embed_dim,
|
|
330
|
+
head_size=self.head_dim,
|
|
331
|
+
total_num_heads=self.total_num_heads,
|
|
332
|
+
quant_config=quant_config,
|
|
333
|
+
prefix=f"{prefix}.qkv_proj",
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
self.o_proj = RowParallelLinear(
|
|
337
|
+
input_size=self.embed_dim,
|
|
338
|
+
output_size=self.embed_dim,
|
|
339
|
+
quant_config=quant_config,
|
|
340
|
+
prefix=f"{prefix}.out_proj",
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
self.tp_size = get_tensor_model_parallel_world_size()
|
|
344
|
+
self.tp_rank = get_tensor_model_parallel_rank()
|
|
345
|
+
self.num_heads = divide(self.total_num_heads, self.tp_size)
|
|
346
|
+
|
|
347
|
+
def split_attn_mask(self, attention_mask: torch.Tensor) -> torch.Tensor:
|
|
348
|
+
start_idx = self.num_heads * self.tp_rank
|
|
349
|
+
end_idx = self.num_heads * (self.tp_rank + 1)
|
|
350
|
+
return attention_mask[:, start_idx:end_idx]
|
|
351
|
+
|
|
352
|
+
def forward(
|
|
353
|
+
self,
|
|
354
|
+
hidden_states: torch.Tensor,
|
|
355
|
+
attention_mask: torch.Tensor,
|
|
356
|
+
) -> torch.Tensor:
|
|
357
|
+
qkv_states, _ = self.qkv_proj(hidden_states)
|
|
358
|
+
query, key, value = qkv_states.chunk(3, dim=-1)
|
|
359
|
+
|
|
360
|
+
bsz, seq_len, _ = query.size()
|
|
361
|
+
query = query.view(bsz, seq_len, self.num_heads, self.head_dim)
|
|
362
|
+
key = key.view(bsz, seq_len, self.num_heads, self.head_dim)
|
|
363
|
+
value = value.view(bsz, seq_len, self.num_heads, self.head_dim)
|
|
364
|
+
query, key, value = (x.transpose(1, 2) for x in (query, key, value))
|
|
365
|
+
|
|
366
|
+
attention_mask = self.split_attn_mask(attention_mask)
|
|
367
|
+
out = F.scaled_dot_product_attention(
|
|
368
|
+
query,
|
|
369
|
+
key,
|
|
370
|
+
value,
|
|
371
|
+
scale=self.scale,
|
|
372
|
+
attn_mask=attention_mask,
|
|
373
|
+
)
|
|
374
|
+
out = out.transpose(1, 2).reshape(bsz, seq_len, -1)
|
|
375
|
+
|
|
376
|
+
attn_output, _ = self.o_proj(out)
|
|
377
|
+
|
|
378
|
+
return attn_output
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
class Phi4MultimodalAudioConformerEncoderLayer(nn.Module):
|
|
382
|
+
def __init__(self, config: Phi4MultimodalAudioConfig):
|
|
383
|
+
super().__init__()
|
|
384
|
+
|
|
385
|
+
self.feed_forward_in = Phi4MultimodalAudioMLP(config)
|
|
386
|
+
self.self_attn = Phi4MultimodalAudioAttention(config)
|
|
387
|
+
self.conv = Phi4MultimodalAudioConvModule(config)
|
|
388
|
+
self.feed_forward_out = Phi4MultimodalAudioMLP(config)
|
|
389
|
+
self.layer_norm_att = nn.LayerNorm(config.hidden_size)
|
|
390
|
+
self.layer_norm = nn.LayerNorm(config.hidden_size)
|
|
391
|
+
|
|
392
|
+
def forward(
|
|
393
|
+
self,
|
|
394
|
+
hidden_states: torch.Tensor,
|
|
395
|
+
attention_mask: torch.Tensor,
|
|
396
|
+
) -> torch.Tensor:
|
|
397
|
+
residual = hidden_states + 0.5 * self.feed_forward_in(hidden_states)
|
|
398
|
+
hidden_states = self.layer_norm_att(residual)
|
|
399
|
+
|
|
400
|
+
hidden_states = residual + self.self_attn(hidden_states, attention_mask)
|
|
401
|
+
hidden_states = hidden_states + self.conv(hidden_states)
|
|
402
|
+
hidden_states = hidden_states + 0.5 * self.feed_forward_out(hidden_states)
|
|
403
|
+
|
|
404
|
+
out = self.layer_norm(hidden_states)
|
|
405
|
+
|
|
406
|
+
return out
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
class Phi4MMAudioMeanVarianceNormLayer(nn.Module):
|
|
410
|
+
"""Mean/variance normalization layer.
|
|
411
|
+
|
|
412
|
+
Will subtract mean and multiply input by inverted standard deviation.
|
|
413
|
+
Typically used as a very first layer in a model.
|
|
414
|
+
|
|
415
|
+
Args:
|
|
416
|
+
config: [Phi4MultimodalAudioConfig](https://huggingface.co/docs/transformers/model_doc/phi4_multimodal#transformers.Phi4MultimodalAudioConfig)
|
|
417
|
+
object containing model parameters.
|
|
418
|
+
"""
|
|
419
|
+
|
|
420
|
+
def __init__(self, config: Phi4MultimodalAudioConfig):
|
|
421
|
+
super().__init__()
|
|
422
|
+
self.global_mean = nn.Parameter(torch.zeros(config.input_size))
|
|
423
|
+
self.global_invstd = nn.Parameter(torch.ones(config.input_size))
|
|
424
|
+
|
|
425
|
+
def forward(self, input_: torch.Tensor) -> torch.Tensor:
|
|
426
|
+
"""MeanVarianceNormLayer Forward
|
|
427
|
+
|
|
428
|
+
Args:
|
|
429
|
+
input_: torch.Tensor
|
|
430
|
+
input tensor.
|
|
431
|
+
"""
|
|
432
|
+
return (input_ - self.global_mean) * self.global_invstd
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
class Phi4MultimodalAudioModel(nn.Module):
|
|
436
|
+
def __init__(self, config: Phi4MultimodalAudioConfig):
|
|
437
|
+
super().__init__()
|
|
438
|
+
self.config = config
|
|
439
|
+
|
|
440
|
+
self.encoder_embedding = Phi4MMAudioMeanVarianceNormLayer(config)
|
|
441
|
+
self.embed = Phi4MultimodalAudioNemoConvSubsampling(config)
|
|
442
|
+
self.relative_attention_bias_layer = Phi4MultimodalAudioRelativeAttentionBias(
|
|
443
|
+
config
|
|
444
|
+
)
|
|
445
|
+
self.encoders = nn.ModuleList(
|
|
446
|
+
[
|
|
447
|
+
Phi4MultimodalAudioConformerEncoderLayer(config)
|
|
448
|
+
for _ in range(config.num_blocks)
|
|
449
|
+
]
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
def _streaming_mask(
|
|
453
|
+
self,
|
|
454
|
+
seq_len: int,
|
|
455
|
+
batch_size: int,
|
|
456
|
+
chunk_size: int,
|
|
457
|
+
left_chunk: int,
|
|
458
|
+
):
|
|
459
|
+
# Create mask matrix for streaming
|
|
460
|
+
# S stores start index. if chunksize is 18, s is [0,18,36,....]
|
|
461
|
+
chunk_start_idx = np.arange(0, seq_len, chunk_size)
|
|
462
|
+
|
|
463
|
+
enc_streaming_mask = (
|
|
464
|
+
adaptive_enc_mask(seq_len, chunk_start_idx, left_window=left_chunk)
|
|
465
|
+
.unsqueeze(0)
|
|
466
|
+
.expand([batch_size, -1, -1])
|
|
467
|
+
)
|
|
468
|
+
return enc_streaming_mask
|
|
469
|
+
|
|
470
|
+
def forward_embeddings(
|
|
471
|
+
self,
|
|
472
|
+
hidden_states: torch.Tensor,
|
|
473
|
+
masks: torch.Tensor,
|
|
474
|
+
):
|
|
475
|
+
"""Forwarding the inputs through the top embedding layers"""
|
|
476
|
+
seq_len = math.ceil(hidden_states.shape[1] / self.config.time_reduction)
|
|
477
|
+
if seq_len <= 0:
|
|
478
|
+
raise ValueError(
|
|
479
|
+
f"Sequence length after time reduction is invalid: {seq_len}."
|
|
480
|
+
"Your input feature is too short."
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
batch_size = hidden_states.shape[0]
|
|
484
|
+
|
|
485
|
+
enc_streaming_mask = self._streaming_mask(
|
|
486
|
+
seq_len, batch_size, self.config.chunk_size, self.config.left_chunk
|
|
487
|
+
)
|
|
488
|
+
enc_streaming_mask = enc_streaming_mask.to(hidden_states.device)
|
|
489
|
+
|
|
490
|
+
hidden_states, masks = self.embed(hidden_states, masks)
|
|
491
|
+
|
|
492
|
+
streaming_mask = enc_streaming_mask
|
|
493
|
+
if streaming_mask is not None and masks is not None:
|
|
494
|
+
hs_mask = masks & streaming_mask
|
|
495
|
+
elif masks is not None:
|
|
496
|
+
hs_mask = masks
|
|
497
|
+
else:
|
|
498
|
+
hs_mask = streaming_mask
|
|
499
|
+
|
|
500
|
+
return hidden_states, hs_mask, masks
|
|
501
|
+
|
|
502
|
+
def calculate_hs_mask(
|
|
503
|
+
self, hidden_states: torch.Tensor, device: torch.device, mask: torch.Tensor
|
|
504
|
+
):
|
|
505
|
+
max_audio_length = hidden_states.shape[1]
|
|
506
|
+
batch_size = hidden_states.shape[0]
|
|
507
|
+
enc_streaming_mask = self._streaming_mask(
|
|
508
|
+
max_audio_length, batch_size, self.config.chunk_size, self.config.left_chunk
|
|
509
|
+
)
|
|
510
|
+
enc_streaming_mask = enc_streaming_mask.to(device)
|
|
511
|
+
if mask is None:
|
|
512
|
+
return enc_streaming_mask
|
|
513
|
+
|
|
514
|
+
feature_lens = mask.sum(1)
|
|
515
|
+
padding_length = feature_lens
|
|
516
|
+
pad_mask = torch.arange(0, max_audio_length, device=device).expand(
|
|
517
|
+
padding_length.size(0), -1
|
|
518
|
+
) < padding_length.unsqueeze(1)
|
|
519
|
+
pad_mask = pad_mask.unsqueeze(1)
|
|
520
|
+
pad_mask = pad_mask & enc_streaming_mask
|
|
521
|
+
return pad_mask
|
|
522
|
+
|
|
523
|
+
def forward(self, hidden_states: torch.Tensor, mask: torch.Tensor | None = None):
|
|
524
|
+
hidden_states = self.encoder_embedding(hidden_states)
|
|
525
|
+
hidden_states, hs_mask, mask = self.forward_embeddings(hidden_states, mask)
|
|
526
|
+
|
|
527
|
+
unfolded = False
|
|
528
|
+
bs, seq_len, _ = hidden_states.shape
|
|
529
|
+
max_seq_len = 500 # maximum position for absolute positional encoding
|
|
530
|
+
if seq_len > max_seq_len:
|
|
531
|
+
# audio sequence is longer than max_seq_len,
|
|
532
|
+
# unfold it into chunks of max_seq_len
|
|
533
|
+
unfolded = True
|
|
534
|
+
# the unfold op will drop residual frames,
|
|
535
|
+
# pad it to the multiple of max_seq_len
|
|
536
|
+
if seq_len % max_seq_len > 0:
|
|
537
|
+
chunk_pad_size = max_seq_len - (seq_len % max_seq_len)
|
|
538
|
+
else:
|
|
539
|
+
chunk_pad_size = 0
|
|
540
|
+
if chunk_pad_size > 0:
|
|
541
|
+
hidden_states_pad = F.pad(
|
|
542
|
+
hidden_states, (0, 0, 0, chunk_pad_size), "constant", 0
|
|
543
|
+
)
|
|
544
|
+
hidden_states = hidden_states_pad.to(hidden_states.device)
|
|
545
|
+
|
|
546
|
+
hidden_states = unfold_tensor(hidden_states, max_seq_len)
|
|
547
|
+
masks_unfold = None
|
|
548
|
+
if mask is not None:
|
|
549
|
+
# revise hs_mask here because the previous calculated hs_mask
|
|
550
|
+
# did not consider extra pad
|
|
551
|
+
subsampled_pad_mask = mask.squeeze(1) # [bz, subsampled_unmask_seq_len]
|
|
552
|
+
extra_padded_subsamlped_pad_mask = F.pad(
|
|
553
|
+
subsampled_pad_mask, (0, chunk_pad_size), "constant", False
|
|
554
|
+
) # extra padding to the pad mask
|
|
555
|
+
extra_padded_subsamlped_pad_mask = (
|
|
556
|
+
extra_padded_subsamlped_pad_mask.unsqueeze(-1).float()
|
|
557
|
+
)
|
|
558
|
+
masks_unfold = unfold_tensor(
|
|
559
|
+
extra_padded_subsamlped_pad_mask, max_seq_len
|
|
560
|
+
) # unfold the pad mask like we did to the input tensor
|
|
561
|
+
masks_unfold = masks_unfold.squeeze(
|
|
562
|
+
-1
|
|
563
|
+
).bool() # unfold op does not support bool tensor
|
|
564
|
+
hs_mask = self.calculate_hs_mask(
|
|
565
|
+
hidden_states, hidden_states.device, masks_unfold
|
|
566
|
+
) # calculate hs_mask based on the unfolded pad mask
|
|
567
|
+
|
|
568
|
+
relative_attention_bias = self.relative_attention_bias_layer(hidden_states)
|
|
569
|
+
attention_mask = hs_mask.unsqueeze(1) + relative_attention_bias
|
|
570
|
+
|
|
571
|
+
for layer in self.encoders:
|
|
572
|
+
hidden_states = layer(hidden_states, attention_mask)
|
|
573
|
+
|
|
574
|
+
if unfolded:
|
|
575
|
+
embed_dim = hidden_states.shape[-1]
|
|
576
|
+
hidden_states = hidden_states.reshape(bs, -1, embed_dim)
|
|
577
|
+
# if we ever padded before unfolding, we need to remove the padding
|
|
578
|
+
if chunk_pad_size > 0:
|
|
579
|
+
hidden_states = hidden_states[:, :-chunk_pad_size, :]
|
|
580
|
+
|
|
581
|
+
return hidden_states
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
class Phi4MMAudioEmbedding(nn.Module):
|
|
585
|
+
def __init__(self, config: Phi4MultimodalConfig):
|
|
586
|
+
super().__init__()
|
|
587
|
+
self.config = config
|
|
588
|
+
self.layer_idx = config.audio_config.feature_layer
|
|
589
|
+
|
|
590
|
+
self.encoder = Phi4MultimodalAudioModel(config.audio_config)
|
|
591
|
+
|
|
592
|
+
audio_config = config.audio_config
|
|
593
|
+
proj_input_size = audio_config.hidden_size * audio_config.downsample_rate
|
|
594
|
+
self.vision_speech_projection = Phi4MMProjector(
|
|
595
|
+
proj_input_size, config.hidden_size
|
|
596
|
+
)
|
|
597
|
+
self.speech_projection = Phi4MMProjector(proj_input_size, config.hidden_size)
|
|
598
|
+
|
|
599
|
+
def get_projection(
|
|
600
|
+
self,
|
|
601
|
+
audio_projection_mode: Literal["speech", "vision"],
|
|
602
|
+
) -> Phi4MMProjector:
|
|
603
|
+
if audio_projection_mode == "speech":
|
|
604
|
+
return self.speech_projection
|
|
605
|
+
elif audio_projection_mode == "vision":
|
|
606
|
+
return self.vision_speech_projection
|
|
607
|
+
|
|
608
|
+
def forward(
|
|
609
|
+
self,
|
|
610
|
+
audio_input_features: torch.FloatTensor,
|
|
611
|
+
audio_embed_sizes=None,
|
|
612
|
+
audio_attention_mask=None,
|
|
613
|
+
audio_projection_mode="speech",
|
|
614
|
+
) -> torch.FloatTensor:
|
|
615
|
+
audio_projection = self.get_projection(audio_projection_mode)
|
|
616
|
+
|
|
617
|
+
target_device = audio_projection.up.bias.device
|
|
618
|
+
target_dtype = audio_projection.up.bias.dtype
|
|
619
|
+
|
|
620
|
+
audio_input_features = audio_input_features.to(
|
|
621
|
+
device=target_device, dtype=target_dtype
|
|
622
|
+
)
|
|
623
|
+
|
|
624
|
+
audio_encoder_hidden_states = self.encoder(
|
|
625
|
+
audio_input_features, audio_attention_mask
|
|
626
|
+
)
|
|
627
|
+
audio_embeds = audio_projection(audio_encoder_hidden_states)
|
|
628
|
+
|
|
629
|
+
return audio_embeds.flatten(0, 1)
|
|
630
|
+
|
|
631
|
+
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
|
|
632
|
+
stacked_params_mapping = [
|
|
633
|
+
# (param_name, shard_name, shard_id)
|
|
634
|
+
("qkv_proj", "q_proj", "q"),
|
|
635
|
+
("qkv_proj", "k_proj", "k"),
|
|
636
|
+
("qkv_proj", "v_proj", "v"),
|
|
637
|
+
]
|
|
638
|
+
params_dict = dict(self.named_parameters())
|
|
639
|
+
loaded_params: set[str] = set()
|
|
640
|
+
|
|
641
|
+
for name, loaded_weight in weights:
|
|
642
|
+
for param_name, weight_name, shard_id in stacked_params_mapping:
|
|
643
|
+
if weight_name not in name:
|
|
644
|
+
continue
|
|
645
|
+
name = name.replace(weight_name, param_name)
|
|
646
|
+
param = params_dict[name]
|
|
647
|
+
weight_loader = param.weight_loader
|
|
648
|
+
weight_loader(param, loaded_weight, shard_id)
|
|
649
|
+
break
|
|
650
|
+
else:
|
|
651
|
+
param = params_dict[name]
|
|
652
|
+
weight_loader = getattr(param, "weight_loader", default_weight_loader)
|
|
653
|
+
weight_loader(param, loaded_weight)
|
|
654
|
+
loaded_params.add(name)
|
|
655
|
+
return loaded_params
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
class Phi4MMImagePixelInputs(TensorSchema):
|
|
659
|
+
"""
|
|
660
|
+
Dimensions:
|
|
661
|
+
- bn: Batch size * number of images
|
|
662
|
+
- p: Number of patches (1 + num_patches)
|
|
663
|
+
- c: Number of channels (3)
|
|
664
|
+
- h: Height of each image patch
|
|
665
|
+
- w: Width of each image patch
|
|
666
|
+
- nc: Number of crops
|
|
667
|
+
- H_mask: Height of attention mask
|
|
668
|
+
- W_mask: Width of attention mask
|
|
669
|
+
"""
|
|
670
|
+
|
|
671
|
+
type: Literal["pixel_values"]
|
|
672
|
+
|
|
673
|
+
pixel_values: Annotated[
|
|
674
|
+
torch.Tensor | list[torch.Tensor],
|
|
675
|
+
TensorShape(
|
|
676
|
+
"bn", "p", 3, "h", "w", dynamic_dims={"p"}
|
|
677
|
+
), # may be different per batch and image
|
|
678
|
+
]
|
|
679
|
+
|
|
680
|
+
image_sizes: Annotated[
|
|
681
|
+
torch.Tensor,
|
|
682
|
+
TensorShape("bn", 2), # (height, width)
|
|
683
|
+
]
|
|
684
|
+
|
|
685
|
+
num_img_tokens: Annotated[
|
|
686
|
+
list[int],
|
|
687
|
+
TensorShape("bn"),
|
|
688
|
+
]
|
|
689
|
+
|
|
690
|
+
image_attention_mask: Annotated[
|
|
691
|
+
torch.Tensor,
|
|
692
|
+
TensorShape("bn", "nc", 32, 32), # H_mask, W_mask
|
|
693
|
+
]
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
class Phi4MMImageEmbeddingInputs(TensorSchema):
|
|
697
|
+
"""
|
|
698
|
+
Dimensions:
|
|
699
|
+
- bn: Batch size * number of images
|
|
700
|
+
- f: Image feature size
|
|
701
|
+
- h: Hidden size (must match language model backbone)
|
|
702
|
+
"""
|
|
703
|
+
|
|
704
|
+
type: Literal["image_embeds"]
|
|
705
|
+
|
|
706
|
+
data: Annotated[
|
|
707
|
+
torch.Tensor | list[torch.Tensor],
|
|
708
|
+
TensorShape("bn", "f", "h"),
|
|
709
|
+
]
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
class Phi4MMAudioFeatureInputs(TensorSchema):
|
|
713
|
+
"""
|
|
714
|
+
Dimensions:
|
|
715
|
+
- bn: Batch size * number of audios
|
|
716
|
+
- f: Number of Mel filterbank bins (80)
|
|
717
|
+
- t: Time frames (M)
|
|
718
|
+
"""
|
|
719
|
+
|
|
720
|
+
type: Literal["audio_features"]
|
|
721
|
+
|
|
722
|
+
audio_features: Annotated[
|
|
723
|
+
torch.Tensor | list[torch.Tensor],
|
|
724
|
+
TensorShape("bn", "t", 80, dynamic_dims={"t"}),
|
|
725
|
+
]
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
class Phi4MMAudioEmbeddingInputs(TensorSchema):
|
|
729
|
+
"""
|
|
730
|
+
Dimensions:
|
|
731
|
+
- b: Batch size
|
|
732
|
+
- n: Number of audios
|
|
733
|
+
- f: Audio feature size
|
|
734
|
+
- h: Hidden size (must match language model backbone)
|
|
735
|
+
"""
|
|
736
|
+
|
|
737
|
+
type: Literal["audio_embeds"]
|
|
738
|
+
|
|
739
|
+
data: Annotated[
|
|
740
|
+
NestedTensors,
|
|
741
|
+
TensorShape("b", "n", "f", "h"),
|
|
742
|
+
]
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
Phi4MMImageInput: TypeAlias = Phi4MMImagePixelInputs | Phi4MMImageEmbeddingInputs
|
|
746
|
+
Phi4MMAudioInputs: TypeAlias = Phi4MMAudioFeatureInputs | Phi4MMAudioEmbeddingInputs
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
def cat_with_pad(tensors, dim, padding_value=0):
|
|
750
|
+
"""
|
|
751
|
+
cat along dim, while pad to max for all other dims
|
|
752
|
+
"""
|
|
753
|
+
ndim = tensors[0].dim()
|
|
754
|
+
assert all(t.dim() == ndim for t in tensors[1:]), (
|
|
755
|
+
"All tensors must have the same number of dimensions"
|
|
756
|
+
)
|
|
757
|
+
|
|
758
|
+
out_size = [max(t.shape[i] for t in tensors) for i in range(ndim)]
|
|
759
|
+
out_size[dim] = sum(t.shape[dim] for t in tensors)
|
|
760
|
+
output = tensors[0].new_full(out_size, padding_value)
|
|
761
|
+
|
|
762
|
+
index = 0
|
|
763
|
+
for t in tensors:
|
|
764
|
+
# Create a slice list where every dimension except dim is full slice
|
|
765
|
+
slices = [slice(0, t.shape[d]) for d in range(ndim)]
|
|
766
|
+
# Update only the concat dimension slice
|
|
767
|
+
slices[dim] = slice(index, index + t.shape[dim])
|
|
768
|
+
|
|
769
|
+
output[slices] = t
|
|
770
|
+
index += t.shape[dim]
|
|
771
|
+
|
|
772
|
+
return output
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
class Phi4MMProcessingInfo(BaseProcessingInfo):
|
|
776
|
+
def get_hf_config(self) -> Phi4MultimodalConfig:
|
|
777
|
+
return self.ctx.get_hf_config(Phi4MultimodalConfig)
|
|
778
|
+
|
|
779
|
+
def get_hf_processor(self, **kwargs: object) -> Phi4MMProcessor:
|
|
780
|
+
return self.ctx.get_hf_processor(Phi4MMProcessor, **kwargs)
|
|
781
|
+
|
|
782
|
+
def get_feature_extractor(self, **kwargs: object) -> Phi4MultimodalFeatureExtractor:
|
|
783
|
+
return self.get_hf_processor(**kwargs).audio_processor
|
|
784
|
+
|
|
785
|
+
def get_image_processor(
|
|
786
|
+
self,
|
|
787
|
+
processor: Phi4MMProcessor | None = None,
|
|
788
|
+
) -> Phi4MultimodalImageProcessorFast:
|
|
789
|
+
if processor is None:
|
|
790
|
+
processor = self.get_hf_processor()
|
|
791
|
+
return processor.image_processor
|
|
792
|
+
|
|
793
|
+
def get_dynamic_hd(
|
|
794
|
+
self,
|
|
795
|
+
processor: Phi4MMProcessor | None = None,
|
|
796
|
+
) -> int:
|
|
797
|
+
return self.get_image_processor(processor).dynamic_hd
|
|
798
|
+
|
|
799
|
+
def get_supported_mm_limits(self) -> Mapping[str, int | None]:
|
|
800
|
+
return {"audio": None, "image": None}
|
|
801
|
+
|
|
802
|
+
def _find_target_aspect_ratio(
|
|
803
|
+
self,
|
|
804
|
+
orig_width: int,
|
|
805
|
+
orig_height: int,
|
|
806
|
+
image_size: int,
|
|
807
|
+
max_num: int,
|
|
808
|
+
min_num: int,
|
|
809
|
+
):
|
|
810
|
+
w_crop_num = math.ceil(orig_width / float(image_size))
|
|
811
|
+
h_crop_num = math.ceil(orig_height / float(image_size))
|
|
812
|
+
if w_crop_num * h_crop_num > max_num:
|
|
813
|
+
aspect_ratio = orig_width / orig_height
|
|
814
|
+
|
|
815
|
+
# calculate the existing image aspect ratio
|
|
816
|
+
target_ratios = set(
|
|
817
|
+
(i, j)
|
|
818
|
+
for i in range(1, max_num + 1)
|
|
819
|
+
for j in range(1, max_num + 1)
|
|
820
|
+
if i * j <= max_num and i * j >= min_num
|
|
821
|
+
)
|
|
822
|
+
target_ratios = sorted(target_ratios, key=lambda x: x[0] * x[1])
|
|
823
|
+
|
|
824
|
+
# find the closest aspect ratio to the target
|
|
825
|
+
image_processor = self.get_image_processor()
|
|
826
|
+
target_aspect_ratio = image_processor.find_closest_aspect_ratio(
|
|
827
|
+
aspect_ratio,
|
|
828
|
+
target_ratios,
|
|
829
|
+
orig_width,
|
|
830
|
+
orig_height,
|
|
831
|
+
image_size,
|
|
832
|
+
)
|
|
833
|
+
|
|
834
|
+
# calculate the target width and height
|
|
835
|
+
target_width = image_size * target_aspect_ratio[0]
|
|
836
|
+
target_height = image_size * target_aspect_ratio[1]
|
|
837
|
+
else:
|
|
838
|
+
target_width = image_size * w_crop_num
|
|
839
|
+
target_height = image_size * h_crop_num
|
|
840
|
+
target_aspect_ratio = (w_crop_num, h_crop_num)
|
|
841
|
+
return target_aspect_ratio, target_height, target_width
|
|
842
|
+
|
|
843
|
+
def _compute_num_image_tokens(
|
|
844
|
+
self,
|
|
845
|
+
orig_width: int,
|
|
846
|
+
orig_height: int,
|
|
847
|
+
dynamic_hd_size: int,
|
|
848
|
+
vit_image_size: int,
|
|
849
|
+
vit_patch_size: int,
|
|
850
|
+
token_compression_factor: int = 2,
|
|
851
|
+
):
|
|
852
|
+
"""
|
|
853
|
+
compute the number of tokens an image is expected to take up considering
|
|
854
|
+
the image encoder architecture and exclude output features containing
|
|
855
|
+
only padding pixels
|
|
856
|
+
|
|
857
|
+
for siglip, vit_image_size=448, vit_patch_size=14, so output will be
|
|
858
|
+
32x32 feature map
|
|
859
|
+
NOTE right now, Phi4MM uses hard-coded token_compression_factor=2
|
|
860
|
+
"""
|
|
861
|
+
assert vit_image_size % vit_patch_size == 0, (
|
|
862
|
+
"vit_image_size must be divisible by vit_patch_size"
|
|
863
|
+
)
|
|
864
|
+
assert vit_image_size // vit_patch_size % token_compression_factor == 0, (
|
|
865
|
+
"vit_image_size // vit_patch_size must be divisible by "
|
|
866
|
+
"token_compression_factor"
|
|
867
|
+
)
|
|
868
|
+
|
|
869
|
+
target_aspect_ratio, target_height, target_width = (
|
|
870
|
+
self._find_target_aspect_ratio(
|
|
871
|
+
orig_width, orig_height, vit_image_size, dynamic_hd_size, min_num=1
|
|
872
|
+
)
|
|
873
|
+
)
|
|
874
|
+
assert target_aspect_ratio[0] * vit_image_size == target_width, (
|
|
875
|
+
f"{target_aspect_ratio[0]} * {vit_image_size} != {target_width}"
|
|
876
|
+
)
|
|
877
|
+
assert target_aspect_ratio[1] * vit_image_size == target_height, (
|
|
878
|
+
f"{target_aspect_ratio[1]} * {vit_image_size} != {target_height}"
|
|
879
|
+
)
|
|
880
|
+
assert (
|
|
881
|
+
target_height % vit_image_size == 0 and target_width % vit_image_size == 0
|
|
882
|
+
)
|
|
883
|
+
|
|
884
|
+
padding_height, padding_width = _get_padding_size(
|
|
885
|
+
orig_width, orig_height, target_height, target_width
|
|
886
|
+
)
|
|
887
|
+
assert padding_width == 0 or padding_height == 0, (
|
|
888
|
+
"padding_width or padding_height must be 0"
|
|
889
|
+
)
|
|
890
|
+
|
|
891
|
+
target_feat_width = target_width // vit_patch_size
|
|
892
|
+
target_feat_height = target_height // vit_patch_size
|
|
893
|
+
if padding_width >= vit_patch_size:
|
|
894
|
+
assert padding_height == 0, "padding_height not 0"
|
|
895
|
+
non_pad_feat_width = target_feat_width - math.floor(
|
|
896
|
+
padding_width / vit_patch_size
|
|
897
|
+
)
|
|
898
|
+
non_pad_feat_height = target_feat_height
|
|
899
|
+
elif padding_height >= vit_patch_size:
|
|
900
|
+
assert padding_width == 0, "padding_width not 0"
|
|
901
|
+
non_pad_feat_height = target_feat_height - math.floor(
|
|
902
|
+
padding_height / vit_patch_size
|
|
903
|
+
)
|
|
904
|
+
non_pad_feat_width = target_feat_width
|
|
905
|
+
else:
|
|
906
|
+
# small padding shorter than a vit patch
|
|
907
|
+
non_pad_feat_width = target_feat_width
|
|
908
|
+
non_pad_feat_height = target_feat_height
|
|
909
|
+
|
|
910
|
+
feat_width = non_pad_feat_width // token_compression_factor
|
|
911
|
+
feat_height = non_pad_feat_height // token_compression_factor
|
|
912
|
+
# NOTE it's possible that the non-padding feature is not divisible
|
|
913
|
+
if non_pad_feat_width % token_compression_factor != 0:
|
|
914
|
+
feat_width += 1
|
|
915
|
+
if non_pad_feat_height % token_compression_factor != 0:
|
|
916
|
+
feat_height += 1
|
|
917
|
+
num_hd_patch_tokens = feat_width * feat_height
|
|
918
|
+
num_hd_newline_tokens = feat_height
|
|
919
|
+
vit_feature_size = vit_image_size // vit_patch_size
|
|
920
|
+
num_global_image_tokens = (vit_feature_size // token_compression_factor) ** 2
|
|
921
|
+
num_sep_tokens = 1
|
|
922
|
+
num_global_image_newline_tokens = vit_feature_size // token_compression_factor
|
|
923
|
+
|
|
924
|
+
return (
|
|
925
|
+
num_global_image_tokens
|
|
926
|
+
+ num_sep_tokens
|
|
927
|
+
+ num_hd_patch_tokens
|
|
928
|
+
+ num_hd_newline_tokens
|
|
929
|
+
+ num_global_image_newline_tokens
|
|
930
|
+
)
|
|
931
|
+
|
|
932
|
+
def get_num_image_tokens(
|
|
933
|
+
self,
|
|
934
|
+
*,
|
|
935
|
+
image_width: int,
|
|
936
|
+
image_height: int,
|
|
937
|
+
processor: Phi4MMProcessor | None = None,
|
|
938
|
+
) -> int:
|
|
939
|
+
hf_config = self.get_hf_config()
|
|
940
|
+
vision_config = hf_config.vision_config
|
|
941
|
+
vit_image_size = vision_config.image_size
|
|
942
|
+
vit_patch_size = vision_config.patch_size
|
|
943
|
+
|
|
944
|
+
dynamic_hd_size = self.get_dynamic_hd(processor=processor)
|
|
945
|
+
|
|
946
|
+
# we use default `token_compression_factor=2`,
|
|
947
|
+
# since it's not in HF vision config.
|
|
948
|
+
image_num_tokens = self._compute_num_image_tokens(
|
|
949
|
+
image_width,
|
|
950
|
+
image_height,
|
|
951
|
+
dynamic_hd_size=dynamic_hd_size,
|
|
952
|
+
vit_image_size=vit_image_size,
|
|
953
|
+
vit_patch_size=vit_patch_size,
|
|
954
|
+
)
|
|
955
|
+
|
|
956
|
+
return image_num_tokens
|
|
957
|
+
|
|
958
|
+
def get_image_size_with_most_features(
|
|
959
|
+
self,
|
|
960
|
+
processor: Phi4MMProcessor | None = None,
|
|
961
|
+
) -> ImageSize:
|
|
962
|
+
vit_image_size = self.get_hf_config().vision_config.image_size
|
|
963
|
+
|
|
964
|
+
max_side = vit_image_size * self.get_dynamic_hd(processor=processor)
|
|
965
|
+
return ImageSize(height=max_side, width=vit_image_size)
|
|
966
|
+
|
|
967
|
+
def get_audio_num_frames(self, audio_len: int, sr: float) -> int:
|
|
968
|
+
"""
|
|
969
|
+
Compute the output size of the `extract_features` method.
|
|
970
|
+
|
|
971
|
+
Args:
|
|
972
|
+
audio_len (int): Length of the input waveform in samples.
|
|
973
|
+
sr (float): Sampling rate of the waveform, either 16000 or 8000.
|
|
974
|
+
|
|
975
|
+
Returns:
|
|
976
|
+
tuple (int, int): Output size as (T, D), where:
|
|
977
|
+
T: Number of time frames.
|
|
978
|
+
D: Number of Mel filterbank bins (80).
|
|
979
|
+
"""
|
|
980
|
+
|
|
981
|
+
# Resample to 16000 or 8000 if needed
|
|
982
|
+
if sr > 16000:
|
|
983
|
+
audio_len //= sr // 16000
|
|
984
|
+
elif 8000 <= sr < 16000:
|
|
985
|
+
# We'll resample to 16K from 8K
|
|
986
|
+
audio_len *= 2
|
|
987
|
+
elif sr < 8000:
|
|
988
|
+
raise RuntimeError(f"Unsupported sample rate {sr}")
|
|
989
|
+
|
|
990
|
+
# Spectrogram parameters for 16 kHz
|
|
991
|
+
win_length = 400 # Frame length in samples
|
|
992
|
+
hop_length = 160 # Frame shift in samples
|
|
993
|
+
|
|
994
|
+
# Calculate number of frames (T)
|
|
995
|
+
num_frames = (audio_len - win_length) // hop_length + 1
|
|
996
|
+
if num_frames < 1:
|
|
997
|
+
raise ValueError("Waveform too short for given parameters.")
|
|
998
|
+
|
|
999
|
+
# Return time frames (T)
|
|
1000
|
+
return num_frames
|
|
1001
|
+
|
|
1002
|
+
def _compute_audio_embed_size(self, audio_frames: int) -> int:
|
|
1003
|
+
"""
|
|
1004
|
+
Compute the size of audio embeddings from the number of audio frames.
|
|
1005
|
+
"""
|
|
1006
|
+
# `_compute_audio_embed_size` in audio_processor use torch for
|
|
1007
|
+
# computation, therefore we re-implement it to use pythonic
|
|
1008
|
+
# numeric computation to avoid extra tensor conversion.
|
|
1009
|
+
audio_processor = self.get_feature_extractor()
|
|
1010
|
+
audio_compression_rate = audio_processor.audio_compression_rate
|
|
1011
|
+
audio_downsample_rate = audio_processor.audio_downsample_rate
|
|
1012
|
+
|
|
1013
|
+
integer = audio_frames // audio_compression_rate
|
|
1014
|
+
remainder = audio_frames % audio_compression_rate
|
|
1015
|
+
result = integer + int(remainder > 0)
|
|
1016
|
+
|
|
1017
|
+
integer = result // audio_downsample_rate
|
|
1018
|
+
remainder = result % audio_downsample_rate
|
|
1019
|
+
result = integer + int(remainder > 0) # qformer compression
|
|
1020
|
+
|
|
1021
|
+
return result
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
class Phi4MMDummyInputsBuilder(BaseDummyInputsBuilder[Phi4MMProcessingInfo]):
|
|
1025
|
+
def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str:
|
|
1026
|
+
num_audios = mm_counts.get("audio", 0)
|
|
1027
|
+
num_images = mm_counts.get("image", 0)
|
|
1028
|
+
|
|
1029
|
+
tokenizer = self.info.get_tokenizer()
|
|
1030
|
+
image_tokens: str = tokenizer.image_token * num_images
|
|
1031
|
+
audio_tokens: str = tokenizer.audio_token * num_audios
|
|
1032
|
+
|
|
1033
|
+
return image_tokens + audio_tokens
|
|
1034
|
+
|
|
1035
|
+
def get_dummy_mm_data(
|
|
1036
|
+
self,
|
|
1037
|
+
seq_len: int,
|
|
1038
|
+
mm_counts: Mapping[str, int],
|
|
1039
|
+
mm_options: Mapping[str, BaseDummyOptions] | None = None,
|
|
1040
|
+
) -> MultiModalDataDict:
|
|
1041
|
+
num_audios = mm_counts.get("audio", 0)
|
|
1042
|
+
num_images = mm_counts.get("image", 0)
|
|
1043
|
+
|
|
1044
|
+
target_width, target_height = self.info.get_image_size_with_most_features()
|
|
1045
|
+
|
|
1046
|
+
image_overrides = mm_options.get("image") if mm_options else None
|
|
1047
|
+
audio_overrides = mm_options.get("audio") if mm_options else None
|
|
1048
|
+
|
|
1049
|
+
mm_data = {
|
|
1050
|
+
"image": self._get_dummy_images(
|
|
1051
|
+
width=target_width,
|
|
1052
|
+
height=target_height,
|
|
1053
|
+
num_images=num_images,
|
|
1054
|
+
overrides=image_overrides,
|
|
1055
|
+
),
|
|
1056
|
+
"audio": self._get_dummy_audios(
|
|
1057
|
+
length=_AUDIO_MAX_SOUNDFILE_SIZE,
|
|
1058
|
+
num_audios=num_audios,
|
|
1059
|
+
overrides=audio_overrides,
|
|
1060
|
+
),
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
return mm_data
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
class Phi4MMMultiModalProcessor(BaseMultiModalProcessor[Phi4MMProcessingInfo]):
|
|
1067
|
+
def _get_data_parser(self) -> MultiModalDataParser:
|
|
1068
|
+
feature_extractor = self.info.get_feature_extractor()
|
|
1069
|
+
return MultiModalDataParser(target_sr=feature_extractor.sampling_rate)
|
|
1070
|
+
|
|
1071
|
+
def _call_hf_processor(
|
|
1072
|
+
self,
|
|
1073
|
+
prompt: str,
|
|
1074
|
+
mm_data: Mapping[str, object],
|
|
1075
|
+
mm_kwargs: Mapping[str, object],
|
|
1076
|
+
tok_kwargs: Mapping[str, object],
|
|
1077
|
+
) -> BatchFeature:
|
|
1078
|
+
if not mm_data:
|
|
1079
|
+
prompt_ids = self.info.get_tokenizer().encode(prompt)
|
|
1080
|
+
prompt_ids = self._apply_hf_processor_tokens_only(prompt_ids)
|
|
1081
|
+
return BatchFeature(dict(input_ids=[prompt_ids]), tensor_type="pt")
|
|
1082
|
+
|
|
1083
|
+
audio_data = mm_data.pop("audios", [])
|
|
1084
|
+
if audio_data:
|
|
1085
|
+
mm_data["audio"] = audio_data
|
|
1086
|
+
|
|
1087
|
+
processed_outputs = super()._call_hf_processor(
|
|
1088
|
+
prompt, mm_data, mm_kwargs, tok_kwargs
|
|
1089
|
+
)
|
|
1090
|
+
|
|
1091
|
+
if "image_pixel_values" in processed_outputs:
|
|
1092
|
+
num_img_tokens = [
|
|
1093
|
+
self.info.get_num_image_tokens(
|
|
1094
|
+
image_width=img_size[0], image_height=img_size[1]
|
|
1095
|
+
)
|
|
1096
|
+
for img_size in processed_outputs["image_sizes"]
|
|
1097
|
+
]
|
|
1098
|
+
processed_outputs["num_img_tokens"] = num_img_tokens
|
|
1099
|
+
|
|
1100
|
+
if audio_data:
|
|
1101
|
+
audio_features = processed_outputs["audio_input_features"]
|
|
1102
|
+
sr = self.info.get_feature_extractor(**mm_kwargs).sampling_rate
|
|
1103
|
+
feature_sizes = [
|
|
1104
|
+
self.info.get_audio_num_frames(len(audio), sr) for audio in audio_data
|
|
1105
|
+
]
|
|
1106
|
+
processed_outputs["audio_input_features"] = [
|
|
1107
|
+
audio_features[idx, :size] for idx, size in enumerate(feature_sizes)
|
|
1108
|
+
]
|
|
1109
|
+
|
|
1110
|
+
return processed_outputs
|
|
1111
|
+
|
|
1112
|
+
def _get_mm_fields_config(
|
|
1113
|
+
self,
|
|
1114
|
+
hf_inputs: BatchFeature,
|
|
1115
|
+
hf_processor_mm_kwargs: Mapping[str, object],
|
|
1116
|
+
) -> Mapping[str, MultiModalFieldConfig]:
|
|
1117
|
+
return dict(
|
|
1118
|
+
image_pixel_values=MultiModalFieldConfig.batched("image"),
|
|
1119
|
+
image_attention_mask=MultiModalFieldConfig.batched("image"),
|
|
1120
|
+
image_sizes=MultiModalFieldConfig.batched("image"),
|
|
1121
|
+
num_img_tokens=MultiModalFieldConfig.batched("image"),
|
|
1122
|
+
audio_input_features=MultiModalFieldConfig.batched("audio"),
|
|
1123
|
+
)
|
|
1124
|
+
|
|
1125
|
+
def _get_prompt_updates(
|
|
1126
|
+
self,
|
|
1127
|
+
mm_items: MultiModalDataItems,
|
|
1128
|
+
hf_processor_mm_kwargs: Mapping[str, Any],
|
|
1129
|
+
out_mm_kwargs: MultiModalKwargsItems,
|
|
1130
|
+
) -> Sequence[PromptUpdate]:
|
|
1131
|
+
tokenizer = self.info.get_tokenizer()
|
|
1132
|
+
image_token_id: int = tokenizer.vocab[tokenizer.image_token]
|
|
1133
|
+
audio_token_id: int = tokenizer.vocab[tokenizer.audio_token]
|
|
1134
|
+
|
|
1135
|
+
hf_processor = self.info.get_hf_processor(**hf_processor_mm_kwargs)
|
|
1136
|
+
audio_processor = self.info.get_feature_extractor(**hf_processor_mm_kwargs)
|
|
1137
|
+
|
|
1138
|
+
def get_image_replacement_phi4mm(item_idx: int):
|
|
1139
|
+
images = mm_items.get_items(
|
|
1140
|
+
"image", (ImageEmbeddingItems, ImageProcessorItems)
|
|
1141
|
+
)
|
|
1142
|
+
|
|
1143
|
+
if isinstance(images, ImageEmbeddingItems):
|
|
1144
|
+
num_image_tokens = images.get_feature_size(item_idx)
|
|
1145
|
+
else:
|
|
1146
|
+
image_size = images.get_image_size(item_idx)
|
|
1147
|
+
num_image_tokens = self.info.get_num_image_tokens(
|
|
1148
|
+
image_width=image_size.width,
|
|
1149
|
+
image_height=image_size.height,
|
|
1150
|
+
processor=hf_processor,
|
|
1151
|
+
)
|
|
1152
|
+
|
|
1153
|
+
return [image_token_id] * num_image_tokens
|
|
1154
|
+
|
|
1155
|
+
def get_audio_replacement_phi4mm(item_idx: int):
|
|
1156
|
+
audios = mm_items.get_items("audio", AudioProcessorItems)
|
|
1157
|
+
# TODO(Isotr0py): support embedding inputs
|
|
1158
|
+
audio_len = audios.get_audio_length(item_idx)
|
|
1159
|
+
audio_frames = self.info.get_audio_num_frames(
|
|
1160
|
+
audio_len, audio_processor.sampling_rate
|
|
1161
|
+
)
|
|
1162
|
+
audio_embed_size = self.info._compute_audio_embed_size(audio_frames)
|
|
1163
|
+
|
|
1164
|
+
return [audio_token_id] * audio_embed_size
|
|
1165
|
+
|
|
1166
|
+
return [
|
|
1167
|
+
PromptReplacement(
|
|
1168
|
+
modality="audio",
|
|
1169
|
+
target=[audio_token_id],
|
|
1170
|
+
replacement=get_audio_replacement_phi4mm,
|
|
1171
|
+
),
|
|
1172
|
+
PromptReplacement(
|
|
1173
|
+
modality="image",
|
|
1174
|
+
target=[image_token_id],
|
|
1175
|
+
replacement=get_image_replacement_phi4mm,
|
|
1176
|
+
),
|
|
1177
|
+
]
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
@MULTIMODAL_REGISTRY.register_processor(
|
|
1181
|
+
Phi4MMMultiModalProcessor,
|
|
1182
|
+
info=Phi4MMProcessingInfo,
|
|
1183
|
+
dummy_inputs=Phi4MMDummyInputsBuilder,
|
|
1184
|
+
)
|
|
1185
|
+
class Phi4MultimodalForCausalLM(nn.Module, SupportsLoRA, SupportsMultiModal):
|
|
1186
|
+
"""
|
|
1187
|
+
Implements the Phi-4-multimodal-instruct model in vLLM.
|
|
1188
|
+
"""
|
|
1189
|
+
|
|
1190
|
+
merge_by_field_config = True
|
|
1191
|
+
|
|
1192
|
+
packed_modules_mapping = {
|
|
1193
|
+
"qkv_proj": [
|
|
1194
|
+
"qkv_proj",
|
|
1195
|
+
],
|
|
1196
|
+
"gate_up_proj": [
|
|
1197
|
+
"gate_up_proj",
|
|
1198
|
+
],
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
hf_to_vllm_mapper = WeightsMapper(
|
|
1202
|
+
orig_to_new_prefix={
|
|
1203
|
+
# Multimodal embedding
|
|
1204
|
+
"model.embed_tokens_extend.": "",
|
|
1205
|
+
# LLM backbone
|
|
1206
|
+
"model.": "language_model.model.",
|
|
1207
|
+
},
|
|
1208
|
+
orig_to_new_substr={
|
|
1209
|
+
# projection
|
|
1210
|
+
".img_projection_": ".img_projection.",
|
|
1211
|
+
".up_proj_for_speech.": ".speech_projection.up.",
|
|
1212
|
+
".up_proj_for_vision_speech.": ".vision_speech_projection.up.",
|
|
1213
|
+
".down_proj_for_speech.": ".speech_projection.down.",
|
|
1214
|
+
".down_proj_for_vision_speech.": ".vision_speech_projection.down.",
|
|
1215
|
+
},
|
|
1216
|
+
)
|
|
1217
|
+
|
|
1218
|
+
@classmethod
|
|
1219
|
+
def get_placeholder_str(cls, modality: str, i: int) -> str | None:
|
|
1220
|
+
if modality.startswith("image"):
|
|
1221
|
+
return "<|image|>"
|
|
1222
|
+
if modality.startswith("audio"):
|
|
1223
|
+
return "<|audio|>"
|
|
1224
|
+
|
|
1225
|
+
raise ValueError("Only image or audio modality is supported")
|
|
1226
|
+
|
|
1227
|
+
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
|
|
1228
|
+
super().__init__()
|
|
1229
|
+
config = vllm_config.model_config.hf_config
|
|
1230
|
+
multimodal_config = vllm_config.model_config.multimodal_config
|
|
1231
|
+
self.config = config
|
|
1232
|
+
self.multimodal_config = multimodal_config
|
|
1233
|
+
|
|
1234
|
+
# TODO: Optionally initializes these for supporting input embeddings.
|
|
1235
|
+
self.image_embed = Phi4MMImageEmbedding(
|
|
1236
|
+
config,
|
|
1237
|
+
# prefix=maybe_prefix(prefix, "image_embed"),
|
|
1238
|
+
)
|
|
1239
|
+
self.audio_embed = Phi4MMAudioEmbedding(
|
|
1240
|
+
config,
|
|
1241
|
+
# prefix=maybe_prefix(prefix, "audio_embed"),
|
|
1242
|
+
)
|
|
1243
|
+
|
|
1244
|
+
self.language_model = init_vllm_registered_model(
|
|
1245
|
+
vllm_config=vllm_config,
|
|
1246
|
+
prefix=maybe_prefix(prefix, "language_model"),
|
|
1247
|
+
architectures=["Phi3ForCausalLM"],
|
|
1248
|
+
)
|
|
1249
|
+
|
|
1250
|
+
self.make_empty_intermediate_tensors = (
|
|
1251
|
+
self.language_model.make_empty_intermediate_tensors
|
|
1252
|
+
)
|
|
1253
|
+
|
|
1254
|
+
def _parse_and_validate_audio_input(
|
|
1255
|
+
self, **kwargs: object
|
|
1256
|
+
) -> Phi4MMAudioInputs | None:
|
|
1257
|
+
"""
|
|
1258
|
+
Parse and validate the audio input to the model. This handles both
|
|
1259
|
+
audio features and audio embeddings, but only the former is used for
|
|
1260
|
+
now.
|
|
1261
|
+
|
|
1262
|
+
Args:
|
|
1263
|
+
kwargs (object): Keyword arguments.
|
|
1264
|
+
|
|
1265
|
+
Returns:
|
|
1266
|
+
Optional[Phi4MMAudioInputs]: Parsed and validated audio inputs.
|
|
1267
|
+
"""
|
|
1268
|
+
audio_features = kwargs.pop("audio_input_features", None)
|
|
1269
|
+
audio_embeds = kwargs.pop("audio_embeds", None)
|
|
1270
|
+
|
|
1271
|
+
if audio_features is None and audio_embeds is None:
|
|
1272
|
+
return None
|
|
1273
|
+
|
|
1274
|
+
if audio_features is not None:
|
|
1275
|
+
return Phi4MMAudioFeatureInputs(
|
|
1276
|
+
type="audio_features",
|
|
1277
|
+
audio_features=audio_features,
|
|
1278
|
+
)
|
|
1279
|
+
|
|
1280
|
+
if audio_embeds is not None:
|
|
1281
|
+
return Phi4MMAudioEmbeddingInputs(type="audio_embeds", data=audio_embeds)
|
|
1282
|
+
|
|
1283
|
+
raise AssertionError("This line should be unreachable.")
|
|
1284
|
+
|
|
1285
|
+
def _process_audio_input(
|
|
1286
|
+
self, audio_input: Phi4MMAudioInputs, audio_projection_mode: str
|
|
1287
|
+
) -> NestedTensors:
|
|
1288
|
+
"""
|
|
1289
|
+
Create the audio embeddings from the audio input, where the audio input
|
|
1290
|
+
is pairs of audio features and audio embed lengths. The audio input is
|
|
1291
|
+
created by `input_mapper_for_phi4mm_audio`.
|
|
1292
|
+
|
|
1293
|
+
Args:
|
|
1294
|
+
audio_input (Phi4MMAudioInputs): Audio input.
|
|
1295
|
+
|
|
1296
|
+
Returns:
|
|
1297
|
+
NestedTensors: Audio embeddings
|
|
1298
|
+
"""
|
|
1299
|
+
if audio_input["type"] == "audio_embeds":
|
|
1300
|
+
return audio_input["data"]
|
|
1301
|
+
|
|
1302
|
+
audio_features = audio_input["audio_features"]
|
|
1303
|
+
# (e.g. multiple examples) and the second dim is the multi-audio dim
|
|
1304
|
+
# (e.g. multiple audios in the same example)
|
|
1305
|
+
|
|
1306
|
+
dtype = next(self.audio_embed.parameters()).dtype
|
|
1307
|
+
audio_embeds = [
|
|
1308
|
+
self.audio_embed(
|
|
1309
|
+
features.unsqueeze(0).to(dtype),
|
|
1310
|
+
audio_projection_mode=audio_projection_mode,
|
|
1311
|
+
)
|
|
1312
|
+
for features in audio_features
|
|
1313
|
+
]
|
|
1314
|
+
return audio_embeds
|
|
1315
|
+
|
|
1316
|
+
def _parse_and_validate_image_input(
|
|
1317
|
+
self, **kwargs: object
|
|
1318
|
+
) -> Phi4MMImagePixelInputs | None:
|
|
1319
|
+
pixel_values = kwargs.get("image_pixel_values")
|
|
1320
|
+
if pixel_values is None:
|
|
1321
|
+
return None
|
|
1322
|
+
|
|
1323
|
+
image_sizes = kwargs.get("image_sizes")
|
|
1324
|
+
image_attention_mask = kwargs.get("image_attention_mask")
|
|
1325
|
+
num_img_tokens = kwargs.get("num_img_tokens")
|
|
1326
|
+
assert (
|
|
1327
|
+
image_sizes is not None
|
|
1328
|
+
and image_attention_mask is not None
|
|
1329
|
+
and num_img_tokens is not None
|
|
1330
|
+
), "Missing image inputs"
|
|
1331
|
+
|
|
1332
|
+
return Phi4MMImagePixelInputs(
|
|
1333
|
+
type="pixel_values",
|
|
1334
|
+
pixel_values=pixel_values,
|
|
1335
|
+
image_sizes=image_sizes,
|
|
1336
|
+
image_attention_mask=image_attention_mask,
|
|
1337
|
+
num_img_tokens=num_img_tokens,
|
|
1338
|
+
)
|
|
1339
|
+
|
|
1340
|
+
def _parse_and_validate_multimodal_inputs(self, **kwargs: object) -> dict:
|
|
1341
|
+
modalities = {}
|
|
1342
|
+
|
|
1343
|
+
# Preserve the order of modalities if there are multiple of them
|
|
1344
|
+
# from the order of kwargs.
|
|
1345
|
+
for input_key in kwargs:
|
|
1346
|
+
if (
|
|
1347
|
+
input_key in ("image_pixel_values", "image_embeds")
|
|
1348
|
+
and "images" not in modalities
|
|
1349
|
+
):
|
|
1350
|
+
modalities["images"] = self._parse_and_validate_image_input(**kwargs)
|
|
1351
|
+
if (
|
|
1352
|
+
input_key in ("audio_input_features", "audio_embeds")
|
|
1353
|
+
and "audios" not in modalities
|
|
1354
|
+
):
|
|
1355
|
+
modalities["audios"] = self._parse_and_validate_audio_input(**kwargs)
|
|
1356
|
+
|
|
1357
|
+
return modalities
|
|
1358
|
+
|
|
1359
|
+
def _process_image_input(
|
|
1360
|
+
self, image_input: Phi4MMImagePixelInputs
|
|
1361
|
+
) -> list[torch.Tensor]:
|
|
1362
|
+
if image_input["type"] == "image_embeds":
|
|
1363
|
+
image_embeds = image_input["image_embeds"].type(self.visual.dtype)
|
|
1364
|
+
else:
|
|
1365
|
+
dtype = next(self.image_embed.parameters()).dtype
|
|
1366
|
+
pixel_values = image_input["pixel_values"].to(dtype)
|
|
1367
|
+
image_sizes = image_input["image_sizes"]
|
|
1368
|
+
image_attention_mask = image_input["image_attention_mask"]
|
|
1369
|
+
image_embeds = self.image_embed(
|
|
1370
|
+
pixel_values, image_sizes, image_attention_mask
|
|
1371
|
+
)
|
|
1372
|
+
return image_embeds
|
|
1373
|
+
|
|
1374
|
+
def embed_multimodal(self, **kwargs: object) -> MultiModalEmbeddings:
|
|
1375
|
+
modalities = self._parse_and_validate_multimodal_inputs(**kwargs)
|
|
1376
|
+
if not modalities:
|
|
1377
|
+
return []
|
|
1378
|
+
|
|
1379
|
+
# The result multimodal_embeddings is tuple of tensors, with each
|
|
1380
|
+
# tensor corresponding to a multimodal data item (image or video).
|
|
1381
|
+
multimodal_embeddings: tuple[torch.Tensor, ...] = ()
|
|
1382
|
+
|
|
1383
|
+
# NOTE: It is important to iterate over the keys in this dictionary
|
|
1384
|
+
# to preserve the order of the modalities.
|
|
1385
|
+
audio_projection_mode = "speech"
|
|
1386
|
+
for modality in modalities:
|
|
1387
|
+
# make sure process images first
|
|
1388
|
+
if modality == "images":
|
|
1389
|
+
audio_projection_mode = "vision"
|
|
1390
|
+
image_input = modalities["images"]
|
|
1391
|
+
image_embeddings = self._process_image_input(image_input)
|
|
1392
|
+
multimodal_embeddings += tuple(image_embeddings)
|
|
1393
|
+
if modality == "audios":
|
|
1394
|
+
audio_input = modalities["audios"]
|
|
1395
|
+
audio_embeddings = self._process_audio_input(
|
|
1396
|
+
audio_input, audio_projection_mode=audio_projection_mode
|
|
1397
|
+
)
|
|
1398
|
+
multimodal_embeddings += tuple(audio_embeddings)
|
|
1399
|
+
|
|
1400
|
+
return multimodal_embeddings
|
|
1401
|
+
|
|
1402
|
+
def forward(
|
|
1403
|
+
self,
|
|
1404
|
+
input_ids: torch.Tensor,
|
|
1405
|
+
positions: torch.Tensor,
|
|
1406
|
+
intermediate_tensors: IntermediateTensors | None = None,
|
|
1407
|
+
inputs_embeds: torch.Tensor | None = None,
|
|
1408
|
+
**kwargs: object,
|
|
1409
|
+
) -> torch.Tensor:
|
|
1410
|
+
if intermediate_tensors is not None:
|
|
1411
|
+
inputs_embeds = None
|
|
1412
|
+
|
|
1413
|
+
hidden_states = self.language_model(
|
|
1414
|
+
input_ids,
|
|
1415
|
+
positions,
|
|
1416
|
+
intermediate_tensors,
|
|
1417
|
+
inputs_embeds=inputs_embeds,
|
|
1418
|
+
)
|
|
1419
|
+
|
|
1420
|
+
return hidden_states
|
|
1421
|
+
|
|
1422
|
+
def compute_logits(
|
|
1423
|
+
self,
|
|
1424
|
+
hidden_states: torch.Tensor,
|
|
1425
|
+
) -> torch.Tensor | None:
|
|
1426
|
+
return self.language_model.compute_logits(hidden_states)
|
|
1427
|
+
|
|
1428
|
+
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
|
|
1429
|
+
loader = AutoWeightsLoader(self)
|
|
1430
|
+
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
|
|
1431
|
+
|
|
1432
|
+
def get_mm_mapping(self) -> MultiModelKeys:
|
|
1433
|
+
"""
|
|
1434
|
+
Get the module prefix in multimodal models
|
|
1435
|
+
"""
|
|
1436
|
+
return MultiModelKeys.from_string_field(
|
|
1437
|
+
language_model="language_model.",
|
|
1438
|
+
connector=[
|
|
1439
|
+
"img_projection",
|
|
1440
|
+
"vision_speech_projection",
|
|
1441
|
+
"speech_projection",
|
|
1442
|
+
],
|
|
1443
|
+
tower_model=["image_embed", "audio_embed"],
|
|
1444
|
+
)
|
|
1445
|
+
|
|
1446
|
+
def get_language_model(self) -> torch.nn.Module:
|
|
1447
|
+
return self.language_model
|