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,1690 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
3
|
+
|
|
4
|
+
import asyncio
|
|
5
|
+
import inspect
|
|
6
|
+
import json
|
|
7
|
+
from abc import ABC, abstractmethod
|
|
8
|
+
from collections import Counter, defaultdict, deque
|
|
9
|
+
from collections.abc import Awaitable, Callable, Iterable
|
|
10
|
+
from functools import cached_property, lru_cache, partial
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Any, Generic, Literal, TypeAlias, TypeVar, cast
|
|
13
|
+
|
|
14
|
+
import jinja2
|
|
15
|
+
import jinja2.ext
|
|
16
|
+
import jinja2.meta
|
|
17
|
+
import jinja2.nodes
|
|
18
|
+
import jinja2.parser
|
|
19
|
+
import jinja2.sandbox
|
|
20
|
+
import transformers.utils.chat_template_utils as hf_chat_utils
|
|
21
|
+
from openai.types.chat import (
|
|
22
|
+
ChatCompletionAssistantMessageParam,
|
|
23
|
+
ChatCompletionContentPartImageParam,
|
|
24
|
+
ChatCompletionContentPartInputAudioParam,
|
|
25
|
+
ChatCompletionContentPartRefusalParam,
|
|
26
|
+
ChatCompletionContentPartTextParam,
|
|
27
|
+
ChatCompletionMessageToolCallParam,
|
|
28
|
+
ChatCompletionToolMessageParam,
|
|
29
|
+
)
|
|
30
|
+
from openai.types.chat import (
|
|
31
|
+
ChatCompletionContentPartParam as OpenAIChatCompletionContentPartParam,
|
|
32
|
+
)
|
|
33
|
+
from openai.types.chat import (
|
|
34
|
+
ChatCompletionMessageParam as OpenAIChatCompletionMessageParam,
|
|
35
|
+
)
|
|
36
|
+
from openai.types.chat.chat_completion_content_part_input_audio_param import InputAudio
|
|
37
|
+
from openai.types.responses import ResponseInputImageParam
|
|
38
|
+
from openai_harmony import Message as OpenAIHarmonyMessage
|
|
39
|
+
from PIL import Image
|
|
40
|
+
from pydantic import BaseModel, ConfigDict, TypeAdapter
|
|
41
|
+
from transformers import PreTrainedTokenizer, PreTrainedTokenizerFast, ProcessorMixin
|
|
42
|
+
|
|
43
|
+
# pydantic needs the TypedDict from typing_extensions
|
|
44
|
+
from typing_extensions import Required, TypedDict
|
|
45
|
+
|
|
46
|
+
from vllm import envs
|
|
47
|
+
from vllm.config import ModelConfig
|
|
48
|
+
from vllm.logger import init_logger
|
|
49
|
+
from vllm.model_executor.models import SupportsMultiModal
|
|
50
|
+
from vllm.multimodal import MULTIMODAL_REGISTRY, MultiModalDataDict, MultiModalUUIDDict
|
|
51
|
+
from vllm.multimodal.utils import MEDIA_CONNECTOR_REGISTRY, MediaConnector
|
|
52
|
+
from vllm.transformers_utils.chat_templates import get_chat_template_fallback_path
|
|
53
|
+
from vllm.transformers_utils.processor import cached_get_processor
|
|
54
|
+
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
|
|
55
|
+
from vllm.utils import random_uuid
|
|
56
|
+
from vllm.utils.func_utils import supports_kw
|
|
57
|
+
|
|
58
|
+
logger = init_logger(__name__)
|
|
59
|
+
|
|
60
|
+
MODALITY_PLACEHOLDERS_MAP = {
|
|
61
|
+
"image": "<##IMAGE##>",
|
|
62
|
+
"audio": "<##AUDIO##>",
|
|
63
|
+
"video": "<##VIDEO##>",
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class AudioURL(TypedDict, total=False):
|
|
68
|
+
url: Required[str]
|
|
69
|
+
"""
|
|
70
|
+
Either a URL of the audio or a data URL with base64 encoded audio data.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class ChatCompletionContentPartAudioParam(TypedDict, total=False):
|
|
75
|
+
audio_url: Required[AudioURL]
|
|
76
|
+
|
|
77
|
+
type: Required[Literal["audio_url"]]
|
|
78
|
+
"""The type of the content part."""
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class ChatCompletionContentPartImageEmbedsParam(TypedDict, total=False):
|
|
82
|
+
image_embeds: str | dict[str, str] | None
|
|
83
|
+
"""
|
|
84
|
+
The image embeddings. It can be either:
|
|
85
|
+
- A single base64 string.
|
|
86
|
+
- A dictionary where each value is a base64 string.
|
|
87
|
+
"""
|
|
88
|
+
type: Required[Literal["image_embeds"]]
|
|
89
|
+
"""The type of the content part."""
|
|
90
|
+
uuid: str | None
|
|
91
|
+
"""
|
|
92
|
+
User-provided UUID of a media. User must guarantee that it is properly
|
|
93
|
+
generated and unique for different medias.
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class VideoURL(TypedDict, total=False):
|
|
98
|
+
url: Required[str]
|
|
99
|
+
"""
|
|
100
|
+
Either a URL of the video or a data URL with base64 encoded video data.
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class ChatCompletionContentPartVideoParam(TypedDict, total=False):
|
|
105
|
+
video_url: Required[VideoURL]
|
|
106
|
+
|
|
107
|
+
type: Required[Literal["video_url"]]
|
|
108
|
+
"""The type of the content part."""
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class PILImage(BaseModel):
|
|
112
|
+
"""
|
|
113
|
+
A PIL.Image.Image object.
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
image_pil: Image.Image
|
|
117
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class CustomChatCompletionContentPILImageParam(TypedDict, total=False):
|
|
121
|
+
"""A simpler version of the param that only accepts a PIL image.
|
|
122
|
+
|
|
123
|
+
Example:
|
|
124
|
+
{
|
|
125
|
+
"image_pil": ImageAsset('cherry_blossom').pil_image
|
|
126
|
+
}
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
image_pil: PILImage | None
|
|
130
|
+
uuid: str | None
|
|
131
|
+
"""
|
|
132
|
+
User-provided UUID of a media. User must guarantee that it is properly
|
|
133
|
+
generated and unique for different medias.
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class CustomChatCompletionContentSimpleImageParam(TypedDict, total=False):
|
|
138
|
+
"""A simpler version of the param that only accepts a plain image_url.
|
|
139
|
+
This is supported by OpenAI API, although it is not documented.
|
|
140
|
+
|
|
141
|
+
Example:
|
|
142
|
+
{
|
|
143
|
+
"image_url": "https://example.com/image.jpg"
|
|
144
|
+
}
|
|
145
|
+
"""
|
|
146
|
+
|
|
147
|
+
image_url: str | None
|
|
148
|
+
uuid: str | None
|
|
149
|
+
"""
|
|
150
|
+
User-provided UUID of a media. User must guarantee that it is properly
|
|
151
|
+
generated and unique for different medias.
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class CustomChatCompletionContentSimpleAudioParam(TypedDict, total=False):
|
|
156
|
+
"""A simpler version of the param that only accepts a plain audio_url.
|
|
157
|
+
|
|
158
|
+
Example:
|
|
159
|
+
{
|
|
160
|
+
"audio_url": "https://example.com/audio.mp3"
|
|
161
|
+
}
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
audio_url: str | None
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class CustomChatCompletionContentSimpleVideoParam(TypedDict, total=False):
|
|
168
|
+
"""A simpler version of the param that only accepts a plain audio_url.
|
|
169
|
+
|
|
170
|
+
Example:
|
|
171
|
+
{
|
|
172
|
+
"video_url": "https://example.com/video.mp4"
|
|
173
|
+
}
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
video_url: str | None
|
|
177
|
+
uuid: str | None
|
|
178
|
+
"""
|
|
179
|
+
User-provided UUID of a media. User must guarantee that it is properly
|
|
180
|
+
generated and unique for different medias.
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class CustomThinkCompletionContentParam(TypedDict, total=False):
|
|
185
|
+
"""A Think Completion Content Param that accepts a plain text and a boolean.
|
|
186
|
+
|
|
187
|
+
Example:
|
|
188
|
+
{
|
|
189
|
+
"thinking": "I am thinking about the answer",
|
|
190
|
+
"closed": True,
|
|
191
|
+
"type": "thinking"
|
|
192
|
+
}
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
thinking: Required[str]
|
|
196
|
+
"""The thinking content."""
|
|
197
|
+
|
|
198
|
+
closed: bool
|
|
199
|
+
"""Whether the thinking is closed."""
|
|
200
|
+
|
|
201
|
+
type: Required[Literal["thinking"]]
|
|
202
|
+
"""The thinking type."""
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
ChatCompletionContentPartParam: TypeAlias = (
|
|
206
|
+
OpenAIChatCompletionContentPartParam
|
|
207
|
+
| ChatCompletionContentPartAudioParam
|
|
208
|
+
| ChatCompletionContentPartInputAudioParam
|
|
209
|
+
| ChatCompletionContentPartVideoParam
|
|
210
|
+
| ChatCompletionContentPartRefusalParam
|
|
211
|
+
| CustomChatCompletionContentPILImageParam
|
|
212
|
+
| CustomChatCompletionContentSimpleImageParam
|
|
213
|
+
| ChatCompletionContentPartImageEmbedsParam
|
|
214
|
+
| CustomChatCompletionContentSimpleAudioParam
|
|
215
|
+
| CustomChatCompletionContentSimpleVideoParam
|
|
216
|
+
| str
|
|
217
|
+
| CustomThinkCompletionContentParam
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class CustomChatCompletionMessageParam(TypedDict, total=False):
|
|
222
|
+
"""Enables custom roles in the Chat Completion API."""
|
|
223
|
+
|
|
224
|
+
role: Required[str]
|
|
225
|
+
"""The role of the message's author."""
|
|
226
|
+
|
|
227
|
+
content: str | list[ChatCompletionContentPartParam]
|
|
228
|
+
"""The contents of the message."""
|
|
229
|
+
|
|
230
|
+
name: str
|
|
231
|
+
"""An optional name for the participant.
|
|
232
|
+
|
|
233
|
+
Provides the model information to differentiate between participants of the
|
|
234
|
+
same role.
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
tool_call_id: str | None
|
|
238
|
+
"""Tool call that this message is responding to."""
|
|
239
|
+
|
|
240
|
+
tool_calls: Iterable[ChatCompletionMessageToolCallParam] | None
|
|
241
|
+
"""The tool calls generated by the model, such as function calls."""
|
|
242
|
+
|
|
243
|
+
reasoning: str | None
|
|
244
|
+
"""The reasoning content for interleaved thinking."""
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
ChatCompletionMessageParam: TypeAlias = (
|
|
248
|
+
OpenAIChatCompletionMessageParam
|
|
249
|
+
| CustomChatCompletionMessageParam
|
|
250
|
+
| OpenAIHarmonyMessage
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
# TODO: Make fields ReadOnly once mypy supports it
|
|
255
|
+
class ConversationMessage(TypedDict, total=False):
|
|
256
|
+
role: Required[str]
|
|
257
|
+
"""The role of the message's author."""
|
|
258
|
+
|
|
259
|
+
content: str | None | list[dict[str, str]]
|
|
260
|
+
"""The contents of the message"""
|
|
261
|
+
|
|
262
|
+
tool_call_id: str | None
|
|
263
|
+
"""Tool call that this message is responding to."""
|
|
264
|
+
|
|
265
|
+
name: str | None
|
|
266
|
+
"""The name of the function to call"""
|
|
267
|
+
|
|
268
|
+
tool_calls: Iterable[ChatCompletionMessageToolCallParam] | None
|
|
269
|
+
"""The tool calls generated by the model, such as function calls."""
|
|
270
|
+
|
|
271
|
+
reasoning: str | None
|
|
272
|
+
"""The reasoning content for interleaved thinking."""
|
|
273
|
+
|
|
274
|
+
reasoning_content: str | None
|
|
275
|
+
"""Deprecated: The reasoning content for interleaved thinking."""
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
# Passed in by user
|
|
279
|
+
ChatTemplateContentFormatOption = Literal["auto", "string", "openai"]
|
|
280
|
+
|
|
281
|
+
# Used internally
|
|
282
|
+
_ChatTemplateContentFormat = Literal["string", "openai"]
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def _is_var_access(node: jinja2.nodes.Node, varname: str) -> bool:
|
|
286
|
+
if isinstance(node, jinja2.nodes.Name):
|
|
287
|
+
return node.ctx == "load" and node.name == varname
|
|
288
|
+
|
|
289
|
+
return False
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def _is_attr_access(node: jinja2.nodes.Node, varname: str, key: str) -> bool:
|
|
293
|
+
if isinstance(node, jinja2.nodes.Getitem):
|
|
294
|
+
return (
|
|
295
|
+
_is_var_access(node.node, varname)
|
|
296
|
+
and isinstance(node.arg, jinja2.nodes.Const)
|
|
297
|
+
and node.arg.value == key
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
if isinstance(node, jinja2.nodes.Getattr):
|
|
301
|
+
return _is_var_access(node.node, varname) and node.attr == key
|
|
302
|
+
|
|
303
|
+
return False
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
def _is_var_or_elems_access(
|
|
307
|
+
node: jinja2.nodes.Node,
|
|
308
|
+
varname: str,
|
|
309
|
+
key: str | None = None,
|
|
310
|
+
) -> bool:
|
|
311
|
+
if isinstance(node, jinja2.nodes.Filter):
|
|
312
|
+
return node.node is not None and _is_var_or_elems_access(
|
|
313
|
+
node.node, varname, key
|
|
314
|
+
)
|
|
315
|
+
if isinstance(node, jinja2.nodes.Test):
|
|
316
|
+
return _is_var_or_elems_access(node.node, varname, key)
|
|
317
|
+
|
|
318
|
+
if isinstance(node, jinja2.nodes.Getitem) and isinstance(
|
|
319
|
+
node.arg, jinja2.nodes.Slice
|
|
320
|
+
):
|
|
321
|
+
return _is_var_or_elems_access(node.node, varname, key)
|
|
322
|
+
|
|
323
|
+
return _is_attr_access(node, varname, key) if key else _is_var_access(node, varname)
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
def _iter_nodes_assign_var_or_elems(root: jinja2.nodes.Node, varname: str):
|
|
327
|
+
# Global variable that is implicitly defined at the root
|
|
328
|
+
yield root, varname
|
|
329
|
+
|
|
330
|
+
# Iterative BFS
|
|
331
|
+
related_varnames = deque([varname])
|
|
332
|
+
while related_varnames:
|
|
333
|
+
related_varname = related_varnames.popleft()
|
|
334
|
+
|
|
335
|
+
for assign_ast in root.find_all(jinja2.nodes.Assign):
|
|
336
|
+
lhs = assign_ast.target
|
|
337
|
+
rhs = assign_ast.node
|
|
338
|
+
|
|
339
|
+
if _is_var_or_elems_access(rhs, related_varname):
|
|
340
|
+
assert isinstance(lhs, jinja2.nodes.Name)
|
|
341
|
+
yield assign_ast, lhs.name
|
|
342
|
+
|
|
343
|
+
# Avoid infinite looping for self-assignment
|
|
344
|
+
if lhs.name != related_varname:
|
|
345
|
+
related_varnames.append(lhs.name)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
# NOTE: The proper way to handle this is to build a CFG so that we can handle
|
|
349
|
+
# the scope in which each variable is defined, but that is too complicated
|
|
350
|
+
def _iter_nodes_assign_messages_item(root: jinja2.nodes.Node):
|
|
351
|
+
messages_varnames = [
|
|
352
|
+
varname for _, varname in _iter_nodes_assign_var_or_elems(root, "messages")
|
|
353
|
+
]
|
|
354
|
+
|
|
355
|
+
# Search for {%- for message in messages -%} loops
|
|
356
|
+
for loop_ast in root.find_all(jinja2.nodes.For):
|
|
357
|
+
loop_iter = loop_ast.iter
|
|
358
|
+
loop_target = loop_ast.target
|
|
359
|
+
|
|
360
|
+
for varname in messages_varnames:
|
|
361
|
+
if _is_var_or_elems_access(loop_iter, varname):
|
|
362
|
+
assert isinstance(loop_target, jinja2.nodes.Name)
|
|
363
|
+
yield loop_ast, loop_target.name
|
|
364
|
+
break
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
def _iter_nodes_assign_content_item(root: jinja2.nodes.Node):
|
|
368
|
+
message_varnames = [
|
|
369
|
+
varname for _, varname in _iter_nodes_assign_messages_item(root)
|
|
370
|
+
]
|
|
371
|
+
|
|
372
|
+
# Search for {%- for content in message['content'] -%} loops
|
|
373
|
+
for loop_ast in root.find_all(jinja2.nodes.For):
|
|
374
|
+
loop_iter = loop_ast.iter
|
|
375
|
+
loop_target = loop_ast.target
|
|
376
|
+
|
|
377
|
+
for varname in message_varnames:
|
|
378
|
+
if _is_var_or_elems_access(loop_iter, varname, "content"):
|
|
379
|
+
assert isinstance(loop_target, jinja2.nodes.Name)
|
|
380
|
+
yield loop_ast, loop_target.name
|
|
381
|
+
break
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
def _try_extract_ast(chat_template: str) -> jinja2.nodes.Template | None:
|
|
385
|
+
try:
|
|
386
|
+
jinja_compiled = hf_chat_utils._compile_jinja_template(chat_template)
|
|
387
|
+
return jinja_compiled.environment.parse(chat_template)
|
|
388
|
+
except Exception:
|
|
389
|
+
logger.exception("Error when compiling Jinja template")
|
|
390
|
+
return None
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
@lru_cache(maxsize=32)
|
|
394
|
+
def _detect_content_format(
|
|
395
|
+
chat_template: str,
|
|
396
|
+
*,
|
|
397
|
+
default: _ChatTemplateContentFormat,
|
|
398
|
+
) -> _ChatTemplateContentFormat:
|
|
399
|
+
jinja_ast = _try_extract_ast(chat_template)
|
|
400
|
+
if jinja_ast is None:
|
|
401
|
+
return default
|
|
402
|
+
|
|
403
|
+
try:
|
|
404
|
+
next(_iter_nodes_assign_content_item(jinja_ast))
|
|
405
|
+
except StopIteration:
|
|
406
|
+
return "string"
|
|
407
|
+
except Exception:
|
|
408
|
+
logger.exception("Error when parsing AST of Jinja template")
|
|
409
|
+
return default
|
|
410
|
+
else:
|
|
411
|
+
return "openai"
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
def resolve_mistral_chat_template(
|
|
415
|
+
chat_template: str | None,
|
|
416
|
+
**kwargs: Any,
|
|
417
|
+
) -> str | None:
|
|
418
|
+
if chat_template is not None or kwargs.get("chat_template_kwargs") is not None:
|
|
419
|
+
raise ValueError(
|
|
420
|
+
"'chat_template' or 'chat_template_kwargs' cannot be overridden "
|
|
421
|
+
"for mistral tokenizer."
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
return None
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
_PROCESSOR_CHAT_TEMPLATES = dict[tuple[str, bool], str | None]()
|
|
428
|
+
"""
|
|
429
|
+
Used in `_try_get_processor_chat_template` to avoid calling
|
|
430
|
+
`cached_get_processor` again if the processor fails to be loaded.
|
|
431
|
+
|
|
432
|
+
This is needed because `lru_cache` does not cache when an exception happens.
|
|
433
|
+
"""
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
def _try_get_processor_chat_template(
|
|
437
|
+
tokenizer: PreTrainedTokenizer | PreTrainedTokenizerFast,
|
|
438
|
+
model_config: ModelConfig,
|
|
439
|
+
) -> str | None:
|
|
440
|
+
cache_key = (tokenizer.name_or_path, model_config.trust_remote_code)
|
|
441
|
+
if cache_key in _PROCESSOR_CHAT_TEMPLATES:
|
|
442
|
+
return _PROCESSOR_CHAT_TEMPLATES[cache_key]
|
|
443
|
+
|
|
444
|
+
try:
|
|
445
|
+
processor = cached_get_processor(
|
|
446
|
+
tokenizer.name_or_path,
|
|
447
|
+
processor_cls=(
|
|
448
|
+
PreTrainedTokenizer,
|
|
449
|
+
PreTrainedTokenizerFast,
|
|
450
|
+
ProcessorMixin,
|
|
451
|
+
),
|
|
452
|
+
trust_remote_code=model_config.trust_remote_code,
|
|
453
|
+
)
|
|
454
|
+
if (
|
|
455
|
+
isinstance(processor, ProcessorMixin)
|
|
456
|
+
and hasattr(processor, "chat_template")
|
|
457
|
+
and (chat_template := processor.chat_template) is not None
|
|
458
|
+
):
|
|
459
|
+
_PROCESSOR_CHAT_TEMPLATES[cache_key] = chat_template
|
|
460
|
+
return chat_template
|
|
461
|
+
except Exception:
|
|
462
|
+
logger.debug(
|
|
463
|
+
"Failed to load AutoProcessor chat template for %s",
|
|
464
|
+
tokenizer.name_or_path,
|
|
465
|
+
exc_info=True,
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
_PROCESSOR_CHAT_TEMPLATES[cache_key] = None
|
|
469
|
+
return None
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
def resolve_hf_chat_template(
|
|
473
|
+
tokenizer: PreTrainedTokenizer | PreTrainedTokenizerFast,
|
|
474
|
+
chat_template: str | None,
|
|
475
|
+
tools: list[dict[str, Any]] | None,
|
|
476
|
+
*,
|
|
477
|
+
model_config: ModelConfig,
|
|
478
|
+
) -> str | None:
|
|
479
|
+
# 1st priority: The given chat template
|
|
480
|
+
if chat_template is not None:
|
|
481
|
+
return chat_template
|
|
482
|
+
|
|
483
|
+
# 2nd priority: AutoProcessor chat template, unless tool calling is enabled
|
|
484
|
+
if tools is None:
|
|
485
|
+
chat_template = _try_get_processor_chat_template(tokenizer, model_config)
|
|
486
|
+
if chat_template is not None:
|
|
487
|
+
return chat_template
|
|
488
|
+
|
|
489
|
+
# 3rd priority: AutoTokenizer chat template
|
|
490
|
+
try:
|
|
491
|
+
return tokenizer.get_chat_template(chat_template, tools=tools)
|
|
492
|
+
except Exception:
|
|
493
|
+
logger.debug(
|
|
494
|
+
"Failed to load AutoTokenizer chat template for %s",
|
|
495
|
+
tokenizer.name_or_path,
|
|
496
|
+
exc_info=True,
|
|
497
|
+
)
|
|
498
|
+
|
|
499
|
+
# 4th priority: Predefined fallbacks
|
|
500
|
+
path = get_chat_template_fallback_path(
|
|
501
|
+
model_type=model_config.hf_config.model_type,
|
|
502
|
+
tokenizer_name_or_path=model_config.tokenizer,
|
|
503
|
+
)
|
|
504
|
+
if path is not None:
|
|
505
|
+
logger.info_once(
|
|
506
|
+
"Loading chat template fallback for %s as there isn't one "
|
|
507
|
+
"defined on HF Hub.",
|
|
508
|
+
tokenizer.name_or_path,
|
|
509
|
+
)
|
|
510
|
+
chat_template = load_chat_template(path)
|
|
511
|
+
else:
|
|
512
|
+
logger.debug_once(
|
|
513
|
+
"There is no chat template fallback for %s", tokenizer.name_or_path
|
|
514
|
+
)
|
|
515
|
+
|
|
516
|
+
return chat_template
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
def _resolve_chat_template_content_format(
|
|
520
|
+
chat_template: str | None,
|
|
521
|
+
tools: list[dict[str, Any]] | None,
|
|
522
|
+
tokenizer: AnyTokenizer,
|
|
523
|
+
*,
|
|
524
|
+
model_config: ModelConfig,
|
|
525
|
+
) -> _ChatTemplateContentFormat:
|
|
526
|
+
if isinstance(tokenizer, (PreTrainedTokenizer, PreTrainedTokenizerFast)):
|
|
527
|
+
hf_chat_template = resolve_hf_chat_template(
|
|
528
|
+
tokenizer,
|
|
529
|
+
chat_template=chat_template,
|
|
530
|
+
tools=tools,
|
|
531
|
+
model_config=model_config,
|
|
532
|
+
)
|
|
533
|
+
else:
|
|
534
|
+
hf_chat_template = None
|
|
535
|
+
|
|
536
|
+
jinja_text = (
|
|
537
|
+
hf_chat_template
|
|
538
|
+
if isinstance(hf_chat_template, str)
|
|
539
|
+
else load_chat_template(chat_template, is_literal=True)
|
|
540
|
+
)
|
|
541
|
+
|
|
542
|
+
detected_format = (
|
|
543
|
+
"string"
|
|
544
|
+
if jinja_text is None
|
|
545
|
+
else _detect_content_format(jinja_text, default="string")
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
return detected_format
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
@lru_cache
|
|
552
|
+
def _log_chat_template_content_format(
|
|
553
|
+
chat_template: str | None,
|
|
554
|
+
given_format: ChatTemplateContentFormatOption,
|
|
555
|
+
detected_format: ChatTemplateContentFormatOption,
|
|
556
|
+
):
|
|
557
|
+
logger.info(
|
|
558
|
+
"Detected the chat template content format to be '%s'. "
|
|
559
|
+
"You can set `--chat-template-content-format` to override this.",
|
|
560
|
+
detected_format,
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
if given_format != "auto" and given_format != detected_format:
|
|
564
|
+
logger.warning(
|
|
565
|
+
"You specified `--chat-template-content-format %s` "
|
|
566
|
+
"which is different from the detected format '%s'. "
|
|
567
|
+
"If our automatic detection is incorrect, please consider "
|
|
568
|
+
"opening a GitHub issue so that we can improve it: "
|
|
569
|
+
"https://github.com/vllm-project/vllm/issues/new/choose",
|
|
570
|
+
given_format,
|
|
571
|
+
detected_format,
|
|
572
|
+
)
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
def resolve_chat_template_content_format(
|
|
576
|
+
chat_template: str | None,
|
|
577
|
+
tools: list[dict[str, Any]] | None,
|
|
578
|
+
given_format: ChatTemplateContentFormatOption,
|
|
579
|
+
tokenizer: AnyTokenizer,
|
|
580
|
+
*,
|
|
581
|
+
model_config: ModelConfig,
|
|
582
|
+
) -> _ChatTemplateContentFormat:
|
|
583
|
+
if given_format != "auto":
|
|
584
|
+
return given_format
|
|
585
|
+
|
|
586
|
+
detected_format = _resolve_chat_template_content_format(
|
|
587
|
+
chat_template,
|
|
588
|
+
tools,
|
|
589
|
+
tokenizer,
|
|
590
|
+
model_config=model_config,
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
_log_chat_template_content_format(
|
|
594
|
+
chat_template,
|
|
595
|
+
given_format=given_format,
|
|
596
|
+
detected_format=detected_format,
|
|
597
|
+
)
|
|
598
|
+
|
|
599
|
+
return detected_format
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
ModalityStr = Literal["image", "audio", "video", "image_embeds"]
|
|
603
|
+
_T = TypeVar("_T")
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
class BaseMultiModalItemTracker(ABC, Generic[_T]):
|
|
607
|
+
"""
|
|
608
|
+
Tracks multi-modal items in a given request and ensures that the number
|
|
609
|
+
of multi-modal items in a given request does not exceed the configured
|
|
610
|
+
maximum per prompt.
|
|
611
|
+
"""
|
|
612
|
+
|
|
613
|
+
def __init__(self, model_config: ModelConfig, tokenizer: AnyTokenizer):
|
|
614
|
+
super().__init__()
|
|
615
|
+
|
|
616
|
+
self._model_config = model_config
|
|
617
|
+
self._tokenizer = tokenizer
|
|
618
|
+
|
|
619
|
+
self._items_by_modality = defaultdict[str, list[_T | None]](list)
|
|
620
|
+
self._uuids_by_modality = defaultdict[str, list[str | None]](list)
|
|
621
|
+
|
|
622
|
+
@property
|
|
623
|
+
def model_config(self) -> ModelConfig:
|
|
624
|
+
return self._model_config
|
|
625
|
+
|
|
626
|
+
@cached_property
|
|
627
|
+
def model_cls(self) -> type[SupportsMultiModal]:
|
|
628
|
+
from vllm.model_executor.model_loader import get_model_cls
|
|
629
|
+
|
|
630
|
+
model_cls = get_model_cls(self.model_config)
|
|
631
|
+
return cast(type[SupportsMultiModal], model_cls)
|
|
632
|
+
|
|
633
|
+
@property
|
|
634
|
+
def allowed_local_media_path(self):
|
|
635
|
+
return self._model_config.allowed_local_media_path
|
|
636
|
+
|
|
637
|
+
@property
|
|
638
|
+
def allowed_media_domains(self):
|
|
639
|
+
return self._model_config.allowed_media_domains
|
|
640
|
+
|
|
641
|
+
@property
|
|
642
|
+
def mm_registry(self):
|
|
643
|
+
return MULTIMODAL_REGISTRY
|
|
644
|
+
|
|
645
|
+
@cached_property
|
|
646
|
+
def mm_processor(self):
|
|
647
|
+
return self.mm_registry.create_processor(self.model_config)
|
|
648
|
+
|
|
649
|
+
def add(
|
|
650
|
+
self,
|
|
651
|
+
modality: ModalityStr,
|
|
652
|
+
item: _T | None,
|
|
653
|
+
uuid: str | None = None,
|
|
654
|
+
) -> str | None:
|
|
655
|
+
"""
|
|
656
|
+
Add a multi-modal item to the current prompt and returns the
|
|
657
|
+
placeholder string to use, if any.
|
|
658
|
+
|
|
659
|
+
An optional uuid can be added which serves as a unique identifier of the
|
|
660
|
+
media.
|
|
661
|
+
"""
|
|
662
|
+
input_modality = modality.replace("_embeds", "")
|
|
663
|
+
num_items = len(self._items_by_modality[modality]) + 1
|
|
664
|
+
|
|
665
|
+
self.mm_processor.validate_num_items(input_modality, num_items)
|
|
666
|
+
|
|
667
|
+
self._items_by_modality[modality].append(item)
|
|
668
|
+
self._uuids_by_modality[modality].append(uuid)
|
|
669
|
+
|
|
670
|
+
return self.model_cls.get_placeholder_str(modality, num_items)
|
|
671
|
+
|
|
672
|
+
def all_mm_uuids(self) -> MultiModalUUIDDict | None:
|
|
673
|
+
if not self._items_by_modality:
|
|
674
|
+
return None
|
|
675
|
+
mm_uuids = {}
|
|
676
|
+
uuids_by_modality = dict(self._uuids_by_modality)
|
|
677
|
+
if "image" in uuids_by_modality and "image_embeds" in uuids_by_modality:
|
|
678
|
+
raise ValueError("Mixing raw image and embedding inputs is not allowed")
|
|
679
|
+
|
|
680
|
+
if "image_embeds" in uuids_by_modality:
|
|
681
|
+
image_embeds_uuids = uuids_by_modality["image_embeds"]
|
|
682
|
+
if len(image_embeds_uuids) > 1:
|
|
683
|
+
raise ValueError("Only one message can have {'type': 'image_embeds'}")
|
|
684
|
+
mm_uuids["image"] = uuids_by_modality["image_embeds"]
|
|
685
|
+
if "image" in uuids_by_modality:
|
|
686
|
+
mm_uuids["image"] = uuids_by_modality["image"] # UUIDs of images
|
|
687
|
+
if "audio" in uuids_by_modality:
|
|
688
|
+
mm_uuids["audio"] = uuids_by_modality["audio"] # UUIDs of audios
|
|
689
|
+
if "video" in uuids_by_modality:
|
|
690
|
+
mm_uuids["video"] = uuids_by_modality["video"] # UUIDs of videos
|
|
691
|
+
return mm_uuids
|
|
692
|
+
|
|
693
|
+
@abstractmethod
|
|
694
|
+
def create_parser(self) -> "BaseMultiModalContentParser":
|
|
695
|
+
raise NotImplementedError
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
class MultiModalItemTracker(BaseMultiModalItemTracker[object]):
|
|
699
|
+
def all_mm_data(self) -> MultiModalDataDict | None:
|
|
700
|
+
if not self._items_by_modality:
|
|
701
|
+
return None
|
|
702
|
+
mm_inputs = {}
|
|
703
|
+
items_by_modality = dict(self._items_by_modality)
|
|
704
|
+
if "image" in items_by_modality and "image_embeds" in items_by_modality:
|
|
705
|
+
raise ValueError("Mixing raw image and embedding inputs is not allowed")
|
|
706
|
+
|
|
707
|
+
if "image_embeds" in items_by_modality:
|
|
708
|
+
image_embeds_lst = items_by_modality["image_embeds"]
|
|
709
|
+
if len(image_embeds_lst) > 1:
|
|
710
|
+
raise ValueError("Only one message can have {'type': 'image_embeds'}")
|
|
711
|
+
mm_inputs["image"] = image_embeds_lst[0]
|
|
712
|
+
if "image" in items_by_modality:
|
|
713
|
+
mm_inputs["image"] = items_by_modality["image"] # A list of images
|
|
714
|
+
if "audio" in items_by_modality:
|
|
715
|
+
mm_inputs["audio"] = items_by_modality["audio"] # A list of audios
|
|
716
|
+
if "video" in items_by_modality:
|
|
717
|
+
mm_inputs["video"] = items_by_modality["video"] # A list of videos
|
|
718
|
+
return mm_inputs
|
|
719
|
+
|
|
720
|
+
def create_parser(self) -> "BaseMultiModalContentParser":
|
|
721
|
+
return MultiModalContentParser(self)
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
class AsyncMultiModalItemTracker(BaseMultiModalItemTracker[Awaitable[object]]):
|
|
725
|
+
async def all_mm_data(self) -> MultiModalDataDict | None:
|
|
726
|
+
if not self._items_by_modality:
|
|
727
|
+
return None
|
|
728
|
+
mm_inputs = {}
|
|
729
|
+
items_by_modality = {}
|
|
730
|
+
for modality, items in self._items_by_modality.items():
|
|
731
|
+
coros = []
|
|
732
|
+
for item in items:
|
|
733
|
+
if item is not None:
|
|
734
|
+
coros.append(item)
|
|
735
|
+
else:
|
|
736
|
+
coros.append(asyncio.sleep(0))
|
|
737
|
+
items_by_modality[modality] = await asyncio.gather(*coros)
|
|
738
|
+
|
|
739
|
+
if "image" in items_by_modality and "image_embeds" in items_by_modality:
|
|
740
|
+
raise ValueError("Mixing raw image and embedding inputs is not allowed")
|
|
741
|
+
|
|
742
|
+
if "image_embeds" in items_by_modality:
|
|
743
|
+
image_embeds_lst = items_by_modality["image_embeds"]
|
|
744
|
+
if len(image_embeds_lst) > 1:
|
|
745
|
+
raise ValueError("Only one message can have {'type': 'image_embeds'}")
|
|
746
|
+
mm_inputs["image"] = image_embeds_lst[0]
|
|
747
|
+
if "image" in items_by_modality:
|
|
748
|
+
mm_inputs["image"] = items_by_modality["image"] # A list of images
|
|
749
|
+
if "audio" in items_by_modality:
|
|
750
|
+
mm_inputs["audio"] = items_by_modality["audio"] # A list of audios
|
|
751
|
+
if "video" in items_by_modality:
|
|
752
|
+
mm_inputs["video"] = items_by_modality["video"] # A list of videos
|
|
753
|
+
return mm_inputs
|
|
754
|
+
|
|
755
|
+
def create_parser(self) -> "BaseMultiModalContentParser":
|
|
756
|
+
return AsyncMultiModalContentParser(self)
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
class BaseMultiModalContentParser(ABC):
|
|
760
|
+
def __init__(self) -> None:
|
|
761
|
+
super().__init__()
|
|
762
|
+
|
|
763
|
+
# stores model placeholders list with corresponding
|
|
764
|
+
# general MM placeholder:
|
|
765
|
+
# {
|
|
766
|
+
# "<##IMAGE##>": ["<image>", "<image>", "<image>"],
|
|
767
|
+
# "<##AUDIO##>": ["<audio>", "<audio>"]
|
|
768
|
+
# }
|
|
769
|
+
self._placeholder_storage: dict[str, list] = defaultdict(list)
|
|
770
|
+
|
|
771
|
+
def _add_placeholder(self, modality: ModalityStr, placeholder: str | None):
|
|
772
|
+
mod_placeholder = MODALITY_PLACEHOLDERS_MAP[modality]
|
|
773
|
+
if placeholder:
|
|
774
|
+
self._placeholder_storage[mod_placeholder].append(placeholder)
|
|
775
|
+
|
|
776
|
+
def mm_placeholder_storage(self) -> dict[str, list]:
|
|
777
|
+
return dict(self._placeholder_storage)
|
|
778
|
+
|
|
779
|
+
@abstractmethod
|
|
780
|
+
def parse_image(self, image_url: str | None, uuid: str | None = None) -> None:
|
|
781
|
+
raise NotImplementedError
|
|
782
|
+
|
|
783
|
+
@abstractmethod
|
|
784
|
+
def parse_image_embeds(
|
|
785
|
+
self,
|
|
786
|
+
image_embeds: str | dict[str, str] | None,
|
|
787
|
+
uuid: str | None = None,
|
|
788
|
+
) -> None:
|
|
789
|
+
raise NotImplementedError
|
|
790
|
+
|
|
791
|
+
@abstractmethod
|
|
792
|
+
def parse_image_pil(
|
|
793
|
+
self, image_pil: Image.Image | None, uuid: str | None = None
|
|
794
|
+
) -> None:
|
|
795
|
+
raise NotImplementedError
|
|
796
|
+
|
|
797
|
+
@abstractmethod
|
|
798
|
+
def parse_audio(self, audio_url: str | None, uuid: str | None = None) -> None:
|
|
799
|
+
raise NotImplementedError
|
|
800
|
+
|
|
801
|
+
@abstractmethod
|
|
802
|
+
def parse_input_audio(
|
|
803
|
+
self, input_audio: InputAudio | None, uuid: str | None = None
|
|
804
|
+
) -> None:
|
|
805
|
+
raise NotImplementedError
|
|
806
|
+
|
|
807
|
+
@abstractmethod
|
|
808
|
+
def parse_video(self, video_url: str | None, uuid: str | None = None) -> None:
|
|
809
|
+
raise NotImplementedError
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
class MultiModalContentParser(BaseMultiModalContentParser):
|
|
813
|
+
def __init__(self, tracker: MultiModalItemTracker) -> None:
|
|
814
|
+
super().__init__()
|
|
815
|
+
|
|
816
|
+
self._tracker = tracker
|
|
817
|
+
multimodal_config = self._tracker.model_config.multimodal_config
|
|
818
|
+
media_io_kwargs = getattr(multimodal_config, "media_io_kwargs", None)
|
|
819
|
+
|
|
820
|
+
self._connector: MediaConnector = MEDIA_CONNECTOR_REGISTRY.load(
|
|
821
|
+
envs.VLLM_MEDIA_CONNECTOR,
|
|
822
|
+
media_io_kwargs=media_io_kwargs,
|
|
823
|
+
allowed_local_media_path=tracker.allowed_local_media_path,
|
|
824
|
+
allowed_media_domains=tracker.allowed_media_domains,
|
|
825
|
+
)
|
|
826
|
+
|
|
827
|
+
@property
|
|
828
|
+
def model_config(self) -> ModelConfig:
|
|
829
|
+
return self._tracker.model_config
|
|
830
|
+
|
|
831
|
+
def parse_image(self, image_url: str | None, uuid: str | None = None) -> None:
|
|
832
|
+
image = self._connector.fetch_image(image_url) if image_url else None
|
|
833
|
+
|
|
834
|
+
placeholder = self._tracker.add("image", image, uuid)
|
|
835
|
+
self._add_placeholder("image", placeholder)
|
|
836
|
+
|
|
837
|
+
def parse_image_embeds(
|
|
838
|
+
self,
|
|
839
|
+
image_embeds: str | dict[str, str] | None,
|
|
840
|
+
uuid: str | None = None,
|
|
841
|
+
) -> None:
|
|
842
|
+
mm_config = self.model_config.get_multimodal_config()
|
|
843
|
+
if not mm_config.enable_mm_embeds:
|
|
844
|
+
raise ValueError(
|
|
845
|
+
"You must set `--enable-mm-embeds` to input `image_embeds`"
|
|
846
|
+
)
|
|
847
|
+
|
|
848
|
+
if isinstance(image_embeds, dict):
|
|
849
|
+
embeds = {
|
|
850
|
+
k: self._connector.fetch_image_embedding(v)
|
|
851
|
+
for k, v in image_embeds.items()
|
|
852
|
+
}
|
|
853
|
+
placeholder = self._tracker.add("image_embeds", embeds, uuid)
|
|
854
|
+
|
|
855
|
+
if isinstance(image_embeds, str):
|
|
856
|
+
embedding = self._connector.fetch_image_embedding(image_embeds)
|
|
857
|
+
placeholder = self._tracker.add("image_embeds", embedding, uuid)
|
|
858
|
+
|
|
859
|
+
if image_embeds is None:
|
|
860
|
+
placeholder = self._tracker.add("image_embeds", None, uuid)
|
|
861
|
+
|
|
862
|
+
self._add_placeholder("image", placeholder)
|
|
863
|
+
|
|
864
|
+
def parse_image_pil(
|
|
865
|
+
self, image_pil: Image.Image | None, uuid: str | None = None
|
|
866
|
+
) -> None:
|
|
867
|
+
placeholder = self._tracker.add("image", image_pil, uuid)
|
|
868
|
+
self._add_placeholder("image", placeholder)
|
|
869
|
+
|
|
870
|
+
def parse_audio(self, audio_url: str | None, uuid: str | None = None) -> None:
|
|
871
|
+
audio = self._connector.fetch_audio(audio_url) if audio_url else None
|
|
872
|
+
|
|
873
|
+
placeholder = self._tracker.add("audio", audio, uuid)
|
|
874
|
+
self._add_placeholder("audio", placeholder)
|
|
875
|
+
|
|
876
|
+
def parse_input_audio(
|
|
877
|
+
self, input_audio: InputAudio | None, uuid: str | None = None
|
|
878
|
+
) -> None:
|
|
879
|
+
if input_audio:
|
|
880
|
+
audio_data = input_audio.get("data", "")
|
|
881
|
+
audio_format = input_audio.get("format", "")
|
|
882
|
+
if audio_data:
|
|
883
|
+
audio_url = f"data:audio/{audio_format};base64,{audio_data}"
|
|
884
|
+
else:
|
|
885
|
+
# If a UUID is provided, audio data may be empty.
|
|
886
|
+
audio_url = None
|
|
887
|
+
else:
|
|
888
|
+
audio_url = None
|
|
889
|
+
|
|
890
|
+
return self.parse_audio(audio_url, uuid)
|
|
891
|
+
|
|
892
|
+
def parse_video(self, video_url: str | None, uuid: str | None = None) -> None:
|
|
893
|
+
video = self._connector.fetch_video(video_url=video_url) if video_url else None
|
|
894
|
+
|
|
895
|
+
placeholder = self._tracker.add("video", video, uuid)
|
|
896
|
+
self._add_placeholder("video", placeholder)
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
class AsyncMultiModalContentParser(BaseMultiModalContentParser):
|
|
900
|
+
def __init__(self, tracker: AsyncMultiModalItemTracker) -> None:
|
|
901
|
+
super().__init__()
|
|
902
|
+
|
|
903
|
+
self._tracker = tracker
|
|
904
|
+
multimodal_config = self._tracker.model_config.multimodal_config
|
|
905
|
+
media_io_kwargs = getattr(multimodal_config, "media_io_kwargs", None)
|
|
906
|
+
self._connector: MediaConnector = MEDIA_CONNECTOR_REGISTRY.load(
|
|
907
|
+
envs.VLLM_MEDIA_CONNECTOR,
|
|
908
|
+
media_io_kwargs=media_io_kwargs,
|
|
909
|
+
allowed_local_media_path=tracker.allowed_local_media_path,
|
|
910
|
+
allowed_media_domains=tracker.allowed_media_domains,
|
|
911
|
+
)
|
|
912
|
+
|
|
913
|
+
@property
|
|
914
|
+
def model_config(self) -> ModelConfig:
|
|
915
|
+
return self._tracker.model_config
|
|
916
|
+
|
|
917
|
+
def parse_image(self, image_url: str | None, uuid: str | None = None) -> None:
|
|
918
|
+
image_coro = self._connector.fetch_image_async(image_url) if image_url else None
|
|
919
|
+
|
|
920
|
+
placeholder = self._tracker.add("image", image_coro, uuid)
|
|
921
|
+
self._add_placeholder("image", placeholder)
|
|
922
|
+
|
|
923
|
+
def parse_image_embeds(
|
|
924
|
+
self,
|
|
925
|
+
image_embeds: str | dict[str, str] | None,
|
|
926
|
+
uuid: str | None = None,
|
|
927
|
+
) -> None:
|
|
928
|
+
mm_config = self.model_config.get_multimodal_config()
|
|
929
|
+
if not mm_config.enable_mm_embeds:
|
|
930
|
+
raise ValueError(
|
|
931
|
+
"You must set `--enable-mm-embeds` to input `image_embeds`"
|
|
932
|
+
)
|
|
933
|
+
|
|
934
|
+
future: asyncio.Future[str | dict[str, str] | None] = asyncio.Future()
|
|
935
|
+
|
|
936
|
+
if isinstance(image_embeds, dict):
|
|
937
|
+
embeds = {
|
|
938
|
+
k: self._connector.fetch_image_embedding(v)
|
|
939
|
+
for k, v in image_embeds.items()
|
|
940
|
+
}
|
|
941
|
+
future.set_result(embeds)
|
|
942
|
+
|
|
943
|
+
if isinstance(image_embeds, str):
|
|
944
|
+
embedding = self._connector.fetch_image_embedding(image_embeds)
|
|
945
|
+
future.set_result(embedding)
|
|
946
|
+
|
|
947
|
+
if image_embeds is None:
|
|
948
|
+
future.set_result(None)
|
|
949
|
+
|
|
950
|
+
placeholder = self._tracker.add("image_embeds", future, uuid)
|
|
951
|
+
self._add_placeholder("image", placeholder)
|
|
952
|
+
|
|
953
|
+
def parse_image_pil(
|
|
954
|
+
self, image_pil: Image.Image | None, uuid: str | None = None
|
|
955
|
+
) -> None:
|
|
956
|
+
future: asyncio.Future[Image.Image | None] = asyncio.Future()
|
|
957
|
+
if image_pil:
|
|
958
|
+
future.set_result(image_pil)
|
|
959
|
+
else:
|
|
960
|
+
future.set_result(None)
|
|
961
|
+
|
|
962
|
+
placeholder = self._tracker.add("image", future, uuid)
|
|
963
|
+
self._add_placeholder("image", placeholder)
|
|
964
|
+
|
|
965
|
+
def parse_audio(self, audio_url: str | None, uuid: str | None = None) -> None:
|
|
966
|
+
audio_coro = self._connector.fetch_audio_async(audio_url) if audio_url else None
|
|
967
|
+
|
|
968
|
+
placeholder = self._tracker.add("audio", audio_coro, uuid)
|
|
969
|
+
self._add_placeholder("audio", placeholder)
|
|
970
|
+
|
|
971
|
+
def parse_input_audio(
|
|
972
|
+
self, input_audio: InputAudio | None, uuid: str | None = None
|
|
973
|
+
) -> None:
|
|
974
|
+
if input_audio:
|
|
975
|
+
audio_data = input_audio.get("data", "")
|
|
976
|
+
audio_format = input_audio.get("format", "")
|
|
977
|
+
if audio_data:
|
|
978
|
+
audio_url = f"data:audio/{audio_format};base64,{audio_data}"
|
|
979
|
+
else:
|
|
980
|
+
# If a UUID is provided, audio data may be empty.
|
|
981
|
+
audio_url = None
|
|
982
|
+
else:
|
|
983
|
+
audio_url = None
|
|
984
|
+
|
|
985
|
+
return self.parse_audio(audio_url, uuid)
|
|
986
|
+
|
|
987
|
+
def parse_video(self, video_url: str | None, uuid: str | None = None) -> None:
|
|
988
|
+
video = (
|
|
989
|
+
self._connector.fetch_video_async(video_url=video_url)
|
|
990
|
+
if video_url
|
|
991
|
+
else None
|
|
992
|
+
)
|
|
993
|
+
|
|
994
|
+
placeholder = self._tracker.add("video", video, uuid)
|
|
995
|
+
self._add_placeholder("video", placeholder)
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
def validate_chat_template(chat_template: Path | str | None):
|
|
999
|
+
"""Raises if the provided chat template appears invalid."""
|
|
1000
|
+
if chat_template is None:
|
|
1001
|
+
return
|
|
1002
|
+
|
|
1003
|
+
elif isinstance(chat_template, Path) and not chat_template.exists():
|
|
1004
|
+
raise FileNotFoundError("the supplied chat template path doesn't exist")
|
|
1005
|
+
|
|
1006
|
+
elif isinstance(chat_template, str):
|
|
1007
|
+
JINJA_CHARS = "{}\n"
|
|
1008
|
+
if (
|
|
1009
|
+
not any(c in chat_template for c in JINJA_CHARS)
|
|
1010
|
+
and not Path(chat_template).exists()
|
|
1011
|
+
):
|
|
1012
|
+
raise ValueError(
|
|
1013
|
+
f"The supplied chat template string ({chat_template}) "
|
|
1014
|
+
f"appears path-like, but doesn't exist!"
|
|
1015
|
+
)
|
|
1016
|
+
|
|
1017
|
+
else:
|
|
1018
|
+
raise TypeError(f"{type(chat_template)} is not a valid chat template type")
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
def _load_chat_template(
|
|
1022
|
+
chat_template: Path | str | None,
|
|
1023
|
+
*,
|
|
1024
|
+
is_literal: bool = False,
|
|
1025
|
+
) -> str | None:
|
|
1026
|
+
if chat_template is None:
|
|
1027
|
+
return None
|
|
1028
|
+
|
|
1029
|
+
if is_literal:
|
|
1030
|
+
if isinstance(chat_template, Path):
|
|
1031
|
+
raise TypeError(
|
|
1032
|
+
"chat_template is expected to be read directly from its value"
|
|
1033
|
+
)
|
|
1034
|
+
|
|
1035
|
+
return chat_template
|
|
1036
|
+
|
|
1037
|
+
try:
|
|
1038
|
+
with open(chat_template) as f:
|
|
1039
|
+
return f.read()
|
|
1040
|
+
except OSError as e:
|
|
1041
|
+
if isinstance(chat_template, Path):
|
|
1042
|
+
raise
|
|
1043
|
+
|
|
1044
|
+
JINJA_CHARS = "{}\n"
|
|
1045
|
+
if not any(c in chat_template for c in JINJA_CHARS):
|
|
1046
|
+
msg = (
|
|
1047
|
+
f"The supplied chat template ({chat_template}) "
|
|
1048
|
+
f"looks like a file path, but it failed to be "
|
|
1049
|
+
f"opened. Reason: {e}"
|
|
1050
|
+
)
|
|
1051
|
+
raise ValueError(msg) from e
|
|
1052
|
+
|
|
1053
|
+
# If opening a file fails, set chat template to be args to
|
|
1054
|
+
# ensure we decode so our escape are interpreted correctly
|
|
1055
|
+
return _load_chat_template(chat_template, is_literal=True)
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
_cached_load_chat_template = lru_cache(_load_chat_template)
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
def load_chat_template(
|
|
1062
|
+
chat_template: Path | str | None,
|
|
1063
|
+
*,
|
|
1064
|
+
is_literal: bool = False,
|
|
1065
|
+
) -> str | None:
|
|
1066
|
+
return _cached_load_chat_template(chat_template, is_literal=is_literal)
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
def _get_interleaved_text_prompt(
|
|
1070
|
+
placeholder_storage: dict[str, list], texts: list[str]
|
|
1071
|
+
) -> str:
|
|
1072
|
+
for idx, elem in enumerate(texts):
|
|
1073
|
+
if elem in placeholder_storage:
|
|
1074
|
+
texts[idx] = placeholder_storage[elem].pop(0)
|
|
1075
|
+
|
|
1076
|
+
return "\n".join(texts)
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
# TODO: Let user specify how to insert multimodal tokens into prompt
|
|
1080
|
+
# (similar to chat template)
|
|
1081
|
+
def _get_full_multimodal_text_prompt(
|
|
1082
|
+
placeholder_storage: dict[str, list],
|
|
1083
|
+
texts: list[str],
|
|
1084
|
+
interleave_strings: bool,
|
|
1085
|
+
) -> str:
|
|
1086
|
+
"""Combine multimodal prompts for a multimodal language model."""
|
|
1087
|
+
|
|
1088
|
+
# flatten storage to make it looks like
|
|
1089
|
+
# {
|
|
1090
|
+
# "<|image|>": 2,
|
|
1091
|
+
# "<|audio|>": 1
|
|
1092
|
+
# }
|
|
1093
|
+
placeholder_counts = Counter(
|
|
1094
|
+
[v for elem in placeholder_storage.values() for v in elem]
|
|
1095
|
+
)
|
|
1096
|
+
|
|
1097
|
+
if interleave_strings:
|
|
1098
|
+
text_prompt = _get_interleaved_text_prompt(placeholder_storage, texts)
|
|
1099
|
+
else:
|
|
1100
|
+
text_prompt = "\n".join(texts)
|
|
1101
|
+
|
|
1102
|
+
# Pass interleaved text further in case the user used image placeholders
|
|
1103
|
+
# himself, but forgot to disable the 'interleave_strings' flag
|
|
1104
|
+
|
|
1105
|
+
# Look through the text prompt to check for missing placeholders
|
|
1106
|
+
missing_placeholders: list[str] = []
|
|
1107
|
+
for placeholder in placeholder_counts:
|
|
1108
|
+
# For any existing placeholder in the text prompt, we leave it as is
|
|
1109
|
+
placeholder_counts[placeholder] -= text_prompt.count(placeholder)
|
|
1110
|
+
|
|
1111
|
+
if placeholder_counts[placeholder] < 0:
|
|
1112
|
+
logger.error(
|
|
1113
|
+
"Placeholder count is negative! "
|
|
1114
|
+
"Ensure that the 'interleave_strings' flag is disabled "
|
|
1115
|
+
"(current value: %s) "
|
|
1116
|
+
"when manually placing image placeholders.",
|
|
1117
|
+
interleave_strings,
|
|
1118
|
+
)
|
|
1119
|
+
logger.debug("Input prompt: %s", text_prompt)
|
|
1120
|
+
raise ValueError(
|
|
1121
|
+
f"Found more '{placeholder}' placeholders in input prompt than "
|
|
1122
|
+
"actual multimodal data items."
|
|
1123
|
+
)
|
|
1124
|
+
|
|
1125
|
+
missing_placeholders.extend([placeholder] * placeholder_counts[placeholder])
|
|
1126
|
+
|
|
1127
|
+
# NOTE: Default behaviour: we always add missing placeholders
|
|
1128
|
+
# at the front of the prompt, if interleave_strings=False
|
|
1129
|
+
return "\n".join(missing_placeholders + [text_prompt])
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
# No need to validate using Pydantic again
|
|
1133
|
+
_TextParser = partial(cast, ChatCompletionContentPartTextParam)
|
|
1134
|
+
_ImageEmbedsParser = partial(cast, ChatCompletionContentPartImageEmbedsParam)
|
|
1135
|
+
_InputAudioParser = partial(cast, ChatCompletionContentPartInputAudioParam)
|
|
1136
|
+
_RefusalParser = partial(cast, ChatCompletionContentPartRefusalParam)
|
|
1137
|
+
_PILImageParser = partial(cast, CustomChatCompletionContentPILImageParam)
|
|
1138
|
+
_ThinkParser = partial(cast, CustomThinkCompletionContentParam)
|
|
1139
|
+
# Need to validate url objects
|
|
1140
|
+
_ImageParser = TypeAdapter(ChatCompletionContentPartImageParam).validate_python
|
|
1141
|
+
_AudioParser = TypeAdapter(ChatCompletionContentPartAudioParam).validate_python
|
|
1142
|
+
_VideoParser = TypeAdapter(ChatCompletionContentPartVideoParam).validate_python
|
|
1143
|
+
|
|
1144
|
+
_ResponsesInputImageParser = TypeAdapter(ResponseInputImageParam).validate_python
|
|
1145
|
+
_ContentPart: TypeAlias = str | dict[str, str] | InputAudio | PILImage
|
|
1146
|
+
|
|
1147
|
+
# Define a mapping from part types to their corresponding parsing functions.
|
|
1148
|
+
MM_PARSER_MAP: dict[
|
|
1149
|
+
str,
|
|
1150
|
+
Callable[[ChatCompletionContentPartParam], _ContentPart],
|
|
1151
|
+
] = {
|
|
1152
|
+
"text": lambda part: _TextParser(part).get("text", None),
|
|
1153
|
+
"thinking": lambda part: _ThinkParser(part).get("thinking", None),
|
|
1154
|
+
"input_text": lambda part: _TextParser(part).get("text", None),
|
|
1155
|
+
"input_image": lambda part: _ResponsesInputImageParser(part).get("image_url", None),
|
|
1156
|
+
"image_url": lambda part: _ImageParser(part).get("image_url", {}).get("url", None),
|
|
1157
|
+
"image_embeds": lambda part: _ImageEmbedsParser(part).get("image_embeds", None),
|
|
1158
|
+
"image_pil": lambda part: _PILImageParser(part).get("image_pil", None),
|
|
1159
|
+
"audio_url": lambda part: _AudioParser(part).get("audio_url", {}).get("url", None),
|
|
1160
|
+
"input_audio": lambda part: _InputAudioParser(part).get("input_audio", None),
|
|
1161
|
+
"refusal": lambda part: _RefusalParser(part).get("refusal", None),
|
|
1162
|
+
"video_url": lambda part: _VideoParser(part).get("video_url", {}).get("url", None),
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
def _parse_chat_message_content_mm_part(
|
|
1167
|
+
part: ChatCompletionContentPartParam,
|
|
1168
|
+
) -> tuple[str, _ContentPart]:
|
|
1169
|
+
"""
|
|
1170
|
+
Parses a given multi-modal content part based on its type.
|
|
1171
|
+
|
|
1172
|
+
Args:
|
|
1173
|
+
part: A dict containing the content part, with a potential 'type' field.
|
|
1174
|
+
|
|
1175
|
+
Returns:
|
|
1176
|
+
A tuple (part_type, content) where:
|
|
1177
|
+
- part_type: Type of the part (e.g., 'text', 'image_url').
|
|
1178
|
+
- content: Parsed content (e.g., text, image URL).
|
|
1179
|
+
|
|
1180
|
+
Raises:
|
|
1181
|
+
ValueError: If the 'type' field is missing and no direct URL is found.
|
|
1182
|
+
"""
|
|
1183
|
+
assert isinstance(
|
|
1184
|
+
part, dict
|
|
1185
|
+
) # This is needed to avoid mypy errors: part.get() from str
|
|
1186
|
+
part_type = part.get("type", None)
|
|
1187
|
+
uuid = part.get("uuid", None)
|
|
1188
|
+
|
|
1189
|
+
if isinstance(part_type, str) and part_type in MM_PARSER_MAP and uuid is None: # noqa: E501
|
|
1190
|
+
content = MM_PARSER_MAP[part_type](part)
|
|
1191
|
+
|
|
1192
|
+
# Special case for 'image_url.detail'
|
|
1193
|
+
# We only support 'auto', which is the default
|
|
1194
|
+
if part_type == "image_url" and part.get("detail", "auto") != "auto":
|
|
1195
|
+
logger.warning(
|
|
1196
|
+
"'image_url.detail' is currently not supported and will be ignored."
|
|
1197
|
+
)
|
|
1198
|
+
|
|
1199
|
+
return part_type, content
|
|
1200
|
+
|
|
1201
|
+
# Handle missing 'type' but provided direct URL fields.
|
|
1202
|
+
# 'type' is required field by pydantic
|
|
1203
|
+
if part_type is None or uuid is not None:
|
|
1204
|
+
if "image_url" in part:
|
|
1205
|
+
image_params = cast(CustomChatCompletionContentSimpleImageParam, part)
|
|
1206
|
+
image_url = image_params.get("image_url", None)
|
|
1207
|
+
if isinstance(image_url, dict):
|
|
1208
|
+
# Can potentially happen if user provides a uuid
|
|
1209
|
+
# with url as a dict of {"url": url}
|
|
1210
|
+
image_url = image_url.get("url", None)
|
|
1211
|
+
return "image_url", image_url
|
|
1212
|
+
if "image_pil" in part:
|
|
1213
|
+
# "image_pil" could be None if UUID is provided.
|
|
1214
|
+
image_params = cast( # type: ignore
|
|
1215
|
+
CustomChatCompletionContentPILImageParam, part
|
|
1216
|
+
)
|
|
1217
|
+
image_pil = image_params.get("image_pil", None)
|
|
1218
|
+
return "image_pil", image_pil
|
|
1219
|
+
if "image_embeds" in part:
|
|
1220
|
+
# "image_embeds" could be None if UUID is provided.
|
|
1221
|
+
image_params = cast( # type: ignore
|
|
1222
|
+
ChatCompletionContentPartImageEmbedsParam, part
|
|
1223
|
+
)
|
|
1224
|
+
image_embeds = image_params.get("image_embeds", None)
|
|
1225
|
+
return "image_embeds", image_embeds
|
|
1226
|
+
if "audio_url" in part:
|
|
1227
|
+
audio_params = cast(CustomChatCompletionContentSimpleAudioParam, part)
|
|
1228
|
+
audio_url = audio_params.get("audio_url", None)
|
|
1229
|
+
if isinstance(audio_url, dict):
|
|
1230
|
+
# Can potentially happen if user provides a uuid
|
|
1231
|
+
# with url as a dict of {"url": url}
|
|
1232
|
+
audio_url = audio_url.get("url", None)
|
|
1233
|
+
return "audio_url", audio_url
|
|
1234
|
+
if part.get("input_audio") is not None:
|
|
1235
|
+
input_audio_params = cast(dict[str, str], part)
|
|
1236
|
+
return "input_audio", input_audio_params
|
|
1237
|
+
if "video_url" in part:
|
|
1238
|
+
video_params = cast(CustomChatCompletionContentSimpleVideoParam, part)
|
|
1239
|
+
video_url = video_params.get("video_url", None)
|
|
1240
|
+
if isinstance(video_url, dict):
|
|
1241
|
+
# Can potentially happen if user provides a uuid
|
|
1242
|
+
# with url as a dict of {"url": url}
|
|
1243
|
+
video_url = video_url.get("url", None)
|
|
1244
|
+
return "video_url", video_url
|
|
1245
|
+
# Raise an error if no 'type' or direct URL is found.
|
|
1246
|
+
raise ValueError("Missing 'type' field in multimodal part.")
|
|
1247
|
+
|
|
1248
|
+
if not isinstance(part_type, str):
|
|
1249
|
+
raise ValueError("Invalid 'type' field in multimodal part.")
|
|
1250
|
+
return part_type, "unknown part_type content"
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
PART_TYPES_TO_SKIP_NONE_CONTENT = (
|
|
1254
|
+
"text",
|
|
1255
|
+
"refusal",
|
|
1256
|
+
)
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
def _parse_chat_message_content_parts(
|
|
1260
|
+
role: str,
|
|
1261
|
+
parts: Iterable[ChatCompletionContentPartParam],
|
|
1262
|
+
mm_tracker: BaseMultiModalItemTracker,
|
|
1263
|
+
*,
|
|
1264
|
+
wrap_dicts: bool,
|
|
1265
|
+
interleave_strings: bool,
|
|
1266
|
+
) -> list[ConversationMessage]:
|
|
1267
|
+
content = list[_ContentPart]()
|
|
1268
|
+
|
|
1269
|
+
mm_parser = mm_tracker.create_parser()
|
|
1270
|
+
|
|
1271
|
+
for part in parts:
|
|
1272
|
+
parse_res = _parse_chat_message_content_part(
|
|
1273
|
+
part,
|
|
1274
|
+
mm_parser,
|
|
1275
|
+
wrap_dicts=wrap_dicts,
|
|
1276
|
+
interleave_strings=interleave_strings,
|
|
1277
|
+
)
|
|
1278
|
+
if parse_res:
|
|
1279
|
+
content.append(parse_res)
|
|
1280
|
+
|
|
1281
|
+
if wrap_dicts:
|
|
1282
|
+
# Parsing wraps images and texts as interleaved dictionaries
|
|
1283
|
+
return [ConversationMessage(role=role, content=content)] # type: ignore
|
|
1284
|
+
texts = cast(list[str], content)
|
|
1285
|
+
mm_placeholder_storage = mm_parser.mm_placeholder_storage()
|
|
1286
|
+
if mm_placeholder_storage:
|
|
1287
|
+
text_prompt = _get_full_multimodal_text_prompt(
|
|
1288
|
+
mm_placeholder_storage, texts, interleave_strings
|
|
1289
|
+
)
|
|
1290
|
+
else:
|
|
1291
|
+
text_prompt = "\n".join(texts)
|
|
1292
|
+
|
|
1293
|
+
return [ConversationMessage(role=role, content=text_prompt)]
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
def _parse_chat_message_content_part(
|
|
1297
|
+
part: ChatCompletionContentPartParam,
|
|
1298
|
+
mm_parser: BaseMultiModalContentParser,
|
|
1299
|
+
*,
|
|
1300
|
+
wrap_dicts: bool,
|
|
1301
|
+
interleave_strings: bool,
|
|
1302
|
+
) -> _ContentPart | None:
|
|
1303
|
+
"""Parses a single part of a conversation. If wrap_dicts is True,
|
|
1304
|
+
structured dictionary pieces for texts and images will be
|
|
1305
|
+
wrapped in dictionaries, i.e., {"type": "text", "text", ...} and
|
|
1306
|
+
{"type": "image"}, respectively. Otherwise multimodal data will be
|
|
1307
|
+
handled by mm_parser, and texts will be returned as strings to be joined
|
|
1308
|
+
with multimodal placeholders.
|
|
1309
|
+
"""
|
|
1310
|
+
if isinstance(part, str): # Handle plain text parts
|
|
1311
|
+
return part
|
|
1312
|
+
# Handle structured dictionary parts
|
|
1313
|
+
part_type, content = _parse_chat_message_content_mm_part(part)
|
|
1314
|
+
# if part_type is text/refusal/image_url/audio_url/video_url/input_audio but
|
|
1315
|
+
# content is None, log a warning and skip
|
|
1316
|
+
if part_type in PART_TYPES_TO_SKIP_NONE_CONTENT and content is None:
|
|
1317
|
+
logger.warning(
|
|
1318
|
+
"Skipping multimodal part '%s' (type: '%s') "
|
|
1319
|
+
"with empty / unparsable content.",
|
|
1320
|
+
part,
|
|
1321
|
+
part_type,
|
|
1322
|
+
)
|
|
1323
|
+
return None
|
|
1324
|
+
|
|
1325
|
+
if part_type in ("text", "input_text", "refusal", "thinking"):
|
|
1326
|
+
str_content = cast(str, content)
|
|
1327
|
+
if wrap_dicts:
|
|
1328
|
+
return {"type": "text", "text": str_content}
|
|
1329
|
+
else:
|
|
1330
|
+
return str_content
|
|
1331
|
+
|
|
1332
|
+
# For media items, if a user has provided one, use it. Otherwise, insert
|
|
1333
|
+
# a placeholder empty uuid.
|
|
1334
|
+
uuid = part.get("uuid", None)
|
|
1335
|
+
if uuid is not None:
|
|
1336
|
+
uuid = str(uuid)
|
|
1337
|
+
|
|
1338
|
+
modality = None
|
|
1339
|
+
if part_type == "image_pil":
|
|
1340
|
+
image_content = cast(Image.Image, content) if content is not None else None
|
|
1341
|
+
mm_parser.parse_image_pil(image_content, uuid)
|
|
1342
|
+
modality = "image"
|
|
1343
|
+
elif part_type in ("image_url", "input_image"):
|
|
1344
|
+
str_content = cast(str, content)
|
|
1345
|
+
mm_parser.parse_image(str_content, uuid)
|
|
1346
|
+
modality = "image"
|
|
1347
|
+
elif part_type == "image_embeds":
|
|
1348
|
+
content = cast(str | dict[str, str], content) if content is not None else None
|
|
1349
|
+
mm_parser.parse_image_embeds(content, uuid)
|
|
1350
|
+
modality = "image"
|
|
1351
|
+
elif part_type == "audio_url":
|
|
1352
|
+
str_content = cast(str, content)
|
|
1353
|
+
mm_parser.parse_audio(str_content, uuid)
|
|
1354
|
+
modality = "audio"
|
|
1355
|
+
elif part_type == "input_audio":
|
|
1356
|
+
dict_content = cast(InputAudio, content)
|
|
1357
|
+
mm_parser.parse_input_audio(dict_content, uuid)
|
|
1358
|
+
modality = "audio"
|
|
1359
|
+
elif part_type == "video_url":
|
|
1360
|
+
str_content = cast(str, content)
|
|
1361
|
+
mm_parser.parse_video(str_content, uuid)
|
|
1362
|
+
modality = "video"
|
|
1363
|
+
else:
|
|
1364
|
+
raise NotImplementedError(f"Unknown part type: {part_type}")
|
|
1365
|
+
|
|
1366
|
+
return (
|
|
1367
|
+
{"type": modality}
|
|
1368
|
+
if wrap_dicts
|
|
1369
|
+
else (MODALITY_PLACEHOLDERS_MAP[modality] if interleave_strings else None)
|
|
1370
|
+
)
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
# No need to validate using Pydantic again
|
|
1374
|
+
_AssistantParser = partial(cast, ChatCompletionAssistantMessageParam)
|
|
1375
|
+
_ToolParser = partial(cast, ChatCompletionToolMessageParam)
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
def _parse_chat_message_content(
|
|
1379
|
+
message: ChatCompletionMessageParam,
|
|
1380
|
+
mm_tracker: BaseMultiModalItemTracker,
|
|
1381
|
+
content_format: _ChatTemplateContentFormat,
|
|
1382
|
+
interleave_strings: bool,
|
|
1383
|
+
) -> list[ConversationMessage]:
|
|
1384
|
+
role = message["role"]
|
|
1385
|
+
content = message.get("content")
|
|
1386
|
+
reasoning = message.get("reasoning") or message.get("reasoning_content")
|
|
1387
|
+
if content is None:
|
|
1388
|
+
content = []
|
|
1389
|
+
elif isinstance(content, str):
|
|
1390
|
+
content = [ChatCompletionContentPartTextParam(type="text", text=content)]
|
|
1391
|
+
result = _parse_chat_message_content_parts(
|
|
1392
|
+
role,
|
|
1393
|
+
content, # type: ignore
|
|
1394
|
+
mm_tracker,
|
|
1395
|
+
wrap_dicts=(content_format == "openai"),
|
|
1396
|
+
interleave_strings=interleave_strings,
|
|
1397
|
+
)
|
|
1398
|
+
|
|
1399
|
+
for result_msg in result:
|
|
1400
|
+
if role == "assistant":
|
|
1401
|
+
parsed_msg = _AssistantParser(message)
|
|
1402
|
+
|
|
1403
|
+
# The 'tool_calls' is not None check ensures compatibility.
|
|
1404
|
+
# It's needed only if downstream code doesn't strictly
|
|
1405
|
+
# follow the OpenAI spec.
|
|
1406
|
+
if "tool_calls" in parsed_msg and parsed_msg["tool_calls"] is not None:
|
|
1407
|
+
result_msg["tool_calls"] = list(parsed_msg["tool_calls"])
|
|
1408
|
+
# Include reasoning if present for interleaved thinking.
|
|
1409
|
+
if reasoning is not None:
|
|
1410
|
+
result_msg["reasoning"] = cast(str, reasoning)
|
|
1411
|
+
result_msg["reasoning_content"] = cast(
|
|
1412
|
+
str, reasoning
|
|
1413
|
+
) # keep compatibility
|
|
1414
|
+
elif role == "tool":
|
|
1415
|
+
parsed_msg = _ToolParser(message)
|
|
1416
|
+
if "tool_call_id" in parsed_msg:
|
|
1417
|
+
result_msg["tool_call_id"] = parsed_msg["tool_call_id"]
|
|
1418
|
+
|
|
1419
|
+
if "name" in message and isinstance(message["name"], str):
|
|
1420
|
+
result_msg["name"] = message["name"]
|
|
1421
|
+
|
|
1422
|
+
return result
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
def _postprocess_messages(messages: list[ConversationMessage]) -> None:
|
|
1426
|
+
# per the Transformers docs & maintainers, tool call arguments in
|
|
1427
|
+
# assistant-role messages with tool_calls need to be dicts not JSON str -
|
|
1428
|
+
# this is how tool-use chat templates will expect them moving forwards
|
|
1429
|
+
# so, for messages that have tool_calls, parse the string (which we get
|
|
1430
|
+
# from openAI format) to dict
|
|
1431
|
+
for message in messages:
|
|
1432
|
+
if (
|
|
1433
|
+
message["role"] == "assistant"
|
|
1434
|
+
and "tool_calls" in message
|
|
1435
|
+
and isinstance(message["tool_calls"], list)
|
|
1436
|
+
):
|
|
1437
|
+
for item in message["tool_calls"]:
|
|
1438
|
+
# if arguments is None or empty string, set to {}
|
|
1439
|
+
if content := item["function"].get("arguments"):
|
|
1440
|
+
item["function"]["arguments"] = json.loads(content)
|
|
1441
|
+
else:
|
|
1442
|
+
item["function"]["arguments"] = {}
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
def parse_chat_messages(
|
|
1446
|
+
messages: list[ChatCompletionMessageParam],
|
|
1447
|
+
model_config: ModelConfig,
|
|
1448
|
+
tokenizer: AnyTokenizer,
|
|
1449
|
+
content_format: _ChatTemplateContentFormat,
|
|
1450
|
+
) -> tuple[
|
|
1451
|
+
list[ConversationMessage],
|
|
1452
|
+
MultiModalDataDict | None,
|
|
1453
|
+
MultiModalUUIDDict | None,
|
|
1454
|
+
]:
|
|
1455
|
+
conversation: list[ConversationMessage] = []
|
|
1456
|
+
mm_tracker = MultiModalItemTracker(model_config, tokenizer)
|
|
1457
|
+
|
|
1458
|
+
for msg in messages:
|
|
1459
|
+
sub_messages = _parse_chat_message_content(
|
|
1460
|
+
msg,
|
|
1461
|
+
mm_tracker,
|
|
1462
|
+
content_format,
|
|
1463
|
+
interleave_strings=(
|
|
1464
|
+
content_format == "string"
|
|
1465
|
+
and model_config.multimodal_config is not None
|
|
1466
|
+
and model_config.multimodal_config.interleave_mm_strings
|
|
1467
|
+
),
|
|
1468
|
+
)
|
|
1469
|
+
|
|
1470
|
+
conversation.extend(sub_messages)
|
|
1471
|
+
|
|
1472
|
+
_postprocess_messages(conversation)
|
|
1473
|
+
|
|
1474
|
+
return conversation, mm_tracker.all_mm_data(), mm_tracker.all_mm_uuids()
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
def parse_chat_messages_futures(
|
|
1478
|
+
messages: list[ChatCompletionMessageParam],
|
|
1479
|
+
model_config: ModelConfig,
|
|
1480
|
+
tokenizer: AnyTokenizer,
|
|
1481
|
+
content_format: _ChatTemplateContentFormat,
|
|
1482
|
+
) -> tuple[
|
|
1483
|
+
list[ConversationMessage],
|
|
1484
|
+
Awaitable[MultiModalDataDict | None],
|
|
1485
|
+
MultiModalUUIDDict | None,
|
|
1486
|
+
]:
|
|
1487
|
+
conversation: list[ConversationMessage] = []
|
|
1488
|
+
mm_tracker = AsyncMultiModalItemTracker(model_config, tokenizer)
|
|
1489
|
+
|
|
1490
|
+
for msg in messages:
|
|
1491
|
+
sub_messages = _parse_chat_message_content(
|
|
1492
|
+
msg,
|
|
1493
|
+
mm_tracker,
|
|
1494
|
+
content_format,
|
|
1495
|
+
interleave_strings=(
|
|
1496
|
+
content_format == "string"
|
|
1497
|
+
and model_config.multimodal_config is not None
|
|
1498
|
+
and model_config.multimodal_config.interleave_mm_strings
|
|
1499
|
+
),
|
|
1500
|
+
)
|
|
1501
|
+
|
|
1502
|
+
conversation.extend(sub_messages)
|
|
1503
|
+
|
|
1504
|
+
_postprocess_messages(conversation)
|
|
1505
|
+
|
|
1506
|
+
return conversation, mm_tracker.all_mm_data(), mm_tracker.all_mm_uuids()
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
# adapted from https://github.com/huggingface/transformers/blob/v4.56.2/src/transformers/utils/chat_template_utils.py#L398-L412
|
|
1510
|
+
# only preserve the parse function used to resolve chat template kwargs
|
|
1511
|
+
class AssistantTracker(jinja2.ext.Extension):
|
|
1512
|
+
tags = {"generation"}
|
|
1513
|
+
|
|
1514
|
+
def parse(self, parser: jinja2.parser.Parser) -> jinja2.nodes.CallBlock:
|
|
1515
|
+
lineno = next(parser.stream).lineno
|
|
1516
|
+
body = parser.parse_statements(["name:endgeneration"], drop_needle=True)
|
|
1517
|
+
call = self.call_method("_generation_support")
|
|
1518
|
+
call_block = jinja2.nodes.CallBlock(call, [], [], body)
|
|
1519
|
+
return call_block.set_lineno(lineno)
|
|
1520
|
+
|
|
1521
|
+
|
|
1522
|
+
def _resolve_chat_template_kwargs(
|
|
1523
|
+
chat_template: str,
|
|
1524
|
+
):
|
|
1525
|
+
env = jinja2.sandbox.ImmutableSandboxedEnvironment(
|
|
1526
|
+
trim_blocks=True,
|
|
1527
|
+
lstrip_blocks=True,
|
|
1528
|
+
extensions=[AssistantTracker, jinja2.ext.loopcontrols],
|
|
1529
|
+
)
|
|
1530
|
+
parsed_content = env.parse(chat_template)
|
|
1531
|
+
template_vars = jinja2.meta.find_undeclared_variables(parsed_content)
|
|
1532
|
+
return template_vars
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
_cached_resolve_chat_template_kwargs = lru_cache(_resolve_chat_template_kwargs)
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
@lru_cache
|
|
1539
|
+
def _get_hf_base_chat_template_params() -> frozenset[str]:
|
|
1540
|
+
# Get standard parameters from HuggingFace's base tokenizer class.
|
|
1541
|
+
# This dynamically extracts parameters from PreTrainedTokenizer's
|
|
1542
|
+
# apply_chat_template method, ensuring compatibility with tokenizers
|
|
1543
|
+
# that use **kwargs to receive standard parameters.
|
|
1544
|
+
|
|
1545
|
+
# Read signature from HF's base class - the single source of truth
|
|
1546
|
+
base_sig = inspect.signature(PreTrainedTokenizer.apply_chat_template)
|
|
1547
|
+
# Exclude VAR_KEYWORD (**kwargs) and VAR_POSITIONAL (*args) placeholders
|
|
1548
|
+
return frozenset(
|
|
1549
|
+
p.name
|
|
1550
|
+
for p in base_sig.parameters.values()
|
|
1551
|
+
if p.kind
|
|
1552
|
+
not in (inspect.Parameter.VAR_KEYWORD, inspect.Parameter.VAR_POSITIONAL)
|
|
1553
|
+
)
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
def resolve_chat_template_kwargs(
|
|
1557
|
+
tokenizer: PreTrainedTokenizer | PreTrainedTokenizerFast,
|
|
1558
|
+
chat_template: str,
|
|
1559
|
+
chat_template_kwargs: dict[str, Any],
|
|
1560
|
+
raise_on_unexpected: bool = True,
|
|
1561
|
+
) -> dict[str, Any]:
|
|
1562
|
+
# We exclude chat_template from kwargs here, because
|
|
1563
|
+
# chat template has been already resolved at this stage
|
|
1564
|
+
unexpected_vars = {"chat_template", "tokenize"}
|
|
1565
|
+
if raise_on_unexpected and (
|
|
1566
|
+
unexpected_in_kwargs := unexpected_vars & chat_template_kwargs.keys()
|
|
1567
|
+
):
|
|
1568
|
+
raise ValueError(
|
|
1569
|
+
"Found unexpected chat template kwargs from request: "
|
|
1570
|
+
f"{unexpected_in_kwargs}"
|
|
1571
|
+
)
|
|
1572
|
+
|
|
1573
|
+
fn_kw = {
|
|
1574
|
+
k
|
|
1575
|
+
for k in chat_template_kwargs
|
|
1576
|
+
if supports_kw(tokenizer.apply_chat_template, k, allow_var_kwargs=False)
|
|
1577
|
+
}
|
|
1578
|
+
template_vars = _cached_resolve_chat_template_kwargs(chat_template)
|
|
1579
|
+
|
|
1580
|
+
# Allow standard HF parameters even if tokenizer uses **kwargs to receive them
|
|
1581
|
+
hf_base_params = _get_hf_base_chat_template_params()
|
|
1582
|
+
|
|
1583
|
+
accept_vars = (fn_kw | template_vars | hf_base_params) - unexpected_vars
|
|
1584
|
+
return {k: v for k, v in chat_template_kwargs.items() if k in accept_vars}
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
def apply_hf_chat_template(
|
|
1588
|
+
tokenizer: PreTrainedTokenizer | PreTrainedTokenizerFast,
|
|
1589
|
+
conversation: list[ConversationMessage],
|
|
1590
|
+
chat_template: str | None,
|
|
1591
|
+
tools: list[dict[str, Any]] | None,
|
|
1592
|
+
*,
|
|
1593
|
+
model_config: ModelConfig,
|
|
1594
|
+
**kwargs: Any,
|
|
1595
|
+
) -> str:
|
|
1596
|
+
hf_chat_template = resolve_hf_chat_template(
|
|
1597
|
+
tokenizer,
|
|
1598
|
+
chat_template=chat_template,
|
|
1599
|
+
tools=tools,
|
|
1600
|
+
model_config=model_config,
|
|
1601
|
+
)
|
|
1602
|
+
|
|
1603
|
+
if hf_chat_template is None:
|
|
1604
|
+
raise ValueError(
|
|
1605
|
+
"As of transformers v4.44, default chat template is no longer "
|
|
1606
|
+
"allowed, so you must provide a chat template if the tokenizer "
|
|
1607
|
+
"does not define one."
|
|
1608
|
+
)
|
|
1609
|
+
|
|
1610
|
+
resolved_kwargs = resolve_chat_template_kwargs(
|
|
1611
|
+
tokenizer=tokenizer,
|
|
1612
|
+
chat_template=hf_chat_template,
|
|
1613
|
+
chat_template_kwargs=kwargs,
|
|
1614
|
+
)
|
|
1615
|
+
|
|
1616
|
+
try:
|
|
1617
|
+
return tokenizer.apply_chat_template(
|
|
1618
|
+
conversation=conversation, # type: ignore[arg-type]
|
|
1619
|
+
tools=tools, # type: ignore[arg-type]
|
|
1620
|
+
chat_template=hf_chat_template,
|
|
1621
|
+
tokenize=False,
|
|
1622
|
+
**resolved_kwargs,
|
|
1623
|
+
)
|
|
1624
|
+
|
|
1625
|
+
# External library exceptions can sometimes occur despite the framework's
|
|
1626
|
+
# internal exception management capabilities.
|
|
1627
|
+
except Exception as e:
|
|
1628
|
+
# Log and report any library-related exceptions for further
|
|
1629
|
+
# investigation.
|
|
1630
|
+
logger.exception(
|
|
1631
|
+
"An error occurred in `transformers` while applying chat template"
|
|
1632
|
+
)
|
|
1633
|
+
raise ValueError(str(e)) from e
|
|
1634
|
+
|
|
1635
|
+
|
|
1636
|
+
def apply_mistral_chat_template(
|
|
1637
|
+
tokenizer: MistralTokenizer,
|
|
1638
|
+
messages: list[ChatCompletionMessageParam],
|
|
1639
|
+
chat_template: str | None,
|
|
1640
|
+
tools: list[dict[str, Any]] | None,
|
|
1641
|
+
**kwargs: Any,
|
|
1642
|
+
) -> list[int]:
|
|
1643
|
+
from mistral_common.exceptions import MistralCommonException
|
|
1644
|
+
|
|
1645
|
+
# The return value of resolve_mistral_chat_template is always None,
|
|
1646
|
+
# and we won't use it.
|
|
1647
|
+
resolve_mistral_chat_template(
|
|
1648
|
+
chat_template=chat_template,
|
|
1649
|
+
**kwargs,
|
|
1650
|
+
)
|
|
1651
|
+
|
|
1652
|
+
try:
|
|
1653
|
+
return tokenizer.apply_chat_template(
|
|
1654
|
+
messages=messages,
|
|
1655
|
+
tools=tools,
|
|
1656
|
+
**kwargs,
|
|
1657
|
+
)
|
|
1658
|
+
# mistral-common uses assert statements to stop processing of input
|
|
1659
|
+
# if input does not comply with the expected format.
|
|
1660
|
+
# We convert those assertion errors to ValueErrors so they can be
|
|
1661
|
+
# properly caught in the preprocessing_input step
|
|
1662
|
+
except (AssertionError, MistralCommonException) as e:
|
|
1663
|
+
raise ValueError(str(e)) from e
|
|
1664
|
+
|
|
1665
|
+
# External library exceptions can sometimes occur despite the framework's
|
|
1666
|
+
# internal exception management capabilities.
|
|
1667
|
+
except Exception as e:
|
|
1668
|
+
# Log and report any library-related exceptions for further
|
|
1669
|
+
# investigation.
|
|
1670
|
+
logger.exception(
|
|
1671
|
+
"An error occurred in `mistral_common` while applying chat template"
|
|
1672
|
+
)
|
|
1673
|
+
raise ValueError(str(e)) from e
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
def get_history_tool_calls_cnt(conversation: list[ConversationMessage]):
|
|
1677
|
+
idx = 0
|
|
1678
|
+
for msg in conversation:
|
|
1679
|
+
if msg["role"] == "assistant":
|
|
1680
|
+
tool_calls = msg.get("tool_calls")
|
|
1681
|
+
idx += len(list(tool_calls)) if tool_calls is not None else 0 # noqa
|
|
1682
|
+
return idx
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
def make_tool_call_id(id_type: str = "random", func_name=None, idx=None):
|
|
1686
|
+
if id_type == "kimi_k2":
|
|
1687
|
+
return f"functions.{func_name}:{idx}"
|
|
1688
|
+
else:
|
|
1689
|
+
# by default return random
|
|
1690
|
+
return f"chatcmpl-tool-{random_uuid()}"
|