vllm-cpu 0.8.5.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.
Potentially problematic release.
This version of vllm-cpu might be problematic. Click here for more details.
- vllm/_C.abi3.so +0 -0
- vllm/__init__.py +170 -0
- vllm/_custom_ops.py +1536 -0
- vllm/_ipex_ops.py +241 -0
- vllm/_version.py +34 -0
- vllm/adapter_commons/__init__.py +0 -0
- vllm/adapter_commons/layers.py +16 -0
- vllm/adapter_commons/models.py +105 -0
- vllm/adapter_commons/request.py +25 -0
- vllm/adapter_commons/utils.py +92 -0
- vllm/adapter_commons/worker_manager.py +38 -0
- vllm/assets/__init__.py +0 -0
- vllm/assets/audio.py +38 -0
- vllm/assets/base.py +40 -0
- vllm/assets/image.py +31 -0
- vllm/assets/video.py +103 -0
- vllm/attention/__init__.py +19 -0
- vllm/attention/backends/__init__.py +0 -0
- vllm/attention/backends/abstract.py +306 -0
- vllm/attention/backends/blocksparse_attn.py +457 -0
- vllm/attention/backends/cpu_mla.py +303 -0
- vllm/attention/backends/flash_attn.py +999 -0
- vllm/attention/backends/flashinfer.py +1092 -0
- vllm/attention/backends/flashmla.py +242 -0
- vllm/attention/backends/hpu_attn.py +301 -0
- vllm/attention/backends/ipex_attn.py +396 -0
- vllm/attention/backends/mla/__init__.py +0 -0
- vllm/attention/backends/mla/common.py +1444 -0
- vllm/attention/backends/pallas.py +346 -0
- vllm/attention/backends/placeholder_attn.py +399 -0
- vllm/attention/backends/rocm_aiter_mla.py +412 -0
- vllm/attention/backends/rocm_flash_attn.py +969 -0
- vllm/attention/backends/torch_sdpa.py +691 -0
- vllm/attention/backends/triton_mla.py +113 -0
- vllm/attention/backends/utils.py +609 -0
- vllm/attention/backends/xformers.py +798 -0
- vllm/attention/layer.py +443 -0
- vllm/attention/ops/__init__.py +0 -0
- vllm/attention/ops/blocksparse_attention/__init__.py +0 -0
- vllm/attention/ops/blocksparse_attention/blocksparse_attention_kernel.py +432 -0
- vllm/attention/ops/blocksparse_attention/interface.py +238 -0
- vllm/attention/ops/blocksparse_attention/utils.py +244 -0
- vllm/attention/ops/chunked_prefill_paged_decode.py +366 -0
- vllm/attention/ops/flashmla.py +115 -0
- vllm/attention/ops/hpu_paged_attn.py +105 -0
- vllm/attention/ops/ipex_attn.py +193 -0
- vllm/attention/ops/merge_attn_states.py +42 -0
- vllm/attention/ops/nki_flash_attn.py +905 -0
- vllm/attention/ops/paged_attn.py +255 -0
- vllm/attention/ops/prefix_prefill.py +902 -0
- vllm/attention/ops/rocm_aiter_mla.py +42 -0
- vllm/attention/ops/rocm_aiter_paged_attn.py +101 -0
- vllm/attention/ops/triton_decode_attention.py +675 -0
- vllm/attention/ops/triton_flash_attention.py +1375 -0
- vllm/attention/ops/triton_merge_attn_states.py +96 -0
- vllm/attention/selector.py +186 -0
- vllm/attention/utils/fa_utils.py +54 -0
- vllm/beam_search.py +82 -0
- vllm/benchmarks/__init__.py +0 -0
- vllm/benchmarks/datasets.py +831 -0
- vllm/benchmarks/endpoint_request_func.py +160 -0
- vllm/benchmarks/latency.py +181 -0
- vllm/benchmarks/serve.py +925 -0
- vllm/benchmarks/throughput.py +608 -0
- vllm/benchmarks/utils.py +69 -0
- vllm/collect_env.py +795 -0
- vllm/compilation/__init__.py +0 -0
- vllm/compilation/backends.py +715 -0
- vllm/compilation/compiler_interface.py +437 -0
- vllm/compilation/counter.py +33 -0
- vllm/compilation/decorators.py +249 -0
- vllm/compilation/fix_functionalization.py +182 -0
- vllm/compilation/fusion.py +617 -0
- vllm/compilation/fx_utils.py +60 -0
- vllm/compilation/inductor_pass.py +114 -0
- vllm/compilation/monitor.py +38 -0
- vllm/compilation/multi_output_match.py +108 -0
- vllm/compilation/noop_elimination.py +135 -0
- vllm/compilation/pass_manager.py +74 -0
- vllm/compilation/sequence_parallelism.py +266 -0
- vllm/compilation/torch25_custom_graph_pass.py +41 -0
- vllm/compilation/vllm_inductor_pass.py +68 -0
- vllm/compilation/wrapper.py +129 -0
- vllm/config.py +4179 -0
- vllm/connections.py +170 -0
- vllm/core/__init__.py +0 -0
- vllm/core/block/__init__.py +0 -0
- vllm/core/block/block_table.py +398 -0
- vllm/core/block/common.py +370 -0
- vllm/core/block/cpu_gpu_block_allocator.py +440 -0
- vllm/core/block/interfaces.py +318 -0
- vllm/core/block/naive_block.py +465 -0
- vllm/core/block/prefix_caching_block.py +1134 -0
- vllm/core/block/utils.py +27 -0
- vllm/core/block_manager.py +520 -0
- vllm/core/evictor.py +156 -0
- vllm/core/interfaces.py +134 -0
- vllm/core/placeholder_block_space_manager.py +99 -0
- vllm/core/scheduler.py +2060 -0
- vllm/device_allocator/__init__.py +0 -0
- vllm/device_allocator/cumem.py +280 -0
- vllm/distributed/__init__.py +5 -0
- vllm/distributed/communication_op.py +40 -0
- vllm/distributed/device_communicators/__init__.py +0 -0
- vllm/distributed/device_communicators/base_device_communicator.py +151 -0
- vllm/distributed/device_communicators/cpu_communicator.py +139 -0
- vllm/distributed/device_communicators/cuda_communicator.py +131 -0
- vllm/distributed/device_communicators/cuda_wrapper.py +179 -0
- vllm/distributed/device_communicators/custom_all_reduce.py +301 -0
- vllm/distributed/device_communicators/custom_all_reduce_utils.py +257 -0
- vllm/distributed/device_communicators/hpu_communicator.py +45 -0
- vllm/distributed/device_communicators/neuron_communicator.py +19 -0
- vllm/distributed/device_communicators/pynccl.py +217 -0
- vllm/distributed/device_communicators/pynccl_wrapper.py +340 -0
- vllm/distributed/device_communicators/shm_broadcast.py +557 -0
- vllm/distributed/device_communicators/tpu_communicator.py +93 -0
- vllm/distributed/device_communicators/xpu_communicator.py +54 -0
- vllm/distributed/kv_transfer/README.md +29 -0
- vllm/distributed/kv_transfer/__init__.py +11 -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 +127 -0
- vllm/distributed/kv_transfer/kv_connector/factory.py +107 -0
- vllm/distributed/kv_transfer/kv_connector/lmcache_connector.py +98 -0
- vllm/distributed/kv_transfer/kv_connector/mooncake_store_connector.py +201 -0
- vllm/distributed/kv_transfer/kv_connector/simple_connector.py +328 -0
- vllm/distributed/kv_transfer/kv_connector/utils.py +90 -0
- vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +8 -0
- vllm/distributed/kv_transfer/kv_connector/v1/base.py +209 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +131 -0
- vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py +383 -0
- vllm/distributed/kv_transfer/kv_connector_agent.py +76 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/base.py +174 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/mooncake_store.py +160 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py +236 -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 +279 -0
- vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +279 -0
- vllm/distributed/kv_transfer/kv_transfer_state.py +70 -0
- vllm/distributed/parallel_state.py +1209 -0
- vllm/distributed/utils.py +366 -0
- vllm/engine/__init__.py +0 -0
- vllm/engine/arg_utils.py +1724 -0
- vllm/engine/async_llm_engine.py +1261 -0
- vllm/engine/async_timeout.py +191 -0
- vllm/engine/llm_engine.py +2150 -0
- vllm/engine/metrics.py +717 -0
- vllm/engine/metrics_types.py +96 -0
- vllm/engine/multiprocessing/__init__.py +183 -0
- vllm/engine/multiprocessing/client.py +745 -0
- vllm/engine/multiprocessing/engine.py +450 -0
- vllm/engine/output_processor/__init__.py +0 -0
- vllm/engine/output_processor/interfaces.py +74 -0
- vllm/engine/output_processor/multi_step.py +210 -0
- vllm/engine/output_processor/single_step.py +136 -0
- vllm/engine/output_processor/stop_checker.py +130 -0
- vllm/engine/output_processor/util.py +27 -0
- vllm/engine/protocol.py +302 -0
- vllm/entrypoints/__init__.py +0 -0
- vllm/entrypoints/api_server.py +177 -0
- vllm/entrypoints/chat_utils.py +1259 -0
- vllm/entrypoints/cli/__init__.py +0 -0
- vllm/entrypoints/cli/benchmark/__init__.py +0 -0
- vllm/entrypoints/cli/benchmark/base.py +38 -0
- vllm/entrypoints/cli/benchmark/latency.py +29 -0
- vllm/entrypoints/cli/benchmark/main.py +53 -0
- vllm/entrypoints/cli/benchmark/serve.py +29 -0
- vllm/entrypoints/cli/benchmark/throughput.py +29 -0
- vllm/entrypoints/cli/collect_env.py +35 -0
- vllm/entrypoints/cli/main.py +59 -0
- vllm/entrypoints/cli/openai.py +175 -0
- vllm/entrypoints/cli/serve.py +59 -0
- vllm/entrypoints/cli/types.py +24 -0
- vllm/entrypoints/launcher.py +146 -0
- vllm/entrypoints/llm.py +1450 -0
- vllm/entrypoints/logger.py +44 -0
- vllm/entrypoints/openai/__init__.py +0 -0
- vllm/entrypoints/openai/api_server.py +1130 -0
- vllm/entrypoints/openai/cli_args.py +296 -0
- vllm/entrypoints/openai/logits_processors.py +89 -0
- vllm/entrypoints/openai/protocol.py +1806 -0
- vllm/entrypoints/openai/run_batch.py +439 -0
- vllm/entrypoints/openai/serving_chat.py +1210 -0
- vllm/entrypoints/openai/serving_completion.py +557 -0
- vllm/entrypoints/openai/serving_embedding.py +245 -0
- vllm/entrypoints/openai/serving_engine.py +569 -0
- vllm/entrypoints/openai/serving_models.py +314 -0
- vllm/entrypoints/openai/serving_pooling.py +237 -0
- vllm/entrypoints/openai/serving_score.py +439 -0
- vllm/entrypoints/openai/serving_tokenization.py +147 -0
- vllm/entrypoints/openai/serving_transcription.py +421 -0
- vllm/entrypoints/openai/tool_parsers/__init__.py +19 -0
- vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +163 -0
- vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py +254 -0
- vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py +232 -0
- vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py +370 -0
- vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py +211 -0
- vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py +303 -0
- vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +262 -0
- vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +342 -0
- vllm/entrypoints/openai/tool_parsers/phi4mini_tool_parser.py +110 -0
- vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py +292 -0
- vllm/entrypoints/openai/tool_parsers/utils.py +123 -0
- vllm/entrypoints/score_utils.py +49 -0
- vllm/entrypoints/ssl.py +74 -0
- vllm/entrypoints/utils.py +136 -0
- vllm/env_override.py +34 -0
- vllm/envs.py +800 -0
- vllm/executor/__init__.py +0 -0
- vllm/executor/executor_base.py +400 -0
- vllm/executor/mp_distributed_executor.py +243 -0
- vllm/executor/msgspec_utils.py +29 -0
- vllm/executor/multiproc_worker_utils.py +312 -0
- vllm/executor/ray_distributed_executor.py +700 -0
- vllm/executor/ray_utils.py +400 -0
- vllm/executor/uniproc_executor.py +141 -0
- vllm/forward_context.py +159 -0
- vllm/inputs/__init__.py +37 -0
- vllm/inputs/data.py +248 -0
- vllm/inputs/parse.py +121 -0
- vllm/inputs/preprocess.py +745 -0
- vllm/inputs/registry.py +212 -0
- vllm/jsontree.py +79 -0
- vllm/logger.py +210 -0
- vllm/logging_utils/__init__.py +7 -0
- vllm/logging_utils/formatter.py +17 -0
- vllm/logits_process.py +121 -0
- vllm/lora/__init__.py +0 -0
- vllm/lora/fully_sharded_layers.py +335 -0
- vllm/lora/layers.py +1263 -0
- vllm/lora/lora.py +198 -0
- vllm/lora/models.py +802 -0
- vllm/lora/ops/__init__.py +0 -0
- vllm/lora/ops/torch_ops/__init__.py +15 -0
- vllm/lora/ops/torch_ops/lora_ops.py +115 -0
- vllm/lora/ops/triton_ops/__init__.py +11 -0
- vllm/lora/ops/triton_ops/kernel_utils.py +243 -0
- vllm/lora/ops/triton_ops/lora_expand.py +293 -0
- vllm/lora/ops/triton_ops/lora_kernel_metadata.py +147 -0
- vllm/lora/ops/triton_ops/lora_shrink.py +247 -0
- vllm/lora/ops/triton_ops/utils.py +121 -0
- vllm/lora/peft_helper.py +115 -0
- vllm/lora/punica_wrapper/__init__.py +9 -0
- vllm/lora/punica_wrapper/punica_base.py +483 -0
- vllm/lora/punica_wrapper/punica_cpu.py +348 -0
- vllm/lora/punica_wrapper/punica_gpu.py +289 -0
- vllm/lora/punica_wrapper/punica_hpu.py +144 -0
- vllm/lora/punica_wrapper/punica_selector.py +20 -0
- vllm/lora/punica_wrapper/utils.py +161 -0
- vllm/lora/request.py +97 -0
- vllm/lora/resolver.py +83 -0
- vllm/lora/utils.py +237 -0
- vllm/lora/worker_manager.py +251 -0
- vllm/model_executor/__init__.py +15 -0
- vllm/model_executor/custom_op.py +153 -0
- vllm/model_executor/guided_decoding/__init__.py +180 -0
- vllm/model_executor/guided_decoding/guidance_decoding.py +63 -0
- vllm/model_executor/guided_decoding/guidance_logits_processors.py +85 -0
- vllm/model_executor/guided_decoding/guided_fields.py +42 -0
- vllm/model_executor/guided_decoding/lm_format_enforcer_decoding.py +66 -0
- vllm/model_executor/guided_decoding/outlines_decoding.py +154 -0
- vllm/model_executor/guided_decoding/outlines_logits_processors.py +271 -0
- vllm/model_executor/guided_decoding/reasoner/__init__.py +35 -0
- vllm/model_executor/guided_decoding/utils.py +241 -0
- vllm/model_executor/guided_decoding/xgrammar_decoding.py +425 -0
- vllm/model_executor/layers/__init__.py +0 -0
- vllm/model_executor/layers/activation.py +368 -0
- vllm/model_executor/layers/fused_moe/__init__.py +51 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=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.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=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.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/README +12 -0
- vllm/model_executor/layers/fused_moe/cutlass_moe.py +180 -0
- vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +294 -0
- vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +374 -0
- vllm/model_executor/layers/fused_moe/fused_moe.py +1539 -0
- vllm/model_executor/layers/fused_moe/layer.py +949 -0
- vllm/model_executor/layers/fused_moe/moe_align_block_size.py +243 -0
- vllm/model_executor/layers/fused_moe/moe_pallas.py +64 -0
- vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +59 -0
- vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +416 -0
- vllm/model_executor/layers/fused_moe/utils.py +48 -0
- vllm/model_executor/layers/layernorm.py +277 -0
- vllm/model_executor/layers/lightning_attn.py +651 -0
- vllm/model_executor/layers/linear.py +1518 -0
- vllm/model_executor/layers/logits_processor.py +196 -0
- vllm/model_executor/layers/mamba/__init__.py +0 -0
- vllm/model_executor/layers/mamba/mamba2_metadata.py +109 -0
- vllm/model_executor/layers/mamba/mamba_mixer.py +244 -0
- vllm/model_executor/layers/mamba/mamba_mixer2.py +538 -0
- vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
- vllm/model_executor/layers/mamba/ops/causal_conv1d.py +104 -0
- vllm/model_executor/layers/mamba/ops/mamba_ssm.py +415 -0
- vllm/model_executor/layers/mamba/ops/ssd_bmm.py +261 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +588 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +750 -0
- vllm/model_executor/layers/mamba/ops/ssd_combined.py +231 -0
- vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +205 -0
- vllm/model_executor/layers/pooler.py +336 -0
- vllm/model_executor/layers/quantization/__init__.py +153 -0
- vllm/model_executor/layers/quantization/aqlm.py +374 -0
- vllm/model_executor/layers/quantization/awq.py +184 -0
- vllm/model_executor/layers/quantization/awq_marlin.py +518 -0
- vllm/model_executor/layers/quantization/awq_triton.py +319 -0
- vllm/model_executor/layers/quantization/base_config.py +145 -0
- vllm/model_executor/layers/quantization/bitblas.py +459 -0
- vllm/model_executor/layers/quantization/bitsandbytes.py +396 -0
- vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +624 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +1100 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +20 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +357 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +54 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +159 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +119 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +149 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +110 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +200 -0
- vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +205 -0
- vllm/model_executor/layers/quantization/compressed_tensors/utils.py +213 -0
- vllm/model_executor/layers/quantization/deepspeedfp.py +193 -0
- vllm/model_executor/layers/quantization/experts_int8.py +194 -0
- vllm/model_executor/layers/quantization/fbgemm_fp8.py +168 -0
- vllm/model_executor/layers/quantization/fp8.py +832 -0
- vllm/model_executor/layers/quantization/gguf.py +408 -0
- vllm/model_executor/layers/quantization/gptq.py +276 -0
- vllm/model_executor/layers/quantization/gptq_bitblas.py +438 -0
- vllm/model_executor/layers/quantization/gptq_marlin.py +643 -0
- vllm/model_executor/layers/quantization/gptq_marlin_24.py +295 -0
- vllm/model_executor/layers/quantization/hqq_marlin.py +328 -0
- vllm/model_executor/layers/quantization/ipex_quant.py +250 -0
- vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +89 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +82 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +115 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +299 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +142 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +119 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +132 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +66 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +86 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +119 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +136 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +40 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +104 -0
- vllm/model_executor/layers/quantization/kv_cache.py +137 -0
- vllm/model_executor/layers/quantization/marlin.py +259 -0
- vllm/model_executor/layers/quantization/modelopt.py +410 -0
- vllm/model_executor/layers/quantization/moe_wna16.py +447 -0
- vllm/model_executor/layers/quantization/neuron_quant.py +67 -0
- vllm/model_executor/layers/quantization/ptpc_fp8.py +125 -0
- vllm/model_executor/layers/quantization/qqq.py +273 -0
- vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
- vllm/model_executor/layers/quantization/quark/quark.py +385 -0
- vllm/model_executor/layers/quantization/quark/quark_moe.py +236 -0
- vllm/model_executor/layers/quantization/quark/schemes/__init__.py +7 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +54 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +142 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +121 -0
- vllm/model_executor/layers/quantization/quark/utils.py +102 -0
- vllm/model_executor/layers/quantization/schema.py +85 -0
- vllm/model_executor/layers/quantization/torchao.py +127 -0
- vllm/model_executor/layers/quantization/tpu_int8.py +119 -0
- vllm/model_executor/layers/quantization/utils/__init__.py +5 -0
- vllm/model_executor/layers/quantization/utils/allspark_utils.py +51 -0
- vllm/model_executor/layers/quantization/utils/bitblas_utils.py +198 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +18 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/fp8_utils.py +523 -0
- vllm/model_executor/layers/quantization/utils/gptq_utils.py +94 -0
- vllm/model_executor/layers/quantization/utils/int8_utils.py +459 -0
- vllm/model_executor/layers/quantization/utils/layer_utils.py +39 -0
- vllm/model_executor/layers/quantization/utils/machete_utils.py +32 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils.py +413 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +110 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +164 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +464 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test_qqq.py +127 -0
- vllm/model_executor/layers/quantization/utils/quant_utils.py +571 -0
- vllm/model_executor/layers/quantization/utils/w8a8_utils.py +404 -0
- vllm/model_executor/layers/rejection_sampler.py +400 -0
- vllm/model_executor/layers/resampler.py +269 -0
- vllm/model_executor/layers/rotary_embedding.py +1598 -0
- vllm/model_executor/layers/sampler.py +1221 -0
- vllm/model_executor/layers/spec_decode_base_sampler.py +258 -0
- vllm/model_executor/layers/typical_acceptance_sampler.py +172 -0
- vllm/model_executor/layers/utils.py +99 -0
- vllm/model_executor/layers/vocab_parallel_embedding.py +485 -0
- vllm/model_executor/model_loader/__init__.py +20 -0
- vllm/model_executor/model_loader/loader.py +1542 -0
- vllm/model_executor/model_loader/neuron.py +243 -0
- vllm/model_executor/model_loader/tensorizer.py +468 -0
- vllm/model_executor/model_loader/utils.py +171 -0
- vllm/model_executor/model_loader/weight_utils.py +749 -0
- vllm/model_executor/models/__init__.py +27 -0
- vllm/model_executor/models/adapters.py +247 -0
- vllm/model_executor/models/arctic.py +559 -0
- vllm/model_executor/models/aria.py +656 -0
- vllm/model_executor/models/aya_vision.py +461 -0
- vllm/model_executor/models/baichuan.py +469 -0
- vllm/model_executor/models/bamba.py +542 -0
- vllm/model_executor/models/bart.py +936 -0
- vllm/model_executor/models/bert.py +725 -0
- vllm/model_executor/models/blip.py +337 -0
- vllm/model_executor/models/blip2.py +717 -0
- vllm/model_executor/models/bloom.py +358 -0
- vllm/model_executor/models/chameleon.py +1135 -0
- vllm/model_executor/models/chatglm.py +476 -0
- vllm/model_executor/models/clip.py +410 -0
- vllm/model_executor/models/commandr.py +466 -0
- vllm/model_executor/models/constant_size_cache.py +136 -0
- vllm/model_executor/models/dbrx.py +469 -0
- vllm/model_executor/models/deepseek.py +484 -0
- vllm/model_executor/models/deepseek_mtp.py +266 -0
- vllm/model_executor/models/deepseek_v2.py +830 -0
- vllm/model_executor/models/deepseek_vl2.py +647 -0
- vllm/model_executor/models/eagle.py +247 -0
- vllm/model_executor/models/exaone.py +548 -0
- vllm/model_executor/models/fairseq2_llama.py +153 -0
- vllm/model_executor/models/falcon.py +508 -0
- vllm/model_executor/models/florence2.py +1102 -0
- vllm/model_executor/models/fuyu.py +388 -0
- vllm/model_executor/models/gemma.py +423 -0
- vllm/model_executor/models/gemma2.py +423 -0
- vllm/model_executor/models/gemma3.py +531 -0
- vllm/model_executor/models/gemma3_mm.py +716 -0
- vllm/model_executor/models/glm.py +22 -0
- vllm/model_executor/models/glm4.py +303 -0
- vllm/model_executor/models/glm4v.py +647 -0
- vllm/model_executor/models/gpt2.py +313 -0
- vllm/model_executor/models/gpt_bigcode.py +336 -0
- vllm/model_executor/models/gpt_j.py +337 -0
- vllm/model_executor/models/gpt_neox.py +330 -0
- vllm/model_executor/models/granite.py +494 -0
- vllm/model_executor/models/granite_speech.py +777 -0
- vllm/model_executor/models/granitemoe.py +435 -0
- vllm/model_executor/models/granitemoeshared.py +339 -0
- vllm/model_executor/models/gritlm.py +245 -0
- vllm/model_executor/models/grok1.py +560 -0
- vllm/model_executor/models/h2ovl.py +542 -0
- vllm/model_executor/models/idefics2_vision_model.py +387 -0
- vllm/model_executor/models/idefics3.py +767 -0
- vllm/model_executor/models/interfaces.py +569 -0
- vllm/model_executor/models/interfaces_base.py +163 -0
- vllm/model_executor/models/intern_vit.py +476 -0
- vllm/model_executor/models/internlm2.py +453 -0
- vllm/model_executor/models/internlm2_ve.py +146 -0
- vllm/model_executor/models/internvl.py +945 -0
- vllm/model_executor/models/jais.py +371 -0
- vllm/model_executor/models/jamba.py +590 -0
- vllm/model_executor/models/kimi_vl.py +577 -0
- vllm/model_executor/models/llama.py +619 -0
- vllm/model_executor/models/llama4.py +530 -0
- vllm/model_executor/models/llama_eagle.py +152 -0
- vllm/model_executor/models/llama_eagle3.py +232 -0
- vllm/model_executor/models/llava.py +869 -0
- vllm/model_executor/models/llava_next.py +582 -0
- vllm/model_executor/models/llava_next_video.py +470 -0
- vllm/model_executor/models/llava_onevision.py +954 -0
- vllm/model_executor/models/mamba.py +271 -0
- vllm/model_executor/models/mamba2.py +302 -0
- vllm/model_executor/models/mamba_cache.py +76 -0
- vllm/model_executor/models/medusa.py +210 -0
- vllm/model_executor/models/minicpm.py +592 -0
- vllm/model_executor/models/minicpm3.py +229 -0
- vllm/model_executor/models/minicpmo.py +725 -0
- vllm/model_executor/models/minicpmv.py +1287 -0
- vllm/model_executor/models/minimax_cache.py +35 -0
- vllm/model_executor/models/minimax_text_01.py +1261 -0
- vllm/model_executor/models/mistral3.py +598 -0
- vllm/model_executor/models/mixtral.py +485 -0
- vllm/model_executor/models/mixtral_quant.py +447 -0
- vllm/model_executor/models/mllama.py +1623 -0
- vllm/model_executor/models/mllama4.py +838 -0
- vllm/model_executor/models/mlp_speculator.py +205 -0
- vllm/model_executor/models/modernbert.py +325 -0
- vllm/model_executor/models/module_mapping.py +71 -0
- vllm/model_executor/models/molmo.py +1567 -0
- vllm/model_executor/models/moonvit.py +628 -0
- vllm/model_executor/models/mpt.py +329 -0
- vllm/model_executor/models/nemotron.py +506 -0
- vllm/model_executor/models/nemotron_nas.py +446 -0
- vllm/model_executor/models/nvlm_d.py +212 -0
- vllm/model_executor/models/olmo.py +390 -0
- vllm/model_executor/models/olmo2.py +412 -0
- vllm/model_executor/models/olmoe.py +449 -0
- vllm/model_executor/models/opt.py +410 -0
- vllm/model_executor/models/orion.py +356 -0
- vllm/model_executor/models/paligemma.py +397 -0
- vllm/model_executor/models/persimmon.py +342 -0
- vllm/model_executor/models/phi.py +354 -0
- vllm/model_executor/models/phi3.py +18 -0
- vllm/model_executor/models/phi3_small.py +463 -0
- vllm/model_executor/models/phi3v.py +722 -0
- vllm/model_executor/models/phi4mm.py +1263 -0
- vllm/model_executor/models/phi4mm_audio.py +1232 -0
- vllm/model_executor/models/phi4mm_utils.py +1883 -0
- vllm/model_executor/models/phimoe.py +666 -0
- vllm/model_executor/models/pixtral.py +1281 -0
- vllm/model_executor/models/plamo2.py +736 -0
- vllm/model_executor/models/prithvi_geospatial_mae.py +231 -0
- vllm/model_executor/models/qwen.py +360 -0
- vllm/model_executor/models/qwen2.py +552 -0
- vllm/model_executor/models/qwen2_5_omni_thinker.py +901 -0
- vllm/model_executor/models/qwen2_5_vl.py +1136 -0
- vllm/model_executor/models/qwen2_audio.py +402 -0
- vllm/model_executor/models/qwen2_moe.py +531 -0
- vllm/model_executor/models/qwen2_rm.py +130 -0
- vllm/model_executor/models/qwen2_vl.py +1409 -0
- vllm/model_executor/models/qwen3.py +319 -0
- vllm/model_executor/models/qwen3_moe.py +528 -0
- vllm/model_executor/models/qwen_vl.py +784 -0
- vllm/model_executor/models/registry.py +611 -0
- vllm/model_executor/models/roberta.py +332 -0
- vllm/model_executor/models/siglip.py +522 -0
- vllm/model_executor/models/skyworkr1v.py +949 -0
- vllm/model_executor/models/smolvlm.py +51 -0
- vllm/model_executor/models/solar.py +504 -0
- vllm/model_executor/models/stablelm.py +349 -0
- vllm/model_executor/models/starcoder2.py +355 -0
- vllm/model_executor/models/telechat2.py +139 -0
- vllm/model_executor/models/teleflm.py +78 -0
- vllm/model_executor/models/transformers.py +442 -0
- vllm/model_executor/models/ultravox.py +655 -0
- vllm/model_executor/models/utils.py +714 -0
- vllm/model_executor/models/vision.py +149 -0
- vllm/model_executor/models/whisper.py +746 -0
- vllm/model_executor/models/zamba2.py +1008 -0
- vllm/model_executor/parameter.py +458 -0
- vllm/model_executor/pooling_metadata.py +71 -0
- vllm/model_executor/sampling_metadata.py +596 -0
- vllm/model_executor/utils.py +53 -0
- vllm/multimodal/__init__.py +31 -0
- vllm/multimodal/audio.py +105 -0
- vllm/multimodal/base.py +218 -0
- vllm/multimodal/hasher.py +103 -0
- vllm/multimodal/image.py +77 -0
- vllm/multimodal/inputs.py +843 -0
- vllm/multimodal/parse.py +454 -0
- vllm/multimodal/processing.py +1760 -0
- vllm/multimodal/profiling.py +274 -0
- vllm/multimodal/registry.py +321 -0
- vllm/multimodal/utils.py +386 -0
- vllm/multimodal/video.py +166 -0
- vllm/outputs.py +521 -0
- vllm/platforms/__init__.py +286 -0
- vllm/platforms/cpu.py +182 -0
- vllm/platforms/cuda.py +463 -0
- vllm/platforms/hpu.py +94 -0
- vllm/platforms/interface.py +427 -0
- vllm/platforms/neuron.py +69 -0
- vllm/platforms/rocm.py +346 -0
- vllm/platforms/tpu.py +174 -0
- vllm/platforms/xpu.py +142 -0
- vllm/plugins/__init__.py +82 -0
- vllm/pooling_params.py +53 -0
- vllm/profiler/__init__.py +7 -0
- vllm/profiler/layerwise_profile.py +374 -0
- vllm/profiler/utils.py +147 -0
- vllm/prompt_adapter/__init__.py +0 -0
- vllm/prompt_adapter/layers.py +82 -0
- vllm/prompt_adapter/models.py +357 -0
- vllm/prompt_adapter/request.py +36 -0
- vllm/prompt_adapter/utils.py +97 -0
- vllm/prompt_adapter/worker_manager.py +178 -0
- vllm/py.typed +2 -0
- vllm/reasoning/__init__.py +12 -0
- vllm/reasoning/abs_reasoning_parsers.py +189 -0
- vllm/reasoning/deepseek_r1_reasoning_parser.py +172 -0
- vllm/reasoning/granite_reasoning_parser.py +362 -0
- vllm/sampling_params.py +598 -0
- vllm/scalar_type.py +335 -0
- vllm/scripts.py +14 -0
- vllm/sequence.py +1486 -0
- vllm/spec_decode/__init__.py +0 -0
- vllm/spec_decode/batch_expansion.py +505 -0
- vllm/spec_decode/draft_model_runner.py +335 -0
- vllm/spec_decode/interfaces.py +98 -0
- vllm/spec_decode/medusa_worker.py +137 -0
- vllm/spec_decode/metrics.py +212 -0
- vllm/spec_decode/mlp_speculator_worker.py +93 -0
- vllm/spec_decode/mqa_scorer.py +159 -0
- vllm/spec_decode/multi_step_worker.py +416 -0
- vllm/spec_decode/ngram_worker.py +195 -0
- vllm/spec_decode/proposer_worker_base.py +58 -0
- vllm/spec_decode/smaller_tp_proposer_worker.py +194 -0
- vllm/spec_decode/spec_decode_worker.py +1324 -0
- vllm/spec_decode/target_model_runner.py +44 -0
- vllm/spec_decode/top1_proposer.py +274 -0
- vllm/spec_decode/util.py +276 -0
- vllm/test_utils.py +129 -0
- vllm/third_party/__init__.py +0 -0
- vllm/third_party/pynvml.py +6139 -0
- vllm/tracing.py +130 -0
- vllm/transformers_utils/__init__.py +19 -0
- vllm/transformers_utils/config.py +813 -0
- vllm/transformers_utils/configs/__init__.py +52 -0
- vllm/transformers_utils/configs/arctic.py +206 -0
- vllm/transformers_utils/configs/chatglm.py +71 -0
- vllm/transformers_utils/configs/cohere2.py +194 -0
- vllm/transformers_utils/configs/dbrx.py +280 -0
- vllm/transformers_utils/configs/deepseek_vl2.py +216 -0
- vllm/transformers_utils/configs/eagle.py +65 -0
- vllm/transformers_utils/configs/exaone.py +191 -0
- vllm/transformers_utils/configs/falcon.py +89 -0
- vllm/transformers_utils/configs/h2ovl.py +15 -0
- vllm/transformers_utils/configs/internvl.py +53 -0
- vllm/transformers_utils/configs/jais.py +237 -0
- vllm/transformers_utils/configs/kimi_vl.py +36 -0
- vllm/transformers_utils/configs/medusa.py +62 -0
- vllm/transformers_utils/configs/mllama.py +30 -0
- vllm/transformers_utils/configs/mlp_speculator.py +67 -0
- vllm/transformers_utils/configs/moonvit.py +32 -0
- vllm/transformers_utils/configs/mpt.py +179 -0
- vllm/transformers_utils/configs/nemotron.py +204 -0
- vllm/transformers_utils/configs/nvlm_d.py +14 -0
- vllm/transformers_utils/configs/skyworkr1v.py +53 -0
- vllm/transformers_utils/configs/solar.py +246 -0
- vllm/transformers_utils/configs/telechat2.py +63 -0
- vllm/transformers_utils/configs/ultravox.py +107 -0
- vllm/transformers_utils/detokenizer.py +167 -0
- vllm/transformers_utils/detokenizer_utils.py +188 -0
- vllm/transformers_utils/processor.py +210 -0
- vllm/transformers_utils/processors/__init__.py +6 -0
- vllm/transformers_utils/processors/deepseek_vl2.py +363 -0
- vllm/transformers_utils/s3_utils.py +161 -0
- vllm/transformers_utils/tokenizer.py +291 -0
- vllm/transformers_utils/tokenizer_base.py +146 -0
- vllm/transformers_utils/tokenizer_group.py +110 -0
- vllm/transformers_utils/tokenizers/__init__.py +9 -0
- vllm/transformers_utils/tokenizers/mistral.py +483 -0
- vllm/transformers_utils/utils.py +98 -0
- vllm/triton_utils/__init__.py +5 -0
- vllm/triton_utils/importing.py +53 -0
- vllm/usage/__init__.py +0 -0
- vllm/usage/usage_lib.py +255 -0
- vllm/utils.py +2692 -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/flash_attn.py +783 -0
- vllm/v1/attention/backends/flashinfer.py +638 -0
- vllm/v1/attention/backends/mla/__init__.py +0 -0
- vllm/v1/attention/backends/mla/common.py +974 -0
- vllm/v1/attention/backends/mla/flashmla.py +149 -0
- vllm/v1/attention/backends/mla/triton_mla.py +118 -0
- vllm/v1/attention/backends/pallas.py +221 -0
- vllm/v1/attention/backends/triton_attn.py +198 -0
- vllm/v1/core/__init__.py +0 -0
- vllm/v1/core/block_pool.py +281 -0
- vllm/v1/core/encoder_cache_manager.py +149 -0
- vllm/v1/core/kv_cache_manager.py +385 -0
- vllm/v1/core/kv_cache_utils.py +744 -0
- vllm/v1/core/sched/__init__.py +0 -0
- vllm/v1/core/sched/interface.py +134 -0
- vllm/v1/core/sched/output.py +126 -0
- vllm/v1/core/sched/scheduler.py +838 -0
- vllm/v1/core/sched/utils.py +22 -0
- vllm/v1/core/specialized_manager.py +161 -0
- vllm/v1/engine/__init__.py +166 -0
- vllm/v1/engine/async_llm.py +532 -0
- vllm/v1/engine/core.py +701 -0
- vllm/v1/engine/core_client.py +942 -0
- vllm/v1/engine/detokenizer.py +260 -0
- vllm/v1/engine/exceptions.py +16 -0
- vllm/v1/engine/llm_engine.py +285 -0
- vllm/v1/engine/logprobs.py +198 -0
- vllm/v1/engine/mm_input_cache.py +82 -0
- vllm/v1/engine/output_processor.py +420 -0
- vllm/v1/engine/parallel_sampling.py +132 -0
- vllm/v1/engine/processor.py +387 -0
- vllm/v1/executor/__init__.py +0 -0
- vllm/v1/executor/abstract.py +112 -0
- vllm/v1/executor/multiproc_executor.py +480 -0
- vllm/v1/executor/ray_distributed_executor.py +61 -0
- vllm/v1/kv_cache_interface.py +166 -0
- vllm/v1/metrics/__init__.py +0 -0
- vllm/v1/metrics/loggers.py +498 -0
- vllm/v1/metrics/stats.py +238 -0
- vllm/v1/outputs.py +111 -0
- vllm/v1/request.py +178 -0
- vllm/v1/sample/__init__.py +0 -0
- vllm/v1/sample/metadata.py +43 -0
- vllm/v1/sample/ops/__init__.py +0 -0
- vllm/v1/sample/ops/bad_words.py +38 -0
- vllm/v1/sample/ops/penalties.py +58 -0
- vllm/v1/sample/ops/topk_topp_sampler.py +315 -0
- vllm/v1/sample/rejection_sampler.py +631 -0
- vllm/v1/sample/sampler.py +270 -0
- vllm/v1/sample/tpu/__init__.py +0 -0
- vllm/v1/sample/tpu/metadata.py +118 -0
- vllm/v1/sample/tpu/sampler.py +154 -0
- vllm/v1/serial_utils.py +274 -0
- vllm/v1/spec_decode/__init__.py +0 -0
- vllm/v1/spec_decode/eagle.py +318 -0
- vllm/v1/spec_decode/metadata.py +61 -0
- vllm/v1/spec_decode/metrics.py +164 -0
- vllm/v1/spec_decode/ngram_proposer.py +131 -0
- vllm/v1/spec_decode/utils.py +18 -0
- vllm/v1/stats/__init__.py +0 -0
- vllm/v1/stats/common.py +453 -0
- vllm/v1/structured_output/__init__.py +113 -0
- vllm/v1/structured_output/backend_guidance.py +215 -0
- vllm/v1/structured_output/backend_types.py +96 -0
- vllm/v1/structured_output/backend_xgrammar.py +299 -0
- vllm/v1/structured_output/request.py +84 -0
- vllm/v1/structured_output/utils.py +174 -0
- vllm/v1/utils.py +249 -0
- vllm/v1/worker/__init__.py +0 -0
- vllm/v1/worker/block_table.py +87 -0
- vllm/v1/worker/gpu_input_batch.py +677 -0
- vllm/v1/worker/gpu_model_runner.py +1776 -0
- vllm/v1/worker/gpu_worker.py +349 -0
- vllm/v1/worker/lora_model_runner_mixin.py +145 -0
- vllm/v1/worker/tpu_model_runner.py +1419 -0
- vllm/v1/worker/tpu_worker.py +260 -0
- vllm/v1/worker/utils.py +74 -0
- vllm/v1/worker/worker_base.py +64 -0
- vllm/version.py +40 -0
- vllm/vllm_flash_attn/.gitkeep +0 -0
- vllm/worker/__init__.py +0 -0
- vllm/worker/cache_engine.py +144 -0
- vllm/worker/cpu_enc_dec_model_runner.py +323 -0
- vllm/worker/cpu_model_runner.py +668 -0
- vllm/worker/cpu_pooling_model_runner.py +122 -0
- vllm/worker/cpu_worker.py +400 -0
- vllm/worker/enc_dec_model_runner.py +542 -0
- vllm/worker/hpu_model_runner.py +2221 -0
- vllm/worker/hpu_worker.py +483 -0
- vllm/worker/model_runner.py +2056 -0
- vllm/worker/model_runner_base.py +281 -0
- vllm/worker/multi_step_hpu_worker.py +122 -0
- vllm/worker/multi_step_model_runner.py +908 -0
- vllm/worker/multi_step_tpu_worker.py +107 -0
- vllm/worker/multi_step_worker.py +196 -0
- vllm/worker/neuron_model_runner.py +336 -0
- vllm/worker/neuron_worker.py +138 -0
- vllm/worker/pooling_model_runner.py +200 -0
- vllm/worker/tpu_model_runner.py +908 -0
- vllm/worker/tpu_worker.py +332 -0
- vllm/worker/utils.py +52 -0
- vllm/worker/worker.py +570 -0
- vllm/worker/worker_base.py +644 -0
- vllm/worker/xpu_model_runner.py +603 -0
- vllm/worker/xpu_worker.py +185 -0
- vllm_cpu-0.8.5.post2.dist-info/METADATA +309 -0
- vllm_cpu-0.8.5.post2.dist-info/RECORD +1103 -0
- vllm_cpu-0.8.5.post2.dist-info/WHEEL +5 -0
- vllm_cpu-0.8.5.post2.dist-info/entry_points.txt +2 -0
- vllm_cpu-0.8.5.post2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1210 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
import json
|
|
5
|
+
import re
|
|
6
|
+
import time
|
|
7
|
+
from collections.abc import AsyncGenerator, AsyncIterator
|
|
8
|
+
from collections.abc import Sequence as GenericSequence
|
|
9
|
+
from typing import Callable, Final, Optional, Union
|
|
10
|
+
|
|
11
|
+
import jinja2
|
|
12
|
+
import partial_json_parser
|
|
13
|
+
from fastapi import Request
|
|
14
|
+
from pydantic import TypeAdapter
|
|
15
|
+
|
|
16
|
+
from vllm.config import ModelConfig
|
|
17
|
+
from vllm.engine.protocol import EngineClient
|
|
18
|
+
from vllm.entrypoints.chat_utils import (ChatTemplateContentFormatOption,
|
|
19
|
+
ConversationMessage)
|
|
20
|
+
from vllm.entrypoints.logger import RequestLogger
|
|
21
|
+
from vllm.entrypoints.openai.protocol import (
|
|
22
|
+
ChatCompletionLogProb, ChatCompletionLogProbs,
|
|
23
|
+
ChatCompletionLogProbsContent, ChatCompletionNamedToolChoiceParam,
|
|
24
|
+
ChatCompletionRequest, ChatCompletionResponse,
|
|
25
|
+
ChatCompletionResponseChoice, ChatCompletionResponseStreamChoice,
|
|
26
|
+
ChatCompletionStreamResponse, ChatMessage, DeltaFunctionCall, DeltaMessage,
|
|
27
|
+
DeltaToolCall, ErrorResponse, FunctionCall, FunctionDefinition,
|
|
28
|
+
PromptTokenUsageInfo, RequestResponseMetadata, ToolCall, UsageInfo)
|
|
29
|
+
from vllm.entrypoints.openai.serving_engine import (OpenAIServing,
|
|
30
|
+
clamp_prompt_logprobs)
|
|
31
|
+
from vllm.entrypoints.openai.serving_models import OpenAIServingModels
|
|
32
|
+
from vllm.entrypoints.openai.tool_parsers import ToolParser, ToolParserManager
|
|
33
|
+
from vllm.entrypoints.openai.tool_parsers.mistral_tool_parser import (
|
|
34
|
+
MistralToolCall)
|
|
35
|
+
from vllm.logger import init_logger
|
|
36
|
+
from vllm.outputs import CompletionOutput, RequestOutput
|
|
37
|
+
from vllm.reasoning import ReasoningParser, ReasoningParserManager
|
|
38
|
+
from vllm.sampling_params import BeamSearchParams, SamplingParams
|
|
39
|
+
from vllm.sequence import Logprob
|
|
40
|
+
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
|
|
41
|
+
from vllm.transformers_utils.tokenizers import (maybe_serialize_tool_calls,
|
|
42
|
+
truncate_tool_call_ids,
|
|
43
|
+
validate_request_params)
|
|
44
|
+
|
|
45
|
+
logger = init_logger(__name__)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class OpenAIServingChat(OpenAIServing):
|
|
49
|
+
|
|
50
|
+
def __init__(
|
|
51
|
+
self,
|
|
52
|
+
engine_client: EngineClient,
|
|
53
|
+
model_config: ModelConfig,
|
|
54
|
+
models: OpenAIServingModels,
|
|
55
|
+
response_role: str,
|
|
56
|
+
*,
|
|
57
|
+
request_logger: Optional[RequestLogger],
|
|
58
|
+
chat_template: Optional[str],
|
|
59
|
+
chat_template_content_format: ChatTemplateContentFormatOption,
|
|
60
|
+
return_tokens_as_token_ids: bool = False,
|
|
61
|
+
enable_reasoning: bool = False,
|
|
62
|
+
reasoning_parser: Optional[str] = None,
|
|
63
|
+
enable_auto_tools: bool = False,
|
|
64
|
+
tool_parser: Optional[str] = None,
|
|
65
|
+
enable_prompt_tokens_details: bool = False,
|
|
66
|
+
) -> None:
|
|
67
|
+
super().__init__(engine_client=engine_client,
|
|
68
|
+
model_config=model_config,
|
|
69
|
+
models=models,
|
|
70
|
+
request_logger=request_logger,
|
|
71
|
+
return_tokens_as_token_ids=return_tokens_as_token_ids)
|
|
72
|
+
|
|
73
|
+
self.response_role = response_role
|
|
74
|
+
self.chat_template = chat_template
|
|
75
|
+
self.chat_template_content_format: Final = chat_template_content_format
|
|
76
|
+
|
|
77
|
+
# set up tool use
|
|
78
|
+
self.enable_auto_tools: bool = enable_auto_tools
|
|
79
|
+
if self.enable_auto_tools:
|
|
80
|
+
logger.info(
|
|
81
|
+
"\"auto\" tool choice has been enabled please note that while"
|
|
82
|
+
" the parallel_tool_calls client option is preset for "
|
|
83
|
+
"compatibility reasons, it will be ignored.")
|
|
84
|
+
|
|
85
|
+
self.enable_reasoning: bool = enable_reasoning
|
|
86
|
+
self.reasoning_parser: Optional[Callable[[AnyTokenizer],
|
|
87
|
+
ReasoningParser]] = None
|
|
88
|
+
if self.enable_reasoning:
|
|
89
|
+
try:
|
|
90
|
+
self.reasoning_parser = (
|
|
91
|
+
ReasoningParserManager.get_reasoning_parser(
|
|
92
|
+
reasoning_parser))
|
|
93
|
+
except Exception as e:
|
|
94
|
+
raise TypeError("Error: --enable-reasoning requires "
|
|
95
|
+
f"reasoning_parser:'{reasoning_parser}' "
|
|
96
|
+
"which has not been registered") from e
|
|
97
|
+
self.tool_parser: Optional[Callable[[AnyTokenizer], ToolParser]] = None
|
|
98
|
+
if self.enable_auto_tools:
|
|
99
|
+
try:
|
|
100
|
+
if (tool_parser == "pythonic" and
|
|
101
|
+
model_config.model.startswith("meta-llama/Llama-3.2")):
|
|
102
|
+
logger.warning(
|
|
103
|
+
"Llama3.2 models may struggle to emit valid pythonic"
|
|
104
|
+
" tool calls")
|
|
105
|
+
self.tool_parser = ToolParserManager.get_tool_parser(
|
|
106
|
+
tool_parser)
|
|
107
|
+
except Exception as e:
|
|
108
|
+
raise TypeError("Error: --enable-auto-tool-choice requires "
|
|
109
|
+
f"tool_parser:'{tool_parser}' which has not "
|
|
110
|
+
"been registered") from e
|
|
111
|
+
|
|
112
|
+
self.enable_prompt_tokens_details = enable_prompt_tokens_details
|
|
113
|
+
self.default_sampling_params = (
|
|
114
|
+
self.model_config.get_diff_sampling_param())
|
|
115
|
+
if self.default_sampling_params:
|
|
116
|
+
source = self.model_config.generation_config
|
|
117
|
+
source = "model" if source == "auto" else source
|
|
118
|
+
logger.info("Using default chat sampling params from %s: %s",
|
|
119
|
+
source, self.default_sampling_params)
|
|
120
|
+
|
|
121
|
+
async def create_chat_completion(
|
|
122
|
+
self,
|
|
123
|
+
request: ChatCompletionRequest,
|
|
124
|
+
raw_request: Optional[Request] = None,
|
|
125
|
+
) -> Union[AsyncGenerator[str, None], ChatCompletionResponse,
|
|
126
|
+
ErrorResponse]:
|
|
127
|
+
"""
|
|
128
|
+
Chat Completion API similar to OpenAI's API.
|
|
129
|
+
|
|
130
|
+
See https://platform.openai.com/docs/api-reference/chat/create
|
|
131
|
+
for the API specification. This API mimics the OpenAI
|
|
132
|
+
Chat Completion API.
|
|
133
|
+
"""
|
|
134
|
+
error_check_ret = await self._check_model(request)
|
|
135
|
+
if error_check_ret is not None:
|
|
136
|
+
logger.error("Error with model %s", error_check_ret)
|
|
137
|
+
return error_check_ret
|
|
138
|
+
|
|
139
|
+
# If the engine is dead, raise the engine's DEAD_ERROR.
|
|
140
|
+
# This is required for the streaming case, where we return a
|
|
141
|
+
# success status before we actually start generating text :).
|
|
142
|
+
if self.engine_client.errored:
|
|
143
|
+
raise self.engine_client.dead_error
|
|
144
|
+
|
|
145
|
+
try:
|
|
146
|
+
(
|
|
147
|
+
lora_request,
|
|
148
|
+
prompt_adapter_request,
|
|
149
|
+
) = self._maybe_get_adapters(request)
|
|
150
|
+
|
|
151
|
+
model_name = self._get_model_name(request.model, lora_request)
|
|
152
|
+
|
|
153
|
+
tokenizer = await self.engine_client.get_tokenizer(lora_request)
|
|
154
|
+
|
|
155
|
+
tool_parser = self.tool_parser
|
|
156
|
+
|
|
157
|
+
if isinstance(tokenizer, MistralTokenizer):
|
|
158
|
+
# because of issues with pydantic we need to potentially
|
|
159
|
+
# re-serialize the tool_calls field of the request
|
|
160
|
+
# for more info: see comment in `maybe_serialize_tool_calls`
|
|
161
|
+
maybe_serialize_tool_calls(request)
|
|
162
|
+
truncate_tool_call_ids(request)
|
|
163
|
+
validate_request_params(request)
|
|
164
|
+
|
|
165
|
+
if (request.tool_choice == "auto" and
|
|
166
|
+
not (self.enable_auto_tools and tool_parser is not None)
|
|
167
|
+
and not isinstance(tokenizer, MistralTokenizer)):
|
|
168
|
+
# for hf tokenizers, "auto" tools requires
|
|
169
|
+
# --enable-auto-tool-choice and --tool-call-parser
|
|
170
|
+
return self.create_error_response(
|
|
171
|
+
"\"auto\" tool choice requires "
|
|
172
|
+
"--enable-auto-tool-choice and --tool-call-parser to be set"
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
tool_dicts = None if request.tools is None else [
|
|
176
|
+
tool.model_dump() for tool in request.tools
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
(
|
|
180
|
+
conversation,
|
|
181
|
+
request_prompts,
|
|
182
|
+
engine_prompts,
|
|
183
|
+
) = await self._preprocess_chat(
|
|
184
|
+
request,
|
|
185
|
+
tokenizer,
|
|
186
|
+
request.messages,
|
|
187
|
+
chat_template=request.chat_template or self.chat_template,
|
|
188
|
+
chat_template_content_format=self.chat_template_content_format,
|
|
189
|
+
add_generation_prompt=request.add_generation_prompt,
|
|
190
|
+
continue_final_message=request.continue_final_message,
|
|
191
|
+
tool_dicts=tool_dicts,
|
|
192
|
+
documents=request.documents,
|
|
193
|
+
chat_template_kwargs=request.chat_template_kwargs,
|
|
194
|
+
tool_parser=tool_parser,
|
|
195
|
+
truncate_prompt_tokens=request.truncate_prompt_tokens,
|
|
196
|
+
add_special_tokens=request.add_special_tokens,
|
|
197
|
+
)
|
|
198
|
+
except (ValueError, TypeError, RuntimeError,
|
|
199
|
+
jinja2.TemplateError) as e:
|
|
200
|
+
logger.exception("Error in preprocessing prompt inputs")
|
|
201
|
+
return self.create_error_response(str(e))
|
|
202
|
+
|
|
203
|
+
request_id = "chatcmpl-" \
|
|
204
|
+
f"{self._base_request_id(raw_request, request.request_id)}"
|
|
205
|
+
|
|
206
|
+
request_metadata = RequestResponseMetadata(request_id=request_id)
|
|
207
|
+
if raw_request:
|
|
208
|
+
raw_request.state.request_metadata = request_metadata
|
|
209
|
+
|
|
210
|
+
# Schedule the request and get the result generator.
|
|
211
|
+
generators: list[AsyncGenerator[RequestOutput, None]] = []
|
|
212
|
+
try:
|
|
213
|
+
for i, engine_prompt in enumerate(engine_prompts):
|
|
214
|
+
sampling_params: Union[SamplingParams, BeamSearchParams]
|
|
215
|
+
default_max_tokens = self.max_model_len - len(
|
|
216
|
+
engine_prompt["prompt_token_ids"])
|
|
217
|
+
if request.use_beam_search:
|
|
218
|
+
sampling_params = request.to_beam_search_params(
|
|
219
|
+
default_max_tokens, self.default_sampling_params)
|
|
220
|
+
else:
|
|
221
|
+
sampling_params = request.to_sampling_params(
|
|
222
|
+
default_max_tokens,
|
|
223
|
+
self.model_config.logits_processor_pattern,
|
|
224
|
+
self.default_sampling_params)
|
|
225
|
+
|
|
226
|
+
self._log_inputs(request_id,
|
|
227
|
+
request_prompts[i],
|
|
228
|
+
params=sampling_params,
|
|
229
|
+
lora_request=lora_request,
|
|
230
|
+
prompt_adapter_request=prompt_adapter_request)
|
|
231
|
+
|
|
232
|
+
trace_headers = (None if raw_request is None else await
|
|
233
|
+
self._get_trace_headers(raw_request.headers))
|
|
234
|
+
|
|
235
|
+
if isinstance(sampling_params, BeamSearchParams):
|
|
236
|
+
generator = self.engine_client.beam_search(
|
|
237
|
+
prompt=engine_prompt,
|
|
238
|
+
request_id=request_id,
|
|
239
|
+
params=sampling_params,
|
|
240
|
+
)
|
|
241
|
+
else:
|
|
242
|
+
generator = self.engine_client.generate(
|
|
243
|
+
engine_prompt,
|
|
244
|
+
sampling_params,
|
|
245
|
+
request_id,
|
|
246
|
+
lora_request=lora_request,
|
|
247
|
+
trace_headers=trace_headers,
|
|
248
|
+
prompt_adapter_request=prompt_adapter_request,
|
|
249
|
+
priority=request.priority,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
generators.append(generator)
|
|
253
|
+
except ValueError as e:
|
|
254
|
+
# TODO: Use a vllm-specific Validation Error
|
|
255
|
+
return self.create_error_response(str(e))
|
|
256
|
+
|
|
257
|
+
assert len(generators) == 1
|
|
258
|
+
result_generator, = generators
|
|
259
|
+
|
|
260
|
+
# Streaming response
|
|
261
|
+
if request.stream:
|
|
262
|
+
return self.chat_completion_stream_generator(
|
|
263
|
+
request, result_generator, request_id, model_name,
|
|
264
|
+
conversation, tokenizer, request_metadata)
|
|
265
|
+
|
|
266
|
+
try:
|
|
267
|
+
return await self.chat_completion_full_generator(
|
|
268
|
+
request, result_generator, request_id, model_name,
|
|
269
|
+
conversation, tokenizer, request_metadata)
|
|
270
|
+
except ValueError as e:
|
|
271
|
+
# TODO: Use a vllm-specific Validation Error
|
|
272
|
+
return self.create_error_response(str(e))
|
|
273
|
+
|
|
274
|
+
def get_chat_request_role(self, request: ChatCompletionRequest) -> str:
|
|
275
|
+
if request.add_generation_prompt:
|
|
276
|
+
return self.response_role
|
|
277
|
+
return request.messages[-1]["role"]
|
|
278
|
+
|
|
279
|
+
@staticmethod
|
|
280
|
+
def _bracket_level(s: str, opening='{', closing='}') -> int:
|
|
281
|
+
"""
|
|
282
|
+
Calculate the current level of nested brackets in a given string.
|
|
283
|
+
"""
|
|
284
|
+
level = 0
|
|
285
|
+
for char in s:
|
|
286
|
+
if char == opening:
|
|
287
|
+
level += 1
|
|
288
|
+
elif char == closing:
|
|
289
|
+
level -= 1
|
|
290
|
+
return level
|
|
291
|
+
|
|
292
|
+
@staticmethod
|
|
293
|
+
def _filter_delta_text(delta_text: str,
|
|
294
|
+
previous_text: str) -> tuple[str, bool]:
|
|
295
|
+
# remove last '},' of the tool definition stemming from the
|
|
296
|
+
# "name"/"parameters" outer object or closing ']' of the tool list
|
|
297
|
+
# count occurrences of opening and closing curly braces and
|
|
298
|
+
# once level 0 is reached stop outputting text
|
|
299
|
+
# if 0 is reached while parsing the delta_text we know the current
|
|
300
|
+
# tool will finish in this current iteration
|
|
301
|
+
bracket_level = OpenAIServingChat._bracket_level(previous_text)
|
|
302
|
+
updated_delta, passed_zero = "", False
|
|
303
|
+
for c in delta_text:
|
|
304
|
+
if c == '{':
|
|
305
|
+
bracket_level += 1
|
|
306
|
+
passed_zero = bracket_level == 0
|
|
307
|
+
elif c == '}':
|
|
308
|
+
bracket_level -= 1
|
|
309
|
+
passed_zero = bracket_level == 0
|
|
310
|
+
|
|
311
|
+
if bracket_level != 0:
|
|
312
|
+
updated_delta += c
|
|
313
|
+
else:
|
|
314
|
+
# if a comma is reached at level 0 we can stop
|
|
315
|
+
if c == ',':
|
|
316
|
+
break
|
|
317
|
+
return updated_delta, passed_zero
|
|
318
|
+
|
|
319
|
+
def extract_tool_call_required_streaming(
|
|
320
|
+
self,
|
|
321
|
+
previous_text: str,
|
|
322
|
+
current_text: str,
|
|
323
|
+
delta_text: str,
|
|
324
|
+
function_name_returned: bool,
|
|
325
|
+
) -> tuple[Optional[DeltaMessage], bool]:
|
|
326
|
+
try:
|
|
327
|
+
obj = partial_json_parser.loads(current_text)
|
|
328
|
+
except partial_json_parser.core.exceptions.MalformedJSON:
|
|
329
|
+
logger.debug('not enough tokens to parse into JSON yet')
|
|
330
|
+
obj = None
|
|
331
|
+
|
|
332
|
+
# check if the current text is a valid array
|
|
333
|
+
# containing a partial tool calling object
|
|
334
|
+
# if not repeat
|
|
335
|
+
if obj is None or not isinstance(obj, list) or not len(obj) > 0:
|
|
336
|
+
function_name_returned = False
|
|
337
|
+
delta_message = None
|
|
338
|
+
else:
|
|
339
|
+
_, finishes_previous_tool = OpenAIServingChat._filter_delta_text(
|
|
340
|
+
delta_text, previous_text)
|
|
341
|
+
# take the last tool call from the generated list
|
|
342
|
+
current_tool_call = obj[-1]
|
|
343
|
+
|
|
344
|
+
# once parameters have been generated the name is complete as well
|
|
345
|
+
if not finishes_previous_tool and ("name" not in current_tool_call
|
|
346
|
+
or "parameters"
|
|
347
|
+
not in current_tool_call):
|
|
348
|
+
function_name_returned = False
|
|
349
|
+
delta_message = None
|
|
350
|
+
else:
|
|
351
|
+
if not function_name_returned:
|
|
352
|
+
# get partly generated arguments from the latest tool call
|
|
353
|
+
param_match = re.search(r'.*"parameters":\s*(.*)',
|
|
354
|
+
current_text)
|
|
355
|
+
arguments = param_match.group(1) if param_match else ""
|
|
356
|
+
arguments, _ = OpenAIServingChat._filter_delta_text(
|
|
357
|
+
arguments, previous_text)
|
|
358
|
+
|
|
359
|
+
# if this iteration finishes a previous tool call but a
|
|
360
|
+
# new incomplete tool is already generated, take the
|
|
361
|
+
# previous from the list
|
|
362
|
+
if (finishes_previous_tool
|
|
363
|
+
and "parameters" not in current_tool_call):
|
|
364
|
+
current_tool_call = obj[-2]
|
|
365
|
+
|
|
366
|
+
function_name_returned = True
|
|
367
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
368
|
+
DeltaToolCall(function=DeltaFunctionCall(
|
|
369
|
+
name=current_tool_call["name"],
|
|
370
|
+
arguments=arguments),
|
|
371
|
+
index=len(obj) - 1,
|
|
372
|
+
type="function")
|
|
373
|
+
])
|
|
374
|
+
|
|
375
|
+
else:
|
|
376
|
+
delta_text, _ = OpenAIServingChat._filter_delta_text(
|
|
377
|
+
delta_text, previous_text)
|
|
378
|
+
|
|
379
|
+
if delta_text != "":
|
|
380
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
381
|
+
DeltaToolCall(
|
|
382
|
+
function=DeltaFunctionCall(
|
|
383
|
+
# OpenAI API returns None
|
|
384
|
+
# instead of name every time
|
|
385
|
+
name=None,
|
|
386
|
+
arguments=delta_text),
|
|
387
|
+
index=len(obj) - 1,
|
|
388
|
+
type="function")
|
|
389
|
+
])
|
|
390
|
+
else:
|
|
391
|
+
delta_message = None
|
|
392
|
+
|
|
393
|
+
return delta_message, function_name_returned
|
|
394
|
+
|
|
395
|
+
async def chat_completion_stream_generator(
|
|
396
|
+
self,
|
|
397
|
+
request: ChatCompletionRequest,
|
|
398
|
+
result_generator: AsyncIterator[RequestOutput],
|
|
399
|
+
request_id: str,
|
|
400
|
+
model_name: str,
|
|
401
|
+
conversation: list[ConversationMessage],
|
|
402
|
+
tokenizer: AnyTokenizer,
|
|
403
|
+
request_metadata: RequestResponseMetadata,
|
|
404
|
+
) -> AsyncGenerator[str, None]:
|
|
405
|
+
created_time = int(time.time())
|
|
406
|
+
chunk_object_type: Final = "chat.completion.chunk"
|
|
407
|
+
first_iteration = True
|
|
408
|
+
|
|
409
|
+
# Send response for each token for each request.n (index)
|
|
410
|
+
num_choices = 1 if request.n is None else request.n
|
|
411
|
+
previous_num_tokens = [0] * num_choices
|
|
412
|
+
finish_reason_sent = [False] * num_choices
|
|
413
|
+
num_prompt_tokens = 0
|
|
414
|
+
num_cached_tokens = None
|
|
415
|
+
|
|
416
|
+
if isinstance(request.tool_choice, ChatCompletionNamedToolChoiceParam):
|
|
417
|
+
tool_choice_function_name = request.tool_choice.function.name
|
|
418
|
+
else:
|
|
419
|
+
tool_choice_function_name = None
|
|
420
|
+
|
|
421
|
+
# Determine whether tools are in use with "auto" tool choice
|
|
422
|
+
tool_choice_auto = (
|
|
423
|
+
not tool_choice_function_name
|
|
424
|
+
and self._should_stream_with_auto_tool_parsing(request))
|
|
425
|
+
|
|
426
|
+
should_stream_with_reasoning_parsing = (
|
|
427
|
+
self._should_stream_with_reasoning_parsing(request))
|
|
428
|
+
|
|
429
|
+
all_previous_token_ids: Optional[list[list[int]]]
|
|
430
|
+
function_name_returned: Optional[list[bool]] = None
|
|
431
|
+
|
|
432
|
+
# Only one of these will be used, thus previous_texts and
|
|
433
|
+
# all_previous_token_ids will not be used twice in the same iteration.
|
|
434
|
+
if tool_choice_auto or should_stream_with_reasoning_parsing:
|
|
435
|
+
# These are only required in "auto" tool choice case
|
|
436
|
+
previous_texts = [""] * num_choices
|
|
437
|
+
all_previous_token_ids = [[]] * num_choices
|
|
438
|
+
# For reasoning parser and tool call all enabled
|
|
439
|
+
added_content_delta_arr = [False] * num_choices
|
|
440
|
+
reasoning_end_arr = [False] * num_choices
|
|
441
|
+
elif request.tool_choice == "required":
|
|
442
|
+
previous_texts = [""] * num_choices
|
|
443
|
+
function_name_returned = [False] * num_choices
|
|
444
|
+
all_previous_token_ids = None
|
|
445
|
+
else:
|
|
446
|
+
previous_texts, all_previous_token_ids = None, None
|
|
447
|
+
|
|
448
|
+
try:
|
|
449
|
+
# There is no need to check if the reasoning_parser is None
|
|
450
|
+
# because the should_stream_with_reasoning_parsing check
|
|
451
|
+
# already ensures that the reasoning_parser is not None.
|
|
452
|
+
# but the pre-commit hook requires it.
|
|
453
|
+
if should_stream_with_reasoning_parsing and \
|
|
454
|
+
self.reasoning_parser is not None:
|
|
455
|
+
reasoning_parser = self.reasoning_parser(tokenizer)
|
|
456
|
+
except RuntimeError as e:
|
|
457
|
+
logger.exception("Error in reasoning parser creation.")
|
|
458
|
+
data = self.create_streaming_error_response(str(e))
|
|
459
|
+
yield f"data: {data}\n\n"
|
|
460
|
+
yield "data: [DONE]\n\n"
|
|
461
|
+
return
|
|
462
|
+
|
|
463
|
+
# Prepare the tool parser if it's needed
|
|
464
|
+
try:
|
|
465
|
+
if tool_choice_auto and self.tool_parser:
|
|
466
|
+
tool_parsers: list[Optional[ToolParser]] = [
|
|
467
|
+
self.tool_parser(tokenizer)
|
|
468
|
+
] * num_choices
|
|
469
|
+
else:
|
|
470
|
+
tool_parsers = [None] * num_choices
|
|
471
|
+
except Exception as e:
|
|
472
|
+
logger.exception("Error in tool parser creation.")
|
|
473
|
+
data = self.create_streaming_error_response(str(e))
|
|
474
|
+
yield f"data: {data}\n\n"
|
|
475
|
+
yield "data: [DONE]\n\n"
|
|
476
|
+
return
|
|
477
|
+
|
|
478
|
+
stream_options = request.stream_options
|
|
479
|
+
if stream_options:
|
|
480
|
+
include_usage = stream_options.include_usage
|
|
481
|
+
include_continuous_usage = include_usage and \
|
|
482
|
+
stream_options.continuous_usage_stats
|
|
483
|
+
else:
|
|
484
|
+
include_usage, include_continuous_usage = False, False
|
|
485
|
+
|
|
486
|
+
try:
|
|
487
|
+
async for res in result_generator:
|
|
488
|
+
if res.prompt_token_ids is not None:
|
|
489
|
+
num_prompt_tokens = len(res.prompt_token_ids)
|
|
490
|
+
if res.encoder_prompt_token_ids is not None:
|
|
491
|
+
num_prompt_tokens += len(res.encoder_prompt_token_ids)
|
|
492
|
+
|
|
493
|
+
# We need to do it here, because if there are exceptions in
|
|
494
|
+
# the result_generator, it needs to be sent as the FIRST
|
|
495
|
+
# response (by the try...catch).
|
|
496
|
+
if first_iteration:
|
|
497
|
+
num_cached_tokens = res.num_cached_tokens
|
|
498
|
+
# Send first response for each request.n (index) with
|
|
499
|
+
# the role
|
|
500
|
+
role = self.get_chat_request_role(request)
|
|
501
|
+
|
|
502
|
+
# NOTE num_choices defaults to 1 so this usually executes
|
|
503
|
+
# once per request
|
|
504
|
+
for i in range(num_choices):
|
|
505
|
+
choice_data = ChatCompletionResponseStreamChoice(
|
|
506
|
+
index=i,
|
|
507
|
+
delta=DeltaMessage(
|
|
508
|
+
role=role,
|
|
509
|
+
content="",
|
|
510
|
+
),
|
|
511
|
+
logprobs=None,
|
|
512
|
+
finish_reason=None)
|
|
513
|
+
chunk = ChatCompletionStreamResponse(
|
|
514
|
+
id=request_id,
|
|
515
|
+
object=chunk_object_type,
|
|
516
|
+
created=created_time,
|
|
517
|
+
choices=[choice_data],
|
|
518
|
+
model=model_name)
|
|
519
|
+
|
|
520
|
+
# if continuous usage stats are requested, add it
|
|
521
|
+
if include_continuous_usage:
|
|
522
|
+
chunk.usage = UsageInfo(
|
|
523
|
+
prompt_tokens=num_prompt_tokens,
|
|
524
|
+
completion_tokens=0,
|
|
525
|
+
total_tokens=num_prompt_tokens)
|
|
526
|
+
|
|
527
|
+
data = chunk.model_dump_json(exclude_unset=True)
|
|
528
|
+
yield f"data: {data}\n\n"
|
|
529
|
+
|
|
530
|
+
# Send response to echo the input portion of the
|
|
531
|
+
# last message
|
|
532
|
+
if request.echo:
|
|
533
|
+
last_msg_content: Union[str, list[dict[str, str]]] = ""
|
|
534
|
+
if conversation and "content" in conversation[
|
|
535
|
+
-1] and conversation[-1].get("role") == role:
|
|
536
|
+
last_msg_content = conversation[-1]["content"] or ""
|
|
537
|
+
|
|
538
|
+
if last_msg_content:
|
|
539
|
+
for i in range(num_choices):
|
|
540
|
+
choice_data = (
|
|
541
|
+
ChatCompletionResponseStreamChoice(
|
|
542
|
+
index=i,
|
|
543
|
+
delta=DeltaMessage(
|
|
544
|
+
content=last_msg_content),
|
|
545
|
+
logprobs=None,
|
|
546
|
+
finish_reason=None))
|
|
547
|
+
chunk = ChatCompletionStreamResponse(
|
|
548
|
+
id=request_id,
|
|
549
|
+
object=chunk_object_type,
|
|
550
|
+
created=created_time,
|
|
551
|
+
choices=[choice_data],
|
|
552
|
+
model=model_name)
|
|
553
|
+
if include_continuous_usage:
|
|
554
|
+
chunk.usage = UsageInfo(
|
|
555
|
+
prompt_tokens=num_prompt_tokens,
|
|
556
|
+
completion_tokens=0,
|
|
557
|
+
total_tokens=num_prompt_tokens)
|
|
558
|
+
|
|
559
|
+
data = chunk.model_dump_json(
|
|
560
|
+
exclude_unset=True)
|
|
561
|
+
yield f"data: {data}\n\n"
|
|
562
|
+
first_iteration = False
|
|
563
|
+
|
|
564
|
+
for output in res.outputs:
|
|
565
|
+
i = output.index
|
|
566
|
+
tool_parser = tool_parsers[i]
|
|
567
|
+
|
|
568
|
+
if finish_reason_sent[i]:
|
|
569
|
+
continue
|
|
570
|
+
|
|
571
|
+
if request.logprobs and request.top_logprobs is not None:
|
|
572
|
+
assert output.logprobs is not None, (
|
|
573
|
+
"Did not output logprobs")
|
|
574
|
+
logprobs = self._create_chat_logprobs(
|
|
575
|
+
token_ids=output.token_ids,
|
|
576
|
+
top_logprobs=output.logprobs,
|
|
577
|
+
tokenizer=tokenizer,
|
|
578
|
+
num_output_top_logprobs=request.top_logprobs,
|
|
579
|
+
return_as_token_id=request.
|
|
580
|
+
return_tokens_as_token_ids,
|
|
581
|
+
)
|
|
582
|
+
else:
|
|
583
|
+
logprobs = None
|
|
584
|
+
|
|
585
|
+
delta_text = output.text
|
|
586
|
+
|
|
587
|
+
if not delta_text and not output.token_ids and \
|
|
588
|
+
not previous_num_tokens[i]:
|
|
589
|
+
# Chunked prefill case, don't return empty chunks
|
|
590
|
+
continue
|
|
591
|
+
|
|
592
|
+
delta_message: Optional[DeltaMessage]
|
|
593
|
+
|
|
594
|
+
# just update previous_texts and previous_token_ids
|
|
595
|
+
if tool_choice_auto or should_stream_with_reasoning_parsing:
|
|
596
|
+
assert previous_texts is not None
|
|
597
|
+
assert all_previous_token_ids is not None
|
|
598
|
+
previous_text = previous_texts[i]
|
|
599
|
+
previous_token_ids = all_previous_token_ids[i]
|
|
600
|
+
current_text = previous_text + delta_text
|
|
601
|
+
current_token_ids = previous_token_ids + list(
|
|
602
|
+
output.token_ids)
|
|
603
|
+
|
|
604
|
+
# handle streaming deltas for tools with named tool_choice
|
|
605
|
+
if tool_choice_function_name:
|
|
606
|
+
if (self.enable_reasoning
|
|
607
|
+
and not reasoning_parser.is_reasoning_end(
|
|
608
|
+
previous_token_ids)):
|
|
609
|
+
assert reasoning_parser is not None
|
|
610
|
+
delta_message = (
|
|
611
|
+
reasoning_parser.
|
|
612
|
+
extract_reasoning_content_streaming(
|
|
613
|
+
previous_text,
|
|
614
|
+
current_text,
|
|
615
|
+
delta_text,
|
|
616
|
+
previous_token_ids,
|
|
617
|
+
current_token_ids,
|
|
618
|
+
output.token_ids,
|
|
619
|
+
))
|
|
620
|
+
# When encountering think end id in delta_token_ids,
|
|
621
|
+
# process the `content`. Only keep 'content',
|
|
622
|
+
# remove 'reasoning_content'
|
|
623
|
+
if reasoning_parser.is_reasoning_end(
|
|
624
|
+
list(output.token_ids)):
|
|
625
|
+
if delta_message and delta_message.content:
|
|
626
|
+
# This need to be added to next `delta_text`
|
|
627
|
+
current_text = delta_message.content
|
|
628
|
+
delta_message.content = None
|
|
629
|
+
else:
|
|
630
|
+
current_text = ""
|
|
631
|
+
else:
|
|
632
|
+
# Just to add remaining `content`
|
|
633
|
+
if self.enable_reasoning:
|
|
634
|
+
delta_text = previous_text + delta_text
|
|
635
|
+
current_text = ""
|
|
636
|
+
|
|
637
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
638
|
+
DeltaToolCall(function=DeltaFunctionCall(
|
|
639
|
+
name=tool_choice_function_name,
|
|
640
|
+
arguments=delta_text),
|
|
641
|
+
index=i)
|
|
642
|
+
])
|
|
643
|
+
|
|
644
|
+
elif request.tool_choice == "required":
|
|
645
|
+
assert previous_texts is not None
|
|
646
|
+
assert function_name_returned is not None
|
|
647
|
+
previous_text = previous_texts[i]
|
|
648
|
+
current_text = previous_text + delta_text
|
|
649
|
+
fn_name_returned = function_name_returned[i]
|
|
650
|
+
|
|
651
|
+
delta_message, function_name_returned[i] = (
|
|
652
|
+
self.extract_tool_call_required_streaming(
|
|
653
|
+
previous_text=previous_text,
|
|
654
|
+
current_text=current_text,
|
|
655
|
+
delta_text=delta_text,
|
|
656
|
+
function_name_returned=fn_name_returned))
|
|
657
|
+
|
|
658
|
+
# update the previous values for the next iteration
|
|
659
|
+
previous_texts[i] = current_text
|
|
660
|
+
|
|
661
|
+
# handle streaming deltas for tools with "auto" tool choice
|
|
662
|
+
# and reasoning parser
|
|
663
|
+
elif tool_choice_auto and self.enable_reasoning:
|
|
664
|
+
assert tool_parser is not None
|
|
665
|
+
assert reasoning_parser is not None
|
|
666
|
+
assert added_content_delta_arr is not None
|
|
667
|
+
assert reasoning_end_arr is not None
|
|
668
|
+
if not reasoning_end_arr[i]:
|
|
669
|
+
delta_message = (
|
|
670
|
+
reasoning_parser.
|
|
671
|
+
extract_reasoning_content_streaming(
|
|
672
|
+
previous_text,
|
|
673
|
+
current_text,
|
|
674
|
+
delta_text,
|
|
675
|
+
previous_token_ids,
|
|
676
|
+
current_token_ids,
|
|
677
|
+
output.token_ids,
|
|
678
|
+
))
|
|
679
|
+
|
|
680
|
+
# When encountering think end id in delta_token_ids,
|
|
681
|
+
# set reasoning status to end.
|
|
682
|
+
# Remove the text and token ids related
|
|
683
|
+
# to 'reasoning_content'.
|
|
684
|
+
if reasoning_parser.is_reasoning_end(
|
|
685
|
+
list(output.token_ids)):
|
|
686
|
+
reasoning_end_arr[i] = True
|
|
687
|
+
current_token_ids = \
|
|
688
|
+
reasoning_parser.extract_content_ids(
|
|
689
|
+
list(output.token_ids))
|
|
690
|
+
if delta_message and delta_message.content:
|
|
691
|
+
current_text = delta_message.content
|
|
692
|
+
delta_message.content = None
|
|
693
|
+
else:
|
|
694
|
+
current_text = ""
|
|
695
|
+
|
|
696
|
+
# handle tool calls only after reasoning is done,
|
|
697
|
+
else:
|
|
698
|
+
delta_token_ids = list(output.token_ids)
|
|
699
|
+
# First time to tool call,
|
|
700
|
+
# add the remaining text and token ids
|
|
701
|
+
# to delta from previous
|
|
702
|
+
if not added_content_delta_arr[i]:
|
|
703
|
+
added_content_delta_arr[i] = True
|
|
704
|
+
previous_text = ""
|
|
705
|
+
previous_token_ids = []
|
|
706
|
+
delta_text = current_text
|
|
707
|
+
delta_token_ids = current_token_ids
|
|
708
|
+
|
|
709
|
+
delta_message = (
|
|
710
|
+
tool_parser.extract_tool_calls_streaming(
|
|
711
|
+
previous_text=previous_text,
|
|
712
|
+
current_text=current_text,
|
|
713
|
+
delta_text=delta_text,
|
|
714
|
+
previous_token_ids=previous_token_ids,
|
|
715
|
+
current_token_ids=current_token_ids,
|
|
716
|
+
delta_token_ids=delta_token_ids,
|
|
717
|
+
request=request))
|
|
718
|
+
# when only tool calls
|
|
719
|
+
elif tool_choice_auto:
|
|
720
|
+
assert tool_parser is not None
|
|
721
|
+
delta_message = (
|
|
722
|
+
tool_parser.extract_tool_calls_streaming(
|
|
723
|
+
previous_text=previous_text,
|
|
724
|
+
current_text=current_text,
|
|
725
|
+
delta_text=delta_text,
|
|
726
|
+
previous_token_ids=previous_token_ids,
|
|
727
|
+
current_token_ids=current_token_ids,
|
|
728
|
+
delta_token_ids=output.token_ids,
|
|
729
|
+
request=request))
|
|
730
|
+
# when only reasoning
|
|
731
|
+
elif self.enable_reasoning:
|
|
732
|
+
assert reasoning_parser is not None
|
|
733
|
+
delta_message = (reasoning_parser.
|
|
734
|
+
extract_reasoning_content_streaming(
|
|
735
|
+
previous_text,
|
|
736
|
+
current_text,
|
|
737
|
+
delta_text,
|
|
738
|
+
previous_token_ids,
|
|
739
|
+
current_token_ids,
|
|
740
|
+
output.token_ids,
|
|
741
|
+
))
|
|
742
|
+
# handle streaming just a content delta
|
|
743
|
+
else:
|
|
744
|
+
delta_message = DeltaMessage(content=delta_text)
|
|
745
|
+
|
|
746
|
+
# update the previous values for the next iteration
|
|
747
|
+
if tool_choice_auto or should_stream_with_reasoning_parsing:
|
|
748
|
+
assert previous_texts is not None
|
|
749
|
+
assert all_previous_token_ids is not None
|
|
750
|
+
previous_texts[i] = current_text
|
|
751
|
+
all_previous_token_ids[i] = current_token_ids
|
|
752
|
+
|
|
753
|
+
# set the previous values for the next iteration
|
|
754
|
+
previous_num_tokens[i] += len(output.token_ids)
|
|
755
|
+
|
|
756
|
+
# if the message delta is None (e.g. because it was a
|
|
757
|
+
# "control token" for tool calls or the parser otherwise
|
|
758
|
+
# wasn't ready to send a token, then
|
|
759
|
+
# get the next token without streaming a chunk
|
|
760
|
+
if delta_message is None:
|
|
761
|
+
continue
|
|
762
|
+
|
|
763
|
+
if output.finish_reason is None:
|
|
764
|
+
# Send token-by-token response for each request.n
|
|
765
|
+
choice_data = ChatCompletionResponseStreamChoice(
|
|
766
|
+
index=i,
|
|
767
|
+
delta=delta_message,
|
|
768
|
+
logprobs=logprobs,
|
|
769
|
+
finish_reason=None)
|
|
770
|
+
|
|
771
|
+
# if the model is finished generating
|
|
772
|
+
else:
|
|
773
|
+
# check to make sure we haven't "forgotten" to stream
|
|
774
|
+
# any tokens that were generated but previously
|
|
775
|
+
# matched by partial json parsing
|
|
776
|
+
# only happens if we are NOT using guided decoding
|
|
777
|
+
auto_tools_called = False
|
|
778
|
+
if tool_parser:
|
|
779
|
+
auto_tools_called = len(
|
|
780
|
+
tool_parser.prev_tool_call_arr) > 0
|
|
781
|
+
index = len(tool_parser.prev_tool_call_arr
|
|
782
|
+
) - 1 if auto_tools_called else 0
|
|
783
|
+
else:
|
|
784
|
+
index = 0
|
|
785
|
+
|
|
786
|
+
if self._should_check_for_unstreamed_tool_arg_tokens(
|
|
787
|
+
delta_message, output) and tool_parser:
|
|
788
|
+
latest_delta_len = 0
|
|
789
|
+
if ((isinstance(
|
|
790
|
+
delta_message.tool_calls[0].function,
|
|
791
|
+
DeltaFunctionCall)) and isinstance(
|
|
792
|
+
delta_message.tool_calls[0].function.
|
|
793
|
+
arguments, str)):
|
|
794
|
+
latest_delta_len = len(
|
|
795
|
+
delta_message.tool_calls[0].function.
|
|
796
|
+
arguments)
|
|
797
|
+
|
|
798
|
+
# get the expected call based on partial JSON
|
|
799
|
+
# parsing which "autocompletes" the JSON
|
|
800
|
+
expected_call = json.dumps(
|
|
801
|
+
tool_parser.prev_tool_call_arr[index].get(
|
|
802
|
+
"arguments", {}),
|
|
803
|
+
ensure_ascii=False)
|
|
804
|
+
|
|
805
|
+
# get what we've streamed so far for arguments
|
|
806
|
+
# for the current tool
|
|
807
|
+
actual_call = tool_parser.streamed_args_for_tool[
|
|
808
|
+
index]
|
|
809
|
+
if (latest_delta_len > 0):
|
|
810
|
+
actual_call = actual_call[:-latest_delta_len]
|
|
811
|
+
|
|
812
|
+
# check to see if there's anything left to stream
|
|
813
|
+
remaining_call = expected_call.replace(
|
|
814
|
+
actual_call, "", 1)
|
|
815
|
+
# set that as a delta message
|
|
816
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
817
|
+
DeltaToolCall(index=index,
|
|
818
|
+
function=DeltaFunctionCall(
|
|
819
|
+
arguments=remaining_call).
|
|
820
|
+
model_dump(exclude_none=True))
|
|
821
|
+
])
|
|
822
|
+
|
|
823
|
+
# Send the finish response for each request.n only once
|
|
824
|
+
choice_data = ChatCompletionResponseStreamChoice(
|
|
825
|
+
index=i,
|
|
826
|
+
delta=delta_message,
|
|
827
|
+
logprobs=logprobs,
|
|
828
|
+
finish_reason=output.finish_reason
|
|
829
|
+
if not auto_tools_called else "tool_calls",
|
|
830
|
+
stop_reason=output.stop_reason)
|
|
831
|
+
|
|
832
|
+
finish_reason_sent[i] = True
|
|
833
|
+
|
|
834
|
+
chunk = ChatCompletionStreamResponse(
|
|
835
|
+
id=request_id,
|
|
836
|
+
object=chunk_object_type,
|
|
837
|
+
created=created_time,
|
|
838
|
+
choices=[choice_data],
|
|
839
|
+
model=model_name)
|
|
840
|
+
|
|
841
|
+
# handle usage stats if requested & if continuous
|
|
842
|
+
if include_continuous_usage:
|
|
843
|
+
completion_tokens = previous_num_tokens[i]
|
|
844
|
+
chunk.usage = UsageInfo(
|
|
845
|
+
prompt_tokens=num_prompt_tokens,
|
|
846
|
+
completion_tokens=completion_tokens,
|
|
847
|
+
total_tokens=num_prompt_tokens + completion_tokens,
|
|
848
|
+
)
|
|
849
|
+
|
|
850
|
+
data = chunk.model_dump_json(exclude_unset=True)
|
|
851
|
+
yield f"data: {data}\n\n"
|
|
852
|
+
|
|
853
|
+
# once the final token is handled, if stream_options.include_usage
|
|
854
|
+
# is sent, send the usage
|
|
855
|
+
if include_usage:
|
|
856
|
+
completion_tokens = sum(previous_num_tokens)
|
|
857
|
+
final_usage = UsageInfo(prompt_tokens=num_prompt_tokens,
|
|
858
|
+
completion_tokens=completion_tokens,
|
|
859
|
+
total_tokens=num_prompt_tokens +
|
|
860
|
+
completion_tokens)
|
|
861
|
+
if self.enable_prompt_tokens_details and num_cached_tokens:
|
|
862
|
+
final_usage.prompt_tokens_details = PromptTokenUsageInfo(
|
|
863
|
+
cached_tokens=num_cached_tokens)
|
|
864
|
+
|
|
865
|
+
final_usage_chunk = ChatCompletionStreamResponse(
|
|
866
|
+
id=request_id,
|
|
867
|
+
object=chunk_object_type,
|
|
868
|
+
created=created_time,
|
|
869
|
+
choices=[],
|
|
870
|
+
model=model_name,
|
|
871
|
+
usage=final_usage)
|
|
872
|
+
final_usage_data = (final_usage_chunk.model_dump_json(
|
|
873
|
+
exclude_unset=True, exclude_none=True))
|
|
874
|
+
yield f"data: {final_usage_data}\n\n"
|
|
875
|
+
|
|
876
|
+
# report to FastAPI middleware aggregate usage across all choices
|
|
877
|
+
num_completion_tokens = sum(previous_num_tokens)
|
|
878
|
+
request_metadata.final_usage_info = UsageInfo(
|
|
879
|
+
prompt_tokens=num_prompt_tokens,
|
|
880
|
+
completion_tokens=num_completion_tokens,
|
|
881
|
+
total_tokens=num_prompt_tokens + num_completion_tokens)
|
|
882
|
+
|
|
883
|
+
except Exception as e:
|
|
884
|
+
# TODO: Use a vllm-specific Validation Error
|
|
885
|
+
logger.exception("Error in chat completion stream generator.")
|
|
886
|
+
data = self.create_streaming_error_response(str(e))
|
|
887
|
+
yield f"data: {data}\n\n"
|
|
888
|
+
# Send the final done message after all response.n are finished
|
|
889
|
+
yield "data: [DONE]\n\n"
|
|
890
|
+
|
|
891
|
+
async def chat_completion_full_generator(
|
|
892
|
+
self,
|
|
893
|
+
request: ChatCompletionRequest,
|
|
894
|
+
result_generator: AsyncIterator[RequestOutput],
|
|
895
|
+
request_id: str,
|
|
896
|
+
model_name: str,
|
|
897
|
+
conversation: list[ConversationMessage],
|
|
898
|
+
tokenizer: AnyTokenizer,
|
|
899
|
+
request_metadata: RequestResponseMetadata,
|
|
900
|
+
) -> Union[ErrorResponse, ChatCompletionResponse]:
|
|
901
|
+
|
|
902
|
+
created_time = int(time.time())
|
|
903
|
+
final_res: Optional[RequestOutput] = None
|
|
904
|
+
|
|
905
|
+
try:
|
|
906
|
+
async for res in result_generator:
|
|
907
|
+
final_res = res
|
|
908
|
+
except asyncio.CancelledError:
|
|
909
|
+
return self.create_error_response("Client disconnected")
|
|
910
|
+
except ValueError as e:
|
|
911
|
+
# TODO: Use a vllm-specific Validation Error
|
|
912
|
+
return self.create_error_response(str(e))
|
|
913
|
+
|
|
914
|
+
assert final_res is not None
|
|
915
|
+
|
|
916
|
+
choices: list[ChatCompletionResponseChoice] = []
|
|
917
|
+
|
|
918
|
+
role = self.get_chat_request_role(request)
|
|
919
|
+
for output in final_res.outputs:
|
|
920
|
+
token_ids = output.token_ids
|
|
921
|
+
out_logprobs = output.logprobs
|
|
922
|
+
|
|
923
|
+
if request.logprobs and request.top_logprobs is not None:
|
|
924
|
+
assert out_logprobs is not None, "Did not output logprobs"
|
|
925
|
+
logprobs = self._create_chat_logprobs(
|
|
926
|
+
token_ids=token_ids,
|
|
927
|
+
top_logprobs=out_logprobs,
|
|
928
|
+
num_output_top_logprobs=request.top_logprobs,
|
|
929
|
+
tokenizer=tokenizer,
|
|
930
|
+
return_as_token_id=request.return_tokens_as_token_ids,
|
|
931
|
+
)
|
|
932
|
+
else:
|
|
933
|
+
logprobs = None
|
|
934
|
+
|
|
935
|
+
should_stream_with_reasoning_parsing = (
|
|
936
|
+
self._should_stream_with_reasoning_parsing(request))
|
|
937
|
+
|
|
938
|
+
# In the OpenAI API the finish_reason is "tools_called"
|
|
939
|
+
# if the tool choice is auto and the model produced a tool
|
|
940
|
+
# call. The same is not true for named function calls
|
|
941
|
+
auto_tools_called = False
|
|
942
|
+
|
|
943
|
+
if should_stream_with_reasoning_parsing and \
|
|
944
|
+
self.reasoning_parser is not None:
|
|
945
|
+
try:
|
|
946
|
+
reasoning_parser = self.reasoning_parser(tokenizer)
|
|
947
|
+
except RuntimeError as e:
|
|
948
|
+
logger.exception("Error in reasoning parser creation.")
|
|
949
|
+
return self.create_error_response(str(e))
|
|
950
|
+
# If the reasoning parser is enabled,
|
|
951
|
+
# tool calls are extracted exclusively from the content.
|
|
952
|
+
reasoning_content, content = (
|
|
953
|
+
reasoning_parser.extract_reasoning_content(
|
|
954
|
+
output.text, request=request))
|
|
955
|
+
else:
|
|
956
|
+
reasoning_content = None
|
|
957
|
+
content = output.text
|
|
958
|
+
|
|
959
|
+
# if auto tools are not enabled, and a named tool choice using
|
|
960
|
+
# outlines is not being used
|
|
961
|
+
if (not self.enable_auto_tools or not self.tool_parser) and \
|
|
962
|
+
(not isinstance(request.tool_choice,
|
|
963
|
+
ChatCompletionNamedToolChoiceParam
|
|
964
|
+
) and request.tool_choice != "required"):
|
|
965
|
+
message = ChatMessage(role=role,
|
|
966
|
+
reasoning_content=reasoning_content,
|
|
967
|
+
content=content)
|
|
968
|
+
|
|
969
|
+
# if the request uses tools and specified a tool choice
|
|
970
|
+
elif request.tool_choice and type(
|
|
971
|
+
request.tool_choice) is ChatCompletionNamedToolChoiceParam:
|
|
972
|
+
|
|
973
|
+
tool_call_class = MistralToolCall if isinstance(
|
|
974
|
+
tokenizer, MistralTokenizer) else ToolCall
|
|
975
|
+
message = ChatMessage(
|
|
976
|
+
role=role,
|
|
977
|
+
reasoning_content=reasoning_content,
|
|
978
|
+
content="",
|
|
979
|
+
tool_calls=[
|
|
980
|
+
tool_call_class(function=FunctionCall(
|
|
981
|
+
name=request.tool_choice.function.name,
|
|
982
|
+
arguments=content))
|
|
983
|
+
])
|
|
984
|
+
|
|
985
|
+
elif request.tool_choice and request.tool_choice == "required":
|
|
986
|
+
tool_call_class = MistralToolCall if isinstance(
|
|
987
|
+
tokenizer, MistralTokenizer) else ToolCall
|
|
988
|
+
|
|
989
|
+
# the fields of FunctionDefinition are a superset of the
|
|
990
|
+
# tool call outputs and can be used for parsing
|
|
991
|
+
tool_calls = TypeAdapter(
|
|
992
|
+
list[FunctionDefinition]).validate_json(output.text)
|
|
993
|
+
message = ChatMessage(
|
|
994
|
+
role=role,
|
|
995
|
+
content="",
|
|
996
|
+
tool_calls=[
|
|
997
|
+
tool_call_class(function=FunctionCall(
|
|
998
|
+
name=tool_call.name,
|
|
999
|
+
arguments=json.dumps(tool_call.parameters)))
|
|
1000
|
+
for tool_call in tool_calls
|
|
1001
|
+
])
|
|
1002
|
+
|
|
1003
|
+
# if the request doesn't use tool choice
|
|
1004
|
+
# OR specifies to not use a tool
|
|
1005
|
+
elif not request.tool_choice or request.tool_choice == "none":
|
|
1006
|
+
|
|
1007
|
+
message = ChatMessage(role=role,
|
|
1008
|
+
reasoning_content=reasoning_content,
|
|
1009
|
+
content=content)
|
|
1010
|
+
|
|
1011
|
+
# handle when there are tools and tool choice is auto
|
|
1012
|
+
elif request.tools and (
|
|
1013
|
+
request.tool_choice == "auto"
|
|
1014
|
+
or request.tool_choice is None) and self.enable_auto_tools \
|
|
1015
|
+
and self.tool_parser:
|
|
1016
|
+
|
|
1017
|
+
try:
|
|
1018
|
+
tool_parser = self.tool_parser(tokenizer)
|
|
1019
|
+
except RuntimeError as e:
|
|
1020
|
+
logger.exception("Error in tool parser creation.")
|
|
1021
|
+
return self.create_error_response(str(e))
|
|
1022
|
+
|
|
1023
|
+
tool_call_info = tool_parser.extract_tool_calls(
|
|
1024
|
+
content if content is not None else "", request=request)
|
|
1025
|
+
# In the OpenAI API the finish_reason is "tools_called"
|
|
1026
|
+
# if the tool choice is auto and the model produced a tool
|
|
1027
|
+
# call. The same is not true for named function calls
|
|
1028
|
+
auto_tools_called = tool_call_info.tools_called
|
|
1029
|
+
if tool_call_info.tools_called:
|
|
1030
|
+
message = ChatMessage(role=role,
|
|
1031
|
+
reasoning_content=reasoning_content,
|
|
1032
|
+
content=tool_call_info.content,
|
|
1033
|
+
tool_calls=tool_call_info.tool_calls)
|
|
1034
|
+
|
|
1035
|
+
else:
|
|
1036
|
+
# FOR NOW make it a chat message; we will have to detect
|
|
1037
|
+
# the type to make it later.
|
|
1038
|
+
message = ChatMessage(role=role,
|
|
1039
|
+
reasoning_content=reasoning_content,
|
|
1040
|
+
content=content)
|
|
1041
|
+
|
|
1042
|
+
# undetermined case that is still important to handle
|
|
1043
|
+
else:
|
|
1044
|
+
logger.error(
|
|
1045
|
+
"Error in chat_completion_full_generator - cannot determine"
|
|
1046
|
+
" if tools should be extracted. Returning a standard chat "
|
|
1047
|
+
"completion.")
|
|
1048
|
+
message = ChatMessage(role=role,
|
|
1049
|
+
reasoning_content=reasoning_content,
|
|
1050
|
+
content=content)
|
|
1051
|
+
|
|
1052
|
+
choice_data = ChatCompletionResponseChoice(
|
|
1053
|
+
index=output.index,
|
|
1054
|
+
message=message,
|
|
1055
|
+
logprobs=logprobs,
|
|
1056
|
+
finish_reason="tool_calls" if auto_tools_called else
|
|
1057
|
+
output.finish_reason if output.finish_reason else "stop",
|
|
1058
|
+
stop_reason=output.stop_reason)
|
|
1059
|
+
choices.append(choice_data)
|
|
1060
|
+
|
|
1061
|
+
if request.echo:
|
|
1062
|
+
last_msg_content: Union[str, list[dict[str, str]]] = ""
|
|
1063
|
+
if conversation and "content" in conversation[-1] and conversation[
|
|
1064
|
+
-1].get("role") == role:
|
|
1065
|
+
last_msg_content = conversation[-1]["content"] or ""
|
|
1066
|
+
if isinstance(last_msg_content, list):
|
|
1067
|
+
last_msg_content = "\n".join(msg['text']
|
|
1068
|
+
for msg in last_msg_content)
|
|
1069
|
+
|
|
1070
|
+
for choice in choices:
|
|
1071
|
+
full_message = last_msg_content + (choice.message.content
|
|
1072
|
+
or "")
|
|
1073
|
+
choice.message.content = full_message
|
|
1074
|
+
|
|
1075
|
+
assert final_res.prompt_token_ids is not None
|
|
1076
|
+
num_prompt_tokens = len(final_res.prompt_token_ids)
|
|
1077
|
+
if final_res.encoder_prompt_token_ids is not None:
|
|
1078
|
+
num_prompt_tokens += len(final_res.encoder_prompt_token_ids)
|
|
1079
|
+
num_generated_tokens = sum(
|
|
1080
|
+
len(output.token_ids) for output in final_res.outputs)
|
|
1081
|
+
usage = UsageInfo(prompt_tokens=num_prompt_tokens,
|
|
1082
|
+
completion_tokens=num_generated_tokens,
|
|
1083
|
+
total_tokens=num_prompt_tokens +
|
|
1084
|
+
num_generated_tokens)
|
|
1085
|
+
if self.enable_prompt_tokens_details and final_res.num_cached_tokens:
|
|
1086
|
+
usage.prompt_tokens_details = PromptTokenUsageInfo(
|
|
1087
|
+
cached_tokens=final_res.num_cached_tokens)
|
|
1088
|
+
|
|
1089
|
+
request_metadata.final_usage_info = usage
|
|
1090
|
+
|
|
1091
|
+
response = ChatCompletionResponse(
|
|
1092
|
+
id=request_id,
|
|
1093
|
+
created=created_time,
|
|
1094
|
+
model=model_name,
|
|
1095
|
+
choices=choices,
|
|
1096
|
+
usage=usage,
|
|
1097
|
+
prompt_logprobs=clamp_prompt_logprobs(final_res.prompt_logprobs),
|
|
1098
|
+
)
|
|
1099
|
+
|
|
1100
|
+
return response
|
|
1101
|
+
|
|
1102
|
+
def _get_top_logprobs(
|
|
1103
|
+
self, logprobs: dict[int, Logprob], top_logprobs: Optional[int],
|
|
1104
|
+
tokenizer: AnyTokenizer,
|
|
1105
|
+
should_return_as_token_id: bool) -> list[ChatCompletionLogProb]:
|
|
1106
|
+
return [
|
|
1107
|
+
ChatCompletionLogProb(token=(token := self._get_decoded_token(
|
|
1108
|
+
p[1],
|
|
1109
|
+
p[0],
|
|
1110
|
+
tokenizer,
|
|
1111
|
+
return_as_token_id=should_return_as_token_id)),
|
|
1112
|
+
logprob=max(p[1].logprob, -9999.0),
|
|
1113
|
+
bytes=list(
|
|
1114
|
+
token.encode("utf-8", errors="replace")))
|
|
1115
|
+
for i, p in enumerate(logprobs.items())
|
|
1116
|
+
if top_logprobs and i < top_logprobs
|
|
1117
|
+
]
|
|
1118
|
+
|
|
1119
|
+
def _create_chat_logprobs(
|
|
1120
|
+
self,
|
|
1121
|
+
token_ids: GenericSequence[int],
|
|
1122
|
+
top_logprobs: GenericSequence[Optional[dict[int, Logprob]]],
|
|
1123
|
+
tokenizer: AnyTokenizer,
|
|
1124
|
+
num_output_top_logprobs: Optional[int] = None,
|
|
1125
|
+
return_as_token_id: Optional[bool] = None,
|
|
1126
|
+
) -> ChatCompletionLogProbs:
|
|
1127
|
+
"""Create OpenAI-style logprobs."""
|
|
1128
|
+
logprobs_content: list[ChatCompletionLogProbsContent] = []
|
|
1129
|
+
|
|
1130
|
+
should_return_as_token_id = return_as_token_id if \
|
|
1131
|
+
return_as_token_id is not None else self.return_tokens_as_token_ids
|
|
1132
|
+
for i, token_id in enumerate(token_ids):
|
|
1133
|
+
step_top_logprobs = top_logprobs[i]
|
|
1134
|
+
if step_top_logprobs is None:
|
|
1135
|
+
token = tokenizer.decode(token_id)
|
|
1136
|
+
if should_return_as_token_id:
|
|
1137
|
+
token = f"token_id:{token_id}"
|
|
1138
|
+
|
|
1139
|
+
logprobs_content.append(
|
|
1140
|
+
ChatCompletionLogProbsContent(
|
|
1141
|
+
token=token,
|
|
1142
|
+
bytes=list(token.encode("utf-8", errors="replace")),
|
|
1143
|
+
))
|
|
1144
|
+
else:
|
|
1145
|
+
step_token = step_top_logprobs[token_id]
|
|
1146
|
+
step_decoded = step_token.decoded_token
|
|
1147
|
+
|
|
1148
|
+
logprobs_content.append(
|
|
1149
|
+
ChatCompletionLogProbsContent(
|
|
1150
|
+
token=self._get_decoded_token(
|
|
1151
|
+
step_token,
|
|
1152
|
+
token_id,
|
|
1153
|
+
tokenizer,
|
|
1154
|
+
should_return_as_token_id,
|
|
1155
|
+
),
|
|
1156
|
+
logprob=max(step_token.logprob, -9999.0),
|
|
1157
|
+
bytes=None if step_decoded is None else list(
|
|
1158
|
+
step_decoded.encode("utf-8", errors="replace")),
|
|
1159
|
+
top_logprobs=self._get_top_logprobs(
|
|
1160
|
+
step_top_logprobs, num_output_top_logprobs,
|
|
1161
|
+
tokenizer, should_return_as_token_id),
|
|
1162
|
+
))
|
|
1163
|
+
|
|
1164
|
+
return ChatCompletionLogProbs(content=logprobs_content)
|
|
1165
|
+
|
|
1166
|
+
def _should_stream_with_auto_tool_parsing(self,
|
|
1167
|
+
request: ChatCompletionRequest):
|
|
1168
|
+
"""
|
|
1169
|
+
Utility function to check if streamed tokens should go through the tool
|
|
1170
|
+
call parser that was configured.
|
|
1171
|
+
|
|
1172
|
+
We only want to do this IF user-provided tools are set, a tool parser
|
|
1173
|
+
is configured, "auto" tool choice is enabled, and the request's tool
|
|
1174
|
+
choice field indicates that "auto" tool choice should be used.
|
|
1175
|
+
"""
|
|
1176
|
+
return (request.tools and self.tool_parser and self.enable_auto_tools
|
|
1177
|
+
and request.tool_choice in ['auto', None])
|
|
1178
|
+
|
|
1179
|
+
def _should_stream_with_reasoning_parsing(self,
|
|
1180
|
+
request: ChatCompletionRequest):
|
|
1181
|
+
"""
|
|
1182
|
+
Utility function to check if streamed tokens should go through the
|
|
1183
|
+
reasoning parser that was configured.
|
|
1184
|
+
|
|
1185
|
+
We only want to do this IF reasoning is enabled and a reasoning
|
|
1186
|
+
parser is configured.
|
|
1187
|
+
"""
|
|
1188
|
+
return self.enable_reasoning and self.reasoning_parser is not None
|
|
1189
|
+
|
|
1190
|
+
def _should_check_for_unstreamed_tool_arg_tokens(
|
|
1191
|
+
self,
|
|
1192
|
+
delta_message: Optional[DeltaMessage],
|
|
1193
|
+
output: CompletionOutput,
|
|
1194
|
+
) -> bool:
|
|
1195
|
+
"""
|
|
1196
|
+
Check to see if we should check for unstreamed tool arguments tokens.
|
|
1197
|
+
This is only applicable when auto tool parsing is enabled, the delta
|
|
1198
|
+
is a tool call with arguments.
|
|
1199
|
+
"""
|
|
1200
|
+
|
|
1201
|
+
# yapf: disable
|
|
1202
|
+
return bool(
|
|
1203
|
+
# if there is a delta message that includes tool calls which
|
|
1204
|
+
# include a function that has arguments
|
|
1205
|
+
output.finish_reason is not None
|
|
1206
|
+
and self.enable_auto_tools and self.tool_parser and delta_message
|
|
1207
|
+
and delta_message.tool_calls and delta_message.tool_calls[0]
|
|
1208
|
+
and delta_message.tool_calls[0].function
|
|
1209
|
+
and delta_message.tool_calls[0].function.arguments is not None
|
|
1210
|
+
)
|