vllm-cpu 0.11.0.post2__cp312-cp312-manylinux_2_17_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vllm/_C.abi3.so +0 -0
- vllm/__init__.py +220 -0
- vllm/_bc_linter.py +59 -0
- vllm/_custom_ops.py +2044 -0
- vllm/_ipex_ops.py +393 -0
- vllm/_version.py +34 -0
- vllm/assets/__init__.py +0 -0
- vllm/assets/audio.py +45 -0
- vllm/assets/base.py +41 -0
- vllm/assets/image.py +50 -0
- vllm/assets/video.py +145 -0
- vllm/attention/__init__.py +15 -0
- vllm/attention/backends/__init__.py +0 -0
- vllm/attention/backends/abstract.py +204 -0
- vllm/attention/backends/utils.py +33 -0
- vllm/attention/layer.py +645 -0
- vllm/attention/layers/__init__.py +0 -0
- vllm/attention/layers/chunked_local_attention.py +93 -0
- vllm/attention/layers/cross_attention.py +162 -0
- vllm/attention/layers/encoder_only_attention.py +86 -0
- vllm/attention/ops/__init__.py +0 -0
- vllm/attention/ops/chunked_prefill_paged_decode.py +405 -0
- vllm/attention/ops/common.py +345 -0
- vllm/attention/ops/flashmla.py +192 -0
- vllm/attention/ops/merge_attn_states.py +43 -0
- vllm/attention/ops/paged_attn.py +262 -0
- vllm/attention/ops/pallas_kv_cache_update.py +124 -0
- vllm/attention/ops/prefix_prefill.py +928 -0
- vllm/attention/ops/rocm_aiter_mla.py +104 -0
- vllm/attention/ops/rocm_aiter_paged_attn.py +102 -0
- vllm/attention/ops/triton_decode_attention.py +691 -0
- vllm/attention/ops/triton_flash_attention.py +984 -0
- vllm/attention/ops/triton_merge_attn_states.py +97 -0
- vllm/attention/ops/triton_reshape_and_cache_flash.py +175 -0
- vllm/attention/ops/triton_unified_attention.py +894 -0
- vllm/attention/selector.py +245 -0
- vllm/attention/utils/__init__.py +0 -0
- vllm/attention/utils/fa_utils.py +85 -0
- vllm/attention/utils/kv_sharing_utils.py +33 -0
- vllm/beam_search.py +87 -0
- vllm/benchmarks/__init__.py +0 -0
- vllm/benchmarks/datasets.py +2723 -0
- vllm/benchmarks/latency.py +170 -0
- vllm/benchmarks/lib/__init__.py +3 -0
- vllm/benchmarks/lib/endpoint_request_func.py +533 -0
- vllm/benchmarks/lib/ready_checker.py +73 -0
- vllm/benchmarks/lib/utils.py +80 -0
- vllm/benchmarks/serve.py +1358 -0
- vllm/benchmarks/throughput.py +696 -0
- vllm/collect_env.py +823 -0
- vllm/compilation/__init__.py +0 -0
- vllm/compilation/activation_quant_fusion.py +189 -0
- vllm/compilation/backends.py +650 -0
- vllm/compilation/base_static_graph.py +56 -0
- vllm/compilation/collective_fusion.py +1188 -0
- vllm/compilation/compiler_interface.py +573 -0
- vllm/compilation/counter.py +47 -0
- vllm/compilation/cuda_graph.py +199 -0
- vllm/compilation/cuda_piecewise_backend.py +117 -0
- vllm/compilation/decorators.py +400 -0
- vllm/compilation/fix_functionalization.py +205 -0
- vllm/compilation/fusion.py +383 -0
- vllm/compilation/fusion_attn.py +295 -0
- vllm/compilation/fx_utils.py +84 -0
- vllm/compilation/inductor_pass.py +136 -0
- vllm/compilation/monitor.py +57 -0
- vllm/compilation/noop_elimination.py +158 -0
- vllm/compilation/pass_manager.py +125 -0
- vllm/compilation/post_cleanup.py +20 -0
- vllm/compilation/sequence_parallelism.py +478 -0
- vllm/compilation/torch25_custom_graph_pass.py +42 -0
- vllm/compilation/vllm_inductor_pass.py +156 -0
- vllm/compilation/wrapper.py +136 -0
- vllm/config/__init__.py +814 -0
- vllm/config/cache.py +220 -0
- vllm/config/compilation.py +673 -0
- vllm/config/device.py +74 -0
- vllm/config/kv_events.py +50 -0
- vllm/config/kv_transfer.py +111 -0
- vllm/config/load.py +113 -0
- vllm/config/lora.py +132 -0
- vllm/config/model.py +1912 -0
- vllm/config/multimodal.py +129 -0
- vllm/config/observability.py +99 -0
- vllm/config/parallel.py +524 -0
- vllm/config/pooler.py +97 -0
- vllm/config/scheduler.py +287 -0
- vllm/config/speculative.py +568 -0
- vllm/config/speech_to_text.py +39 -0
- vllm/config/structured_outputs.py +64 -0
- vllm/config/utils.py +145 -0
- vllm/connections.py +186 -0
- vllm/device_allocator/__init__.py +0 -0
- vllm/device_allocator/cumem.py +311 -0
- vllm/distributed/__init__.py +6 -0
- vllm/distributed/communication_op.py +41 -0
- vllm/distributed/device_communicators/__init__.py +0 -0
- vllm/distributed/device_communicators/all2all.py +440 -0
- vllm/distributed/device_communicators/all_reduce_utils.py +317 -0
- vllm/distributed/device_communicators/base_device_communicator.py +295 -0
- vllm/distributed/device_communicators/cpu_communicator.py +201 -0
- vllm/distributed/device_communicators/cuda_communicator.py +323 -0
- vllm/distributed/device_communicators/cuda_wrapper.py +180 -0
- vllm/distributed/device_communicators/custom_all_reduce.py +311 -0
- vllm/distributed/device_communicators/mnnvl_compat.py +28 -0
- vllm/distributed/device_communicators/pynccl.py +340 -0
- vllm/distributed/device_communicators/pynccl_allocator.py +186 -0
- vllm/distributed/device_communicators/pynccl_wrapper.py +416 -0
- vllm/distributed/device_communicators/quick_all_reduce.py +278 -0
- vllm/distributed/device_communicators/ray_communicator.py +258 -0
- vllm/distributed/device_communicators/shm_broadcast.py +589 -0
- vllm/distributed/device_communicators/shm_object_storage.py +635 -0
- vllm/distributed/device_communicators/symm_mem.py +136 -0
- vllm/distributed/device_communicators/tpu_communicator.py +102 -0
- vllm/distributed/device_communicators/xpu_communicator.py +94 -0
- vllm/distributed/eplb/__init__.py +8 -0
- vllm/distributed/eplb/eplb_state.py +620 -0
- vllm/distributed/eplb/rebalance_algo.py +239 -0
- vllm/distributed/eplb/rebalance_execute.py +424 -0
- vllm/distributed/kv_events.py +362 -0
- vllm/distributed/kv_transfer/README.md +29 -0
- vllm/distributed/kv_transfer/__init__.py +13 -0
- vllm/distributed/kv_transfer/disagg_prefill_workflow.jpg +0 -0
- vllm/distributed/kv_transfer/kv_connector/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_connector/base.py +10 -0
- vllm/distributed/kv_transfer/kv_connector/factory.py +113 -0
- vllm/distributed/kv_transfer/kv_connector/utils.py +261 -0
- vllm/distributed/kv_transfer/kv_connector/v1/__init__.py +6 -0
- vllm/distributed/kv_transfer/kv_connector/v1/base.py +388 -0
- vllm/distributed/kv_transfer/kv_connector/v1/lmcache_connector.py +168 -0
- vllm/distributed/kv_transfer/kv_connector/v1/metrics.py +100 -0
- vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py +328 -0
- vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py +1473 -0
- vllm/distributed/kv_transfer/kv_connector/v1/offloading_connector.py +485 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_connector.py +488 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/p2p_nccl_engine.py +550 -0
- vllm/distributed/kv_transfer/kv_connector/v1/p2p/tensor_memory_pool.py +267 -0
- vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py +418 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/base.py +175 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/mooncake_store.py +161 -0
- vllm/distributed/kv_transfer/kv_lookup_buffer/simple_buffer.py +237 -0
- vllm/distributed/kv_transfer/kv_pipe/__init__.py +0 -0
- vllm/distributed/kv_transfer/kv_pipe/base.py +67 -0
- vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py +290 -0
- vllm/distributed/kv_transfer/kv_pipe/pynccl_pipe.py +280 -0
- vllm/distributed/kv_transfer/kv_transfer_state.py +73 -0
- vllm/distributed/parallel_state.py +1532 -0
- vllm/distributed/tpu_distributed_utils.py +178 -0
- vllm/distributed/utils.py +536 -0
- vllm/engine/__init__.py +0 -0
- vllm/engine/arg_utils.py +1778 -0
- vllm/engine/async_llm_engine.py +6 -0
- vllm/engine/llm_engine.py +6 -0
- vllm/engine/metrics.py +577 -0
- vllm/engine/metrics_types.py +84 -0
- vllm/engine/protocol.py +333 -0
- vllm/entrypoints/__init__.py +0 -0
- vllm/entrypoints/api_server.py +178 -0
- vllm/entrypoints/chat_utils.py +1705 -0
- vllm/entrypoints/cli/__init__.py +12 -0
- vllm/entrypoints/cli/benchmark/__init__.py +0 -0
- vllm/entrypoints/cli/benchmark/base.py +25 -0
- vllm/entrypoints/cli/benchmark/latency.py +21 -0
- vllm/entrypoints/cli/benchmark/main.py +55 -0
- vllm/entrypoints/cli/benchmark/serve.py +21 -0
- vllm/entrypoints/cli/benchmark/throughput.py +21 -0
- vllm/entrypoints/cli/collect_env.py +36 -0
- vllm/entrypoints/cli/main.py +60 -0
- vllm/entrypoints/cli/openai.py +233 -0
- vllm/entrypoints/cli/run_batch.py +67 -0
- vllm/entrypoints/cli/serve.py +232 -0
- vllm/entrypoints/cli/types.py +29 -0
- vllm/entrypoints/constants.py +10 -0
- vllm/entrypoints/context.py +481 -0
- vllm/entrypoints/harmony_utils.py +436 -0
- vllm/entrypoints/launcher.py +164 -0
- vllm/entrypoints/llm.py +1629 -0
- vllm/entrypoints/logger.py +79 -0
- vllm/entrypoints/openai/__init__.py +0 -0
- vllm/entrypoints/openai/api_server.py +1953 -0
- vllm/entrypoints/openai/cli_args.py +288 -0
- vllm/entrypoints/openai/logits_processors.py +90 -0
- vllm/entrypoints/openai/protocol.py +2757 -0
- vllm/entrypoints/openai/run_batch.py +491 -0
- vllm/entrypoints/openai/serving_chat.py +1597 -0
- vllm/entrypoints/openai/serving_classification.py +173 -0
- vllm/entrypoints/openai/serving_completion.py +692 -0
- vllm/entrypoints/openai/serving_embedding.py +631 -0
- vllm/entrypoints/openai/serving_engine.py +992 -0
- vllm/entrypoints/openai/serving_models.py +288 -0
- vllm/entrypoints/openai/serving_pooling.py +276 -0
- vllm/entrypoints/openai/serving_responses.py +1709 -0
- vllm/entrypoints/openai/serving_score.py +479 -0
- vllm/entrypoints/openai/serving_tokenization.py +196 -0
- vllm/entrypoints/openai/serving_transcription.py +136 -0
- vllm/entrypoints/openai/speech_to_text.py +388 -0
- vllm/entrypoints/openai/tool_parsers/__init__.py +55 -0
- vllm/entrypoints/openai/tool_parsers/abstract_tool_parser.py +164 -0
- vllm/entrypoints/openai/tool_parsers/deepseekv31_tool_parser.py +367 -0
- vllm/entrypoints/openai/tool_parsers/deepseekv3_tool_parser.py +370 -0
- vllm/entrypoints/openai/tool_parsers/glm4_moe_tool_parser.py +185 -0
- vllm/entrypoints/openai/tool_parsers/granite_20b_fc_tool_parser.py +259 -0
- vllm/entrypoints/openai/tool_parsers/granite_tool_parser.py +237 -0
- vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py +455 -0
- vllm/entrypoints/openai/tool_parsers/hunyuan_a13b_tool_parser.py +372 -0
- vllm/entrypoints/openai/tool_parsers/internlm2_tool_parser.py +216 -0
- vllm/entrypoints/openai/tool_parsers/jamba_tool_parser.py +308 -0
- vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py +377 -0
- vllm/entrypoints/openai/tool_parsers/llama4_pythonic_tool_parser.py +316 -0
- vllm/entrypoints/openai/tool_parsers/llama_tool_parser.py +269 -0
- vllm/entrypoints/openai/tool_parsers/longcat_tool_parser.py +39 -0
- vllm/entrypoints/openai/tool_parsers/minimax_tool_parser.py +816 -0
- vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +369 -0
- vllm/entrypoints/openai/tool_parsers/openai_tool_parser.py +93 -0
- vllm/entrypoints/openai/tool_parsers/phi4mini_tool_parser.py +112 -0
- vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py +308 -0
- vllm/entrypoints/openai/tool_parsers/qwen3coder_tool_parser.py +707 -0
- vllm/entrypoints/openai/tool_parsers/qwen3xml_tool_parser.py +1137 -0
- vllm/entrypoints/openai/tool_parsers/seed_oss_tool_parser.py +679 -0
- vllm/entrypoints/openai/tool_parsers/step3_tool_parser.py +296 -0
- vllm/entrypoints/openai/tool_parsers/utils.py +124 -0
- vllm/entrypoints/openai/tool_parsers/xlam_tool_parser.py +524 -0
- vllm/entrypoints/renderer.py +395 -0
- vllm/entrypoints/score_utils.py +232 -0
- vllm/entrypoints/ssl.py +75 -0
- vllm/entrypoints/tool.py +139 -0
- vllm/entrypoints/tool_server.py +206 -0
- vllm/entrypoints/utils.py +233 -0
- vllm/env_override.py +23 -0
- vllm/envs.py +1590 -0
- vllm/executor/__init__.py +0 -0
- vllm/executor/executor_base.py +381 -0
- vllm/executor/msgspec_utils.py +35 -0
- vllm/executor/ray_distributed_executor.py +699 -0
- vllm/executor/ray_utils.py +410 -0
- vllm/executor/uniproc_executor.py +176 -0
- vllm/forward_context.py +402 -0
- vllm/inputs/__init__.py +30 -0
- vllm/inputs/data.py +356 -0
- vllm/inputs/parse.py +151 -0
- vllm/inputs/preprocess.py +664 -0
- vllm/logger.py +229 -0
- vllm/logging_utils/__init__.py +10 -0
- vllm/logging_utils/dump_input.py +81 -0
- vllm/logging_utils/formatter.py +79 -0
- vllm/logging_utils/log_time.py +32 -0
- vllm/logits_process.py +119 -0
- vllm/logprobs.py +28 -0
- vllm/lora/__init__.py +0 -0
- vllm/lora/layers/__init__.py +34 -0
- vllm/lora/layers/base.py +69 -0
- vllm/lora/layers/base_linear.py +185 -0
- vllm/lora/layers/column_parallel_linear.py +609 -0
- vllm/lora/layers/logits_processor.py +247 -0
- vllm/lora/layers/qkv_x_parallel_linear.py +8 -0
- vllm/lora/layers/replicated_linear.py +60 -0
- vllm/lora/layers/row_parallel_linear.py +196 -0
- vllm/lora/layers/utils.py +65 -0
- vllm/lora/layers/vocal_parallel_embedding.py +174 -0
- vllm/lora/lora_weights.py +199 -0
- vllm/lora/models.py +816 -0
- vllm/lora/ops/__init__.py +0 -0
- vllm/lora/ops/ipex_ops/__init__.py +7 -0
- vllm/lora/ops/ipex_ops/lora_ops.py +44 -0
- vllm/lora/ops/torch_ops/__init__.py +16 -0
- vllm/lora/ops/torch_ops/lora_ops.py +119 -0
- vllm/lora/ops/triton_ops/__init__.py +12 -0
- vllm/lora/ops/triton_ops/kernel_utils.py +243 -0
- vllm/lora/ops/triton_ops/lora_expand_op.py +289 -0
- vllm/lora/ops/triton_ops/lora_kernel_metadata.py +148 -0
- vllm/lora/ops/triton_ops/lora_shrink_op.py +243 -0
- vllm/lora/ops/triton_ops/utils.py +126 -0
- vllm/lora/ops/xla_ops/__init__.py +7 -0
- vllm/lora/ops/xla_ops/lora_ops.py +144 -0
- vllm/lora/peft_helper.py +127 -0
- vllm/lora/punica_wrapper/__init__.py +10 -0
- vllm/lora/punica_wrapper/punica_base.py +458 -0
- vllm/lora/punica_wrapper/punica_cpu.py +349 -0
- vllm/lora/punica_wrapper/punica_gpu.py +272 -0
- vllm/lora/punica_wrapper/punica_selector.py +20 -0
- vllm/lora/punica_wrapper/punica_tpu.py +391 -0
- vllm/lora/punica_wrapper/punica_xpu.py +276 -0
- vllm/lora/punica_wrapper/utils.py +136 -0
- vllm/lora/request.py +97 -0
- vllm/lora/resolver.py +85 -0
- vllm/lora/utils.py +246 -0
- vllm/lora/worker_manager.py +267 -0
- vllm/model_executor/__init__.py +12 -0
- vllm/model_executor/custom_op.py +194 -0
- vllm/model_executor/layers/__init__.py +0 -0
- vllm/model_executor/layers/activation.py +575 -0
- vllm/model_executor/layers/attention_layer_base.py +23 -0
- vllm/model_executor/layers/fla/__init__.py +8 -0
- vllm/model_executor/layers/fla/ops/__init__.py +17 -0
- vllm/model_executor/layers/fla/ops/chunk.py +225 -0
- vllm/model_executor/layers/fla/ops/chunk_delta_h.py +290 -0
- vllm/model_executor/layers/fla/ops/chunk_o.py +177 -0
- vllm/model_executor/layers/fla/ops/chunk_scaled_dot_kkt.py +140 -0
- vllm/model_executor/layers/fla/ops/cumsum.py +226 -0
- vllm/model_executor/layers/fla/ops/fused_recurrent.py +366 -0
- vllm/model_executor/layers/fla/ops/index.py +39 -0
- vllm/model_executor/layers/fla/ops/l2norm.py +143 -0
- vllm/model_executor/layers/fla/ops/layernorm_guard.py +337 -0
- vllm/model_executor/layers/fla/ops/op.py +39 -0
- vllm/model_executor/layers/fla/ops/solve_tril.py +365 -0
- vllm/model_executor/layers/fla/ops/utils.py +180 -0
- vllm/model_executor/layers/fla/ops/wy_fast.py +114 -0
- vllm/model_executor/layers/fused_moe/__init__.py +89 -0
- vllm/model_executor/layers/fused_moe/batched_deep_gemm_moe.py +322 -0
- vllm/model_executor/layers/fused_moe/batched_triton_or_deep_gemm_moe.py +141 -0
- vllm/model_executor/layers/fused_moe/config.py +804 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3072,device_name=NVIDIA_H100_80GB_HBM3.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=1,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=1024,device_name=NVIDIA_H100,dtype=fp8_w8a8.json +123 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=192,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=352,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +122 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=384,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=704,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +114 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=768,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=128,N=96,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200,dtype=fp8_w8a8.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1024,device_name=NVIDIA_H100.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1344,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=14336,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=2688,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3072,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3200,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +218 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=6400,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=int8_w8a16.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=16,N=800,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +130 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=192,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=320,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=160,N=640,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=20,N=2560,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325X,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H20-3e,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=256,N=64,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=128,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=384,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_GB200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=40,N=2560,device_name=NVIDIA_H100,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +147 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=128,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=256,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_GB200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=512,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_B200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H20-3e.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=512,N=64,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=1408,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=176,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=352,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=60,N=704,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=128,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=256,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=62,N=512,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1280,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=2560,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=3072,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=320,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=384,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_A800-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=640,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=768,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=64,N=896,device_name=NVIDIA_H20.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=192,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=384,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=72,N=768,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +138 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=14336,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=16384,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=1792,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +154 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=2048,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-40GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_GeForce_RTX_4090,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=3584,device_name=NVIDIA_L40S.json +173 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=4096,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_A100-SXM4-80GB.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H100_80GB_HBM3.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=7168,device_name=NVIDIA_H200.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI300X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8.json +164 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=AMD_Instinct_MI325X.json +200 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/E=8,N=8192,device_name=NVIDIA_H200,dtype=fp8_w8a8.json +146 -0
- vllm/model_executor/layers/fused_moe/configs/README +12 -0
- vllm/model_executor/layers/fused_moe/cpu_fused_moe.py +300 -0
- vllm/model_executor/layers/fused_moe/cutlass_moe.py +957 -0
- vllm/model_executor/layers/fused_moe/deep_gemm_moe.py +362 -0
- vllm/model_executor/layers/fused_moe/deep_gemm_utils.py +413 -0
- vllm/model_executor/layers/fused_moe/deepep_ht_prepare_finalize.py +361 -0
- vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +274 -0
- vllm/model_executor/layers/fused_moe/flashinfer_cutlass_moe.py +268 -0
- vllm/model_executor/layers/fused_moe/flashinfer_cutlass_prepare_finalize.py +300 -0
- vllm/model_executor/layers/fused_moe/flashinfer_trtllm_moe.py +184 -0
- vllm/model_executor/layers/fused_moe/fused_batched_moe.py +993 -0
- vllm/model_executor/layers/fused_moe/fused_marlin_moe.py +239 -0
- vllm/model_executor/layers/fused_moe/fused_moe.py +1890 -0
- vllm/model_executor/layers/fused_moe/gpt_oss_triton_kernels_moe.py +307 -0
- vllm/model_executor/layers/fused_moe/layer.py +2195 -0
- vllm/model_executor/layers/fused_moe/modular_kernel.py +1038 -0
- vllm/model_executor/layers/fused_moe/moe_align_block_size.py +87 -0
- vllm/model_executor/layers/fused_moe/moe_pallas.py +80 -0
- vllm/model_executor/layers/fused_moe/moe_permute_unpermute.py +205 -0
- vllm/model_executor/layers/fused_moe/moe_torch_iterative.py +60 -0
- vllm/model_executor/layers/fused_moe/pplx_prepare_finalize.py +341 -0
- vllm/model_executor/layers/fused_moe/prepare_finalize.py +70 -0
- vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +424 -0
- vllm/model_executor/layers/fused_moe/routing_simulator.py +291 -0
- vllm/model_executor/layers/fused_moe/topk_weight_and_reduce.py +146 -0
- vllm/model_executor/layers/fused_moe/triton_deep_gemm_moe.py +143 -0
- vllm/model_executor/layers/fused_moe/trtllm_moe.py +191 -0
- vllm/model_executor/layers/fused_moe/utils.py +274 -0
- vllm/model_executor/layers/layernorm.py +395 -0
- vllm/model_executor/layers/lightning_attn.py +661 -0
- vllm/model_executor/layers/linear.py +1603 -0
- vllm/model_executor/layers/logits_processor.py +106 -0
- vllm/model_executor/layers/mamba/__init__.py +0 -0
- vllm/model_executor/layers/mamba/abstract.py +42 -0
- vllm/model_executor/layers/mamba/linear_attn.py +403 -0
- vllm/model_executor/layers/mamba/mamba_mixer.py +466 -0
- vllm/model_executor/layers/mamba/mamba_mixer2.py +764 -0
- vllm/model_executor/layers/mamba/mamba_utils.py +186 -0
- vllm/model_executor/layers/mamba/ops/__init__.py +0 -0
- vllm/model_executor/layers/mamba/ops/causal_conv1d.py +1092 -0
- vllm/model_executor/layers/mamba/ops/layernorm_gated.py +168 -0
- vllm/model_executor/layers/mamba/ops/mamba_ssm.py +414 -0
- vllm/model_executor/layers/mamba/ops/ssd_bmm.py +242 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_scan.py +527 -0
- vllm/model_executor/layers/mamba/ops/ssd_chunk_state.py +724 -0
- vllm/model_executor/layers/mamba/ops/ssd_combined.py +238 -0
- vllm/model_executor/layers/mamba/ops/ssd_state_passing.py +200 -0
- vllm/model_executor/layers/mamba/short_conv.py +253 -0
- vllm/model_executor/layers/mla.py +173 -0
- vllm/model_executor/layers/pooler.py +719 -0
- vllm/model_executor/layers/quantization/__init__.py +157 -0
- vllm/model_executor/layers/quantization/auto_round.py +388 -0
- vllm/model_executor/layers/quantization/awq.py +228 -0
- vllm/model_executor/layers/quantization/awq_marlin.py +554 -0
- vllm/model_executor/layers/quantization/awq_triton.py +320 -0
- vllm/model_executor/layers/quantization/base_config.py +170 -0
- vllm/model_executor/layers/quantization/bitblas.py +464 -0
- vllm/model_executor/layers/quantization/bitsandbytes.py +627 -0
- vllm/model_executor/layers/quantization/compressed_tensors/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors.py +797 -0
- vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py +2074 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/__init__.py +27 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_24.py +366 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_scheme.py +55 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_24.py +160 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a16_nvfp4.py +105 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a4_nvfp4.py +185 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_fp8.py +169 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w4a8_int.py +135 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a16_fp8.py +121 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_fp8.py +157 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_w8a8_int8.py +111 -0
- vllm/model_executor/layers/quantization/compressed_tensors/schemes/compressed_tensors_wNa16.py +201 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/linear.py +238 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/module.py +153 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/__init__.py +0 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/schemes/linear_qutlass_nvfp4.py +46 -0
- vllm/model_executor/layers/quantization/compressed_tensors/transform/utils.py +13 -0
- vllm/model_executor/layers/quantization/compressed_tensors/triton_scaled_mm.py +206 -0
- vllm/model_executor/layers/quantization/compressed_tensors/utils.py +216 -0
- vllm/model_executor/layers/quantization/deepspeedfp.py +196 -0
- vllm/model_executor/layers/quantization/experts_int8.py +223 -0
- vllm/model_executor/layers/quantization/fbgemm_fp8.py +172 -0
- vllm/model_executor/layers/quantization/fp8.py +1098 -0
- vllm/model_executor/layers/quantization/gguf.py +599 -0
- vllm/model_executor/layers/quantization/gptq.py +340 -0
- vllm/model_executor/layers/quantization/gptq_bitblas.py +448 -0
- vllm/model_executor/layers/quantization/gptq_marlin.py +751 -0
- vllm/model_executor/layers/quantization/gptq_marlin_24.py +297 -0
- vllm/model_executor/layers/quantization/hqq_marlin.py +333 -0
- vllm/model_executor/layers/quantization/inc.py +61 -0
- vllm/model_executor/layers/quantization/input_quant_fp8.py +156 -0
- vllm/model_executor/layers/quantization/ipex_quant.py +415 -0
- vllm/model_executor/layers/quantization/kernels/__init__.py +0 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/MPLinearKernel.py +91 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/__init__.py +93 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/allspark.py +116 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/bitblas.py +302 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/conch.py +92 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/cutlass.py +117 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/dynamic_4bit.py +92 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/exllama.py +143 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/machete.py +144 -0
- vllm/model_executor/layers/quantization/kernels/mixed_precision/marlin.py +139 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/ScaledMMLinearKernel.py +67 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/__init__.py +89 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py +161 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/cpu.py +206 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/cutlass.py +137 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/triton.py +41 -0
- vllm/model_executor/layers/quantization/kernels/scaled_mm/xla.py +104 -0
- vllm/model_executor/layers/quantization/kv_cache.py +143 -0
- vllm/model_executor/layers/quantization/modelopt.py +1596 -0
- vllm/model_executor/layers/quantization/moe_wna16.py +484 -0
- vllm/model_executor/layers/quantization/mxfp4.py +988 -0
- vllm/model_executor/layers/quantization/petit.py +306 -0
- vllm/model_executor/layers/quantization/ptpc_fp8.py +129 -0
- vllm/model_executor/layers/quantization/quark/__init__.py +0 -0
- vllm/model_executor/layers/quantization/quark/quark.py +432 -0
- vllm/model_executor/layers/quantization/quark/quark_moe.py +561 -0
- vllm/model_executor/layers/quantization/quark/schemes/__init__.py +9 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_scheme.py +55 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w4a4_mxfp4.py +239 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_fp8.py +163 -0
- vllm/model_executor/layers/quantization/quark/schemes/quark_w8a8_int8.py +122 -0
- vllm/model_executor/layers/quantization/quark/utils.py +105 -0
- vllm/model_executor/layers/quantization/rtn.py +466 -0
- vllm/model_executor/layers/quantization/schema.py +86 -0
- vllm/model_executor/layers/quantization/torchao.py +214 -0
- vllm/model_executor/layers/quantization/tpu_int8.py +125 -0
- vllm/model_executor/layers/quantization/utils/__init__.py +6 -0
- vllm/model_executor/layers/quantization/utils/allspark_utils.py +52 -0
- vllm/model_executor/layers/quantization/utils/bitblas_utils.py +210 -0
- vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=12288,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=1536,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=1536,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2048,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2112,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=2304,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=24576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=256,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=1536,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=3072,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=32768,K=512,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=36864,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=512,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4096,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=4608,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=512,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +18 -0
- vllm/model_executor/layers/quantization/utils/configs/N=576,K=7168,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1024,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=1152,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=128,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=16384,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A100-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_A800-SXM4-80GB,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=18432,device_name=NVIDIA_L20Y,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2048,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H100_80GB_HBM3,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=2304,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_B200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H20,dtype=int8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_H200,dtype=fp8_w8a8,block_shape=[128,128].json +146 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=256,device_name=NVIDIA_L20,dtype=fp8_w8a8,block_shape=[128,128].json +26 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=7168,K=8192,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI300X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325X,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/N=8192,K=1536,device_name=AMD_Instinct_MI325_OAM,dtype=fp8_w8a8,block_shape=[128,128].json +164 -0
- vllm/model_executor/layers/quantization/utils/configs/README.md +3 -0
- vllm/model_executor/layers/quantization/utils/flashinfer_fp4_moe.py +79 -0
- vllm/model_executor/layers/quantization/utils/flashinfer_utils.py +248 -0
- vllm/model_executor/layers/quantization/utils/fp8_utils.py +949 -0
- vllm/model_executor/layers/quantization/utils/gptq_utils.py +146 -0
- vllm/model_executor/layers/quantization/utils/int8_utils.py +492 -0
- vllm/model_executor/layers/quantization/utils/layer_utils.py +40 -0
- vllm/model_executor/layers/quantization/utils/machete_utils.py +50 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils.py +479 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp4.py +396 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_fp8.py +345 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test.py +165 -0
- vllm/model_executor/layers/quantization/utils/marlin_utils_test_24.py +464 -0
- vllm/model_executor/layers/quantization/utils/mxfp4_utils.py +141 -0
- vllm/model_executor/layers/quantization/utils/mxfp8_utils.py +20 -0
- vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py +137 -0
- vllm/model_executor/layers/quantization/utils/nvfp4_moe_support.py +59 -0
- vllm/model_executor/layers/quantization/utils/petit_utils.py +122 -0
- vllm/model_executor/layers/quantization/utils/quant_utils.py +641 -0
- vllm/model_executor/layers/quantization/utils/w8a8_utils.py +458 -0
- vllm/model_executor/layers/resampler.py +270 -0
- vllm/model_executor/layers/rotary_embedding/__init__.py +204 -0
- vllm/model_executor/layers/rotary_embedding/base.py +177 -0
- vllm/model_executor/layers/rotary_embedding/common.py +150 -0
- vllm/model_executor/layers/rotary_embedding/deepseek_scaling_rope.py +138 -0
- vllm/model_executor/layers/rotary_embedding/dual_chunk_rope.py +197 -0
- vllm/model_executor/layers/rotary_embedding/dynamic_ntk_alpha_rope.py +41 -0
- vllm/model_executor/layers/rotary_embedding/dynamic_ntk_scaling_rope.py +67 -0
- vllm/model_executor/layers/rotary_embedding/ernie45_vl_rope.py +80 -0
- vllm/model_executor/layers/rotary_embedding/linear_scaling_rope.py +115 -0
- vllm/model_executor/layers/rotary_embedding/llama3_rope.py +54 -0
- vllm/model_executor/layers/rotary_embedding/llama4_vision_rope.py +81 -0
- vllm/model_executor/layers/rotary_embedding/mrope.py +1321 -0
- vllm/model_executor/layers/rotary_embedding/ntk_scaling_rope.py +42 -0
- vllm/model_executor/layers/rotary_embedding/phi3_long_rope_scaled_rope.py +129 -0
- vllm/model_executor/layers/rotary_embedding/rocm_aiter_rope_ops.py +86 -0
- vllm/model_executor/layers/rotary_embedding/yarn_scaling_rope.py +68 -0
- vllm/model_executor/layers/shared_fused_moe/__init__.py +6 -0
- vllm/model_executor/layers/shared_fused_moe/shared_fused_moe.py +56 -0
- vllm/model_executor/layers/utils.py +195 -0
- vllm/model_executor/layers/vocab_parallel_embedding.py +487 -0
- vllm/model_executor/model_loader/__init__.py +138 -0
- vllm/model_executor/model_loader/base_loader.py +52 -0
- vllm/model_executor/model_loader/bitsandbytes_loader.py +788 -0
- vllm/model_executor/model_loader/default_loader.py +277 -0
- vllm/model_executor/model_loader/dummy_loader.py +28 -0
- vllm/model_executor/model_loader/gguf_loader.py +155 -0
- vllm/model_executor/model_loader/runai_streamer_loader.py +104 -0
- vllm/model_executor/model_loader/sharded_state_loader.py +199 -0
- vllm/model_executor/model_loader/tensorizer.py +738 -0
- vllm/model_executor/model_loader/tensorizer_loader.py +143 -0
- vllm/model_executor/model_loader/tpu.py +114 -0
- vllm/model_executor/model_loader/utils.py +292 -0
- vllm/model_executor/model_loader/weight_utils.py +990 -0
- vllm/model_executor/models/__init__.py +33 -0
- vllm/model_executor/models/adapters.py +542 -0
- vllm/model_executor/models/aimv2.py +246 -0
- vllm/model_executor/models/apertus.py +579 -0
- vllm/model_executor/models/arcee.py +422 -0
- vllm/model_executor/models/arctic.py +558 -0
- vllm/model_executor/models/aria.py +650 -0
- vllm/model_executor/models/aya_vision.py +468 -0
- vllm/model_executor/models/baichuan.py +474 -0
- vllm/model_executor/models/bailing_moe.py +642 -0
- vllm/model_executor/models/bamba.py +514 -0
- vllm/model_executor/models/bert.py +665 -0
- vllm/model_executor/models/bert_with_rope.py +687 -0
- vllm/model_executor/models/blip.py +339 -0
- vllm/model_executor/models/blip2.py +712 -0
- vllm/model_executor/models/bloom.py +374 -0
- vllm/model_executor/models/chameleon.py +1139 -0
- vllm/model_executor/models/chatglm.py +476 -0
- vllm/model_executor/models/clip.py +407 -0
- vllm/model_executor/models/cohere2_vision.py +481 -0
- vllm/model_executor/models/commandr.py +465 -0
- vllm/model_executor/models/config.py +445 -0
- vllm/model_executor/models/dbrx.py +471 -0
- vllm/model_executor/models/deepseek.py +497 -0
- vllm/model_executor/models/deepseek_eagle.py +240 -0
- vllm/model_executor/models/deepseek_mtp.py +289 -0
- vllm/model_executor/models/deepseek_v2.py +1444 -0
- vllm/model_executor/models/deepseek_vl2.py +658 -0
- vllm/model_executor/models/dots1.py +546 -0
- vllm/model_executor/models/dots_ocr.py +873 -0
- vllm/model_executor/models/ernie45.py +43 -0
- vllm/model_executor/models/ernie45_moe.py +607 -0
- vllm/model_executor/models/ernie45_vl.py +1527 -0
- vllm/model_executor/models/ernie45_vl_moe.py +727 -0
- vllm/model_executor/models/ernie_mtp.py +268 -0
- vllm/model_executor/models/exaone.py +550 -0
- vllm/model_executor/models/exaone4.py +533 -0
- vllm/model_executor/models/fairseq2_llama.py +154 -0
- vllm/model_executor/models/falcon.py +509 -0
- vllm/model_executor/models/falcon_h1.py +674 -0
- vllm/model_executor/models/fuyu.py +399 -0
- vllm/model_executor/models/gemma.py +425 -0
- vllm/model_executor/models/gemma2.py +422 -0
- vllm/model_executor/models/gemma3.py +555 -0
- vllm/model_executor/models/gemma3_mm.py +721 -0
- vllm/model_executor/models/gemma3n.py +1113 -0
- vllm/model_executor/models/gemma3n_mm.py +761 -0
- vllm/model_executor/models/glm.py +23 -0
- vllm/model_executor/models/glm4.py +304 -0
- vllm/model_executor/models/glm4_1v.py +1690 -0
- vllm/model_executor/models/glm4_moe.py +727 -0
- vllm/model_executor/models/glm4_moe_mtp.py +301 -0
- vllm/model_executor/models/glm4v.py +654 -0
- vllm/model_executor/models/gpt2.py +380 -0
- vllm/model_executor/models/gpt_bigcode.py +344 -0
- vllm/model_executor/models/gpt_j.py +339 -0
- vllm/model_executor/models/gpt_neox.py +330 -0
- vllm/model_executor/models/gpt_oss.py +712 -0
- vllm/model_executor/models/granite.py +489 -0
- vllm/model_executor/models/granite_speech.py +794 -0
- vllm/model_executor/models/granitemoe.py +550 -0
- vllm/model_executor/models/granitemoehybrid.py +614 -0
- vllm/model_executor/models/granitemoeshared.py +332 -0
- vllm/model_executor/models/gritlm.py +262 -0
- vllm/model_executor/models/grok1.py +547 -0
- vllm/model_executor/models/h2ovl.py +536 -0
- vllm/model_executor/models/hunyuan_v1.py +1042 -0
- vllm/model_executor/models/hyperclovax_vision.py +1192 -0
- vllm/model_executor/models/idefics2_vision_model.py +417 -0
- vllm/model_executor/models/idefics3.py +756 -0
- vllm/model_executor/models/interfaces.py +959 -0
- vllm/model_executor/models/interfaces_base.py +192 -0
- vllm/model_executor/models/intern_vit.py +441 -0
- vllm/model_executor/models/internlm2.py +450 -0
- vllm/model_executor/models/internlm2_ve.py +148 -0
- vllm/model_executor/models/interns1.py +838 -0
- vllm/model_executor/models/interns1_vit.py +418 -0
- vllm/model_executor/models/internvl.py +1423 -0
- vllm/model_executor/models/jais.py +373 -0
- vllm/model_executor/models/jamba.py +591 -0
- vllm/model_executor/models/jina_vl.py +144 -0
- vllm/model_executor/models/keye.py +1680 -0
- vllm/model_executor/models/keye_vl1_5.py +602 -0
- vllm/model_executor/models/kimi_vl.py +618 -0
- vllm/model_executor/models/lfm2.py +548 -0
- vllm/model_executor/models/llama.py +669 -0
- vllm/model_executor/models/llama4.py +746 -0
- vllm/model_executor/models/llama4_eagle.py +239 -0
- vllm/model_executor/models/llama_eagle.py +179 -0
- vllm/model_executor/models/llama_eagle3.py +296 -0
- vllm/model_executor/models/llava.py +870 -0
- vllm/model_executor/models/llava_next.py +571 -0
- vllm/model_executor/models/llava_next_video.py +476 -0
- vllm/model_executor/models/llava_onevision.py +942 -0
- vllm/model_executor/models/longcat_flash.py +715 -0
- vllm/model_executor/models/longcat_flash_mtp.py +352 -0
- vllm/model_executor/models/mamba.py +275 -0
- vllm/model_executor/models/mamba2.py +291 -0
- vllm/model_executor/models/medusa.py +169 -0
- vllm/model_executor/models/midashenglm.py +792 -0
- vllm/model_executor/models/mimo.py +188 -0
- vllm/model_executor/models/mimo_mtp.py +280 -0
- vllm/model_executor/models/minicpm.py +631 -0
- vllm/model_executor/models/minicpm3.py +230 -0
- vllm/model_executor/models/minicpm_eagle.py +389 -0
- vllm/model_executor/models/minicpmo.py +770 -0
- vllm/model_executor/models/minicpmv.py +1784 -0
- vllm/model_executor/models/minimax_text_01.py +986 -0
- vllm/model_executor/models/minimax_vl_01.py +426 -0
- vllm/model_executor/models/mistral3.py +628 -0
- vllm/model_executor/models/mixtral.py +606 -0
- vllm/model_executor/models/mllama4.py +1076 -0
- vllm/model_executor/models/mlp_speculator.py +206 -0
- vllm/model_executor/models/modernbert.py +374 -0
- vllm/model_executor/models/module_mapping.py +72 -0
- vllm/model_executor/models/molmo.py +1567 -0
- vllm/model_executor/models/moonvit.py +673 -0
- vllm/model_executor/models/motif.py +345 -0
- vllm/model_executor/models/mpt.py +329 -0
- vllm/model_executor/models/nano_nemotron_vl.py +1394 -0
- vllm/model_executor/models/nemotron.py +507 -0
- vllm/model_executor/models/nemotron_h.py +565 -0
- vllm/model_executor/models/nemotron_nas.py +481 -0
- vllm/model_executor/models/nemotron_vl.py +652 -0
- vllm/model_executor/models/nvlm_d.py +203 -0
- vllm/model_executor/models/olmo.py +404 -0
- vllm/model_executor/models/olmo2.py +439 -0
- vllm/model_executor/models/olmoe.py +483 -0
- vllm/model_executor/models/opt.py +412 -0
- vllm/model_executor/models/orion.py +348 -0
- vllm/model_executor/models/ovis.py +559 -0
- vllm/model_executor/models/ovis2_5.py +642 -0
- vllm/model_executor/models/paligemma.py +411 -0
- vllm/model_executor/models/persimmon.py +343 -0
- vllm/model_executor/models/phi.py +356 -0
- vllm/model_executor/models/phi3.py +19 -0
- vllm/model_executor/models/phi3v.py +698 -0
- vllm/model_executor/models/phi4_multimodal.py +1475 -0
- vllm/model_executor/models/phi4mm.py +1279 -0
- vllm/model_executor/models/phi4mm_audio.py +1254 -0
- vllm/model_executor/models/phi4mm_utils.py +1875 -0
- vllm/model_executor/models/phimoe.py +679 -0
- vllm/model_executor/models/pixtral.py +1345 -0
- vllm/model_executor/models/plamo2.py +978 -0
- vllm/model_executor/models/qwen.py +361 -0
- vllm/model_executor/models/qwen2.py +523 -0
- vllm/model_executor/models/qwen2_5_omni_thinker.py +984 -0
- vllm/model_executor/models/qwen2_5_vl.py +1481 -0
- vllm/model_executor/models/qwen2_audio.py +489 -0
- vllm/model_executor/models/qwen2_moe.py +558 -0
- vllm/model_executor/models/qwen2_rm.py +122 -0
- vllm/model_executor/models/qwen2_vl.py +1670 -0
- vllm/model_executor/models/qwen3.py +341 -0
- vllm/model_executor/models/qwen3_moe.py +692 -0
- vllm/model_executor/models/qwen3_next.py +1266 -0
- vllm/model_executor/models/qwen3_next_mtp.py +281 -0
- vllm/model_executor/models/qwen3_vl.py +1613 -0
- vllm/model_executor/models/qwen3_vl_moe.py +358 -0
- vllm/model_executor/models/qwen_vl.py +795 -0
- vllm/model_executor/models/radio.py +576 -0
- vllm/model_executor/models/registry.py +990 -0
- vllm/model_executor/models/roberta.py +252 -0
- vllm/model_executor/models/rvl.py +103 -0
- vllm/model_executor/models/seed_oss.py +485 -0
- vllm/model_executor/models/siglip.py +540 -0
- vllm/model_executor/models/siglip2navit.py +689 -0
- vllm/model_executor/models/skyworkr1v.py +911 -0
- vllm/model_executor/models/smolvlm.py +44 -0
- vllm/model_executor/models/solar.py +504 -0
- vllm/model_executor/models/stablelm.py +341 -0
- vllm/model_executor/models/starcoder2.py +354 -0
- vllm/model_executor/models/step3_text.py +510 -0
- vllm/model_executor/models/step3_vl.py +1072 -0
- vllm/model_executor/models/swin.py +475 -0
- vllm/model_executor/models/tarsier.py +639 -0
- vllm/model_executor/models/telechat2.py +151 -0
- vllm/model_executor/models/teleflm.py +79 -0
- vllm/model_executor/models/terratorch.py +294 -0
- vllm/model_executor/models/transformers.py +948 -0
- vllm/model_executor/models/ultravox.py +654 -0
- vllm/model_executor/models/utils.py +808 -0
- vllm/model_executor/models/vision.py +404 -0
- vllm/model_executor/models/voxtral.py +786 -0
- vllm/model_executor/models/whisper.py +963 -0
- vllm/model_executor/models/zamba2.py +960 -0
- vllm/model_executor/parameter.py +620 -0
- vllm/model_executor/utils.py +86 -0
- vllm/model_executor/warmup/__init__.py +0 -0
- vllm/model_executor/warmup/deep_gemm_warmup.py +230 -0
- vllm/model_executor/warmup/kernel_warmup.py +83 -0
- vllm/multimodal/__init__.py +33 -0
- vllm/multimodal/audio.py +116 -0
- vllm/multimodal/base.py +27 -0
- vllm/multimodal/cache.py +697 -0
- vllm/multimodal/evs.py +273 -0
- vllm/multimodal/hasher.py +102 -0
- vllm/multimodal/image.py +130 -0
- vllm/multimodal/inputs.py +987 -0
- vllm/multimodal/parse.py +511 -0
- vllm/multimodal/processing.py +2148 -0
- vllm/multimodal/profiling.py +284 -0
- vllm/multimodal/registry.py +345 -0
- vllm/multimodal/utils.py +503 -0
- vllm/multimodal/video.py +319 -0
- vllm/outputs.py +324 -0
- vllm/platforms/__init__.py +263 -0
- vllm/platforms/cpu.py +340 -0
- vllm/platforms/cuda.py +668 -0
- vllm/platforms/interface.py +620 -0
- vllm/platforms/rocm.py +497 -0
- vllm/platforms/tpu.py +233 -0
- vllm/platforms/xpu.py +243 -0
- vllm/plugins/__init__.py +72 -0
- vllm/plugins/io_processors/__init__.py +68 -0
- vllm/plugins/io_processors/interface.py +67 -0
- vllm/plugins/lora_resolvers/README.md +16 -0
- vllm/plugins/lora_resolvers/__init__.py +0 -0
- vllm/plugins/lora_resolvers/filesystem_resolver.py +50 -0
- vllm/pooling_params.py +191 -0
- vllm/profiler/__init__.py +0 -0
- vllm/profiler/layerwise_profile.py +375 -0
- vllm/profiler/utils.py +148 -0
- vllm/py.typed +2 -0
- vllm/ray/__init__.py +0 -0
- vllm/ray/lazy_utils.py +22 -0
- vllm/ray/ray_env.py +72 -0
- vllm/reasoning/__init__.py +29 -0
- vllm/reasoning/abs_reasoning_parsers.py +202 -0
- vllm/reasoning/basic_parsers.py +156 -0
- vllm/reasoning/deepseek_r1_reasoning_parser.py +67 -0
- vllm/reasoning/glm4_moe_reasoning_parser.py +151 -0
- vllm/reasoning/gptoss_reasoning_parser.py +87 -0
- vllm/reasoning/granite_reasoning_parser.py +363 -0
- vllm/reasoning/hunyuan_a13b_reasoning_parser.py +245 -0
- vllm/reasoning/mistral_reasoning_parser.py +56 -0
- vllm/reasoning/qwen3_reasoning_parser.py +72 -0
- vllm/reasoning/seedoss_reasoning_parser.py +28 -0
- vllm/reasoning/step3_reasoning_parser.py +109 -0
- vllm/sampling_params.py +593 -0
- vllm/scalar_type.py +349 -0
- vllm/scripts.py +15 -0
- vllm/sequence.py +103 -0
- vllm/tasks.py +11 -0
- vllm/test_utils.py +129 -0
- vllm/third_party/__init__.py +0 -0
- vllm/third_party/pynvml.py +6140 -0
- vllm/tracing.py +136 -0
- vllm/transformers_utils/__init__.py +24 -0
- vllm/transformers_utils/chat_templates/__init__.py +5 -0
- vllm/transformers_utils/chat_templates/registry.py +70 -0
- vllm/transformers_utils/chat_templates/template_basic.jinja +3 -0
- vllm/transformers_utils/chat_templates/template_blip2.jinja +11 -0
- vllm/transformers_utils/chat_templates/template_chatml.jinja +10 -0
- vllm/transformers_utils/chat_templates/template_deepseek_vl2.jinja +23 -0
- vllm/transformers_utils/chat_templates/template_fuyu.jinja +3 -0
- vllm/transformers_utils/chat_templates/template_minicpmv45.jinja +93 -0
- vllm/transformers_utils/config.py +1102 -0
- vllm/transformers_utils/config_parser_base.py +20 -0
- vllm/transformers_utils/configs/__init__.py +63 -0
- vllm/transformers_utils/configs/arctic.py +207 -0
- vllm/transformers_utils/configs/chatglm.py +72 -0
- vllm/transformers_utils/configs/deepseek_v3.py +101 -0
- vllm/transformers_utils/configs/deepseek_vl2.py +216 -0
- vllm/transformers_utils/configs/dotsocr.py +69 -0
- vllm/transformers_utils/configs/eagle.py +84 -0
- vllm/transformers_utils/configs/falcon.py +90 -0
- vllm/transformers_utils/configs/jais.py +237 -0
- vllm/transformers_utils/configs/kimi_vl.py +37 -0
- vllm/transformers_utils/configs/medusa.py +63 -0
- vllm/transformers_utils/configs/midashenglm.py +101 -0
- vllm/transformers_utils/configs/mistral.py +165 -0
- vllm/transformers_utils/configs/mlp_speculator.py +68 -0
- vllm/transformers_utils/configs/moonvit.py +33 -0
- vllm/transformers_utils/configs/nemotron.py +205 -0
- vllm/transformers_utils/configs/nemotron_h.py +259 -0
- vllm/transformers_utils/configs/nemotron_vl.py +56 -0
- vllm/transformers_utils/configs/olmo3.py +80 -0
- vllm/transformers_utils/configs/ovis.py +176 -0
- vllm/transformers_utils/configs/qwen3_next.py +275 -0
- vllm/transformers_utils/configs/radio.py +91 -0
- vllm/transformers_utils/configs/speculators/__init__.py +2 -0
- vllm/transformers_utils/configs/speculators/algos.py +32 -0
- vllm/transformers_utils/configs/speculators/base.py +111 -0
- vllm/transformers_utils/configs/step3_vl.py +123 -0
- vllm/transformers_utils/configs/ultravox.py +116 -0
- vllm/transformers_utils/detokenizer_utils.py +199 -0
- vllm/transformers_utils/dynamic_module.py +60 -0
- vllm/transformers_utils/processor.py +299 -0
- vllm/transformers_utils/processors/__init__.py +16 -0
- vllm/transformers_utils/processors/deepseek_vl2.py +362 -0
- vllm/transformers_utils/processors/ovis.py +420 -0
- vllm/transformers_utils/processors/ovis2_5.py +458 -0
- vllm/transformers_utils/runai_utils.py +104 -0
- vllm/transformers_utils/s3_utils.py +93 -0
- vllm/transformers_utils/tokenizer.py +292 -0
- vllm/transformers_utils/tokenizer_base.py +154 -0
- vllm/transformers_utils/tokenizers/__init__.py +10 -0
- vllm/transformers_utils/tokenizers/mistral.py +521 -0
- vllm/transformers_utils/utils.py +108 -0
- vllm/triton_utils/__init__.py +16 -0
- vllm/triton_utils/importing.py +96 -0
- vllm/usage/__init__.py +0 -0
- vllm/usage/usage_lib.py +259 -0
- vllm/utils/__init__.py +3566 -0
- vllm/utils/deep_gemm.py +319 -0
- vllm/utils/flashinfer.py +443 -0
- vllm/utils/jsontree.py +178 -0
- vllm/utils/tensor_schema.py +235 -0
- vllm/v1/__init__.py +0 -0
- vllm/v1/attention/__init__.py +0 -0
- vllm/v1/attention/backends/__init__.py +0 -0
- vllm/v1/attention/backends/cpu_attn.py +919 -0
- vllm/v1/attention/backends/flash_attn.py +795 -0
- vllm/v1/attention/backends/flashinfer.py +1181 -0
- vllm/v1/attention/backends/flex_attention.py +861 -0
- vllm/v1/attention/backends/gdn_attn.py +332 -0
- vllm/v1/attention/backends/linear_attn.py +67 -0
- vllm/v1/attention/backends/mamba1_attn.py +81 -0
- vllm/v1/attention/backends/mamba2_attn.py +232 -0
- vllm/v1/attention/backends/mamba_attn.py +52 -0
- vllm/v1/attention/backends/mla/__init__.py +0 -0
- vllm/v1/attention/backends/mla/common.py +1783 -0
- vllm/v1/attention/backends/mla/cutlass_mla.py +248 -0
- vllm/v1/attention/backends/mla/flashattn_mla.py +271 -0
- vllm/v1/attention/backends/mla/flashinfer_mla.py +114 -0
- vllm/v1/attention/backends/mla/flashmla.py +203 -0
- vllm/v1/attention/backends/mla/flashmla_sparse.py +544 -0
- vllm/v1/attention/backends/mla/indexer.py +342 -0
- vllm/v1/attention/backends/mla/rocm_aiter_mla.py +255 -0
- vllm/v1/attention/backends/mla/triton_mla.py +177 -0
- vllm/v1/attention/backends/pallas.py +409 -0
- vllm/v1/attention/backends/rocm_aiter_fa.py +549 -0
- vllm/v1/attention/backends/rocm_attn.py +426 -0
- vllm/v1/attention/backends/short_conv_attn.py +94 -0
- vllm/v1/attention/backends/tree_attn.py +451 -0
- vllm/v1/attention/backends/triton_attn.py +361 -0
- vllm/v1/attention/backends/utils.py +990 -0
- vllm/v1/attention/backends/xformers.py +438 -0
- vllm/v1/core/__init__.py +0 -0
- vllm/v1/core/block_pool.py +416 -0
- vllm/v1/core/encoder_cache_manager.py +333 -0
- vllm/v1/core/kv_cache_coordinator.py +440 -0
- vllm/v1/core/kv_cache_manager.py +399 -0
- vllm/v1/core/kv_cache_utils.py +1291 -0
- vllm/v1/core/sched/__init__.py +0 -0
- vllm/v1/core/sched/async_scheduler.py +47 -0
- vllm/v1/core/sched/interface.py +158 -0
- vllm/v1/core/sched/output.py +166 -0
- vllm/v1/core/sched/request_queue.py +224 -0
- vllm/v1/core/sched/scheduler.py +1296 -0
- vllm/v1/core/sched/utils.py +69 -0
- vllm/v1/core/single_type_kv_cache_manager.py +671 -0
- vllm/v1/cudagraph_dispatcher.py +125 -0
- vllm/v1/engine/__init__.py +203 -0
- vllm/v1/engine/async_llm.py +742 -0
- vllm/v1/engine/coordinator.py +357 -0
- vllm/v1/engine/core.py +1235 -0
- vllm/v1/engine/core_client.py +1334 -0
- vllm/v1/engine/detokenizer.py +349 -0
- vllm/v1/engine/exceptions.py +17 -0
- vllm/v1/engine/llm_engine.py +370 -0
- vllm/v1/engine/logprobs.py +201 -0
- vllm/v1/engine/output_processor.py +576 -0
- vllm/v1/engine/parallel_sampling.py +133 -0
- vllm/v1/engine/processor.py +545 -0
- vllm/v1/engine/utils.py +860 -0
- vllm/v1/executor/__init__.py +0 -0
- vllm/v1/executor/abstract.py +137 -0
- vllm/v1/executor/multiproc_executor.py +726 -0
- vllm/v1/executor/ray_distributed_executor.py +108 -0
- vllm/v1/executor/utils.py +23 -0
- vllm/v1/kv_cache_interface.py +375 -0
- vllm/v1/kv_offload/__init__.py +0 -0
- vllm/v1/kv_offload/abstract.py +165 -0
- vllm/v1/kv_offload/backend.py +96 -0
- vllm/v1/kv_offload/backends/__init__.py +0 -0
- vllm/v1/kv_offload/backends/cpu.py +61 -0
- vllm/v1/kv_offload/cpu.py +75 -0
- vllm/v1/kv_offload/factory.py +56 -0
- vllm/v1/kv_offload/lru_manager.py +132 -0
- vllm/v1/kv_offload/mediums.py +39 -0
- vllm/v1/kv_offload/spec.py +61 -0
- vllm/v1/kv_offload/worker/__init__.py +0 -0
- vllm/v1/kv_offload/worker/cpu_gpu.py +171 -0
- vllm/v1/kv_offload/worker/worker.py +142 -0
- vllm/v1/metrics/__init__.py +0 -0
- vllm/v1/metrics/loggers.py +741 -0
- vllm/v1/metrics/prometheus.py +82 -0
- vllm/v1/metrics/ray_wrappers.py +152 -0
- vllm/v1/metrics/reader.py +246 -0
- vllm/v1/metrics/stats.py +257 -0
- vllm/v1/outputs.py +161 -0
- vllm/v1/pool/__init__.py +0 -0
- vllm/v1/pool/metadata.py +77 -0
- vllm/v1/request.py +241 -0
- vllm/v1/sample/__init__.py +0 -0
- vllm/v1/sample/logits_processor/__init__.py +294 -0
- vllm/v1/sample/logits_processor/builtin.py +275 -0
- vllm/v1/sample/logits_processor/interface.py +97 -0
- vllm/v1/sample/logits_processor/state.py +161 -0
- vllm/v1/sample/metadata.py +43 -0
- vllm/v1/sample/ops/__init__.py +0 -0
- vllm/v1/sample/ops/bad_words.py +39 -0
- vllm/v1/sample/ops/logprobs.py +26 -0
- vllm/v1/sample/ops/penalties.py +43 -0
- vllm/v1/sample/ops/topk_topp_sampler.py +292 -0
- vllm/v1/sample/rejection_sampler.py +623 -0
- vllm/v1/sample/sampler.py +285 -0
- vllm/v1/sample/tpu/__init__.py +0 -0
- vllm/v1/sample/tpu/metadata.py +124 -0
- vllm/v1/sample/tpu/sampler.py +213 -0
- vllm/v1/serial_utils.py +423 -0
- vllm/v1/spec_decode/__init__.py +0 -0
- vllm/v1/spec_decode/eagle.py +1011 -0
- vllm/v1/spec_decode/medusa.py +66 -0
- vllm/v1/spec_decode/metadata.py +62 -0
- vllm/v1/spec_decode/metrics.py +211 -0
- vllm/v1/spec_decode/ngram_proposer.py +276 -0
- vllm/v1/spec_decode/utils.py +14 -0
- vllm/v1/structured_output/__init__.py +295 -0
- vllm/v1/structured_output/backend_guidance.py +245 -0
- vllm/v1/structured_output/backend_lm_format_enforcer.py +167 -0
- vllm/v1/structured_output/backend_outlines.py +320 -0
- vllm/v1/structured_output/backend_types.py +134 -0
- vllm/v1/structured_output/backend_xgrammar.py +327 -0
- vllm/v1/structured_output/request.py +86 -0
- vllm/v1/structured_output/utils.py +454 -0
- vllm/v1/utils.py +396 -0
- vllm/v1/worker/__init__.py +0 -0
- vllm/v1/worker/block_table.py +210 -0
- vllm/v1/worker/cpu_model_runner.py +175 -0
- vllm/v1/worker/cpu_worker.py +156 -0
- vllm/v1/worker/gpu_input_batch.py +863 -0
- vllm/v1/worker/gpu_model_runner.py +4160 -0
- vllm/v1/worker/gpu_ubatch_wrapper.py +399 -0
- vllm/v1/worker/gpu_worker.py +710 -0
- vllm/v1/worker/kv_connector_model_runner_mixin.py +132 -0
- vllm/v1/worker/lora_model_runner_mixin.py +183 -0
- vllm/v1/worker/tpu_input_batch.py +587 -0
- vllm/v1/worker/tpu_model_runner.py +1946 -0
- vllm/v1/worker/tpu_worker.py +346 -0
- vllm/v1/worker/ubatch_splitting.py +192 -0
- vllm/v1/worker/ubatch_utils.py +27 -0
- vllm/v1/worker/ubatching.py +224 -0
- vllm/v1/worker/utils.py +344 -0
- vllm/v1/worker/worker_base.py +65 -0
- vllm/v1/worker/xpu_model_runner.py +57 -0
- vllm/v1/worker/xpu_worker.py +179 -0
- vllm/version.py +41 -0
- vllm/vllm_flash_attn/.gitkeep +0 -0
- vllm/worker/__init__.py +0 -0
- vllm/worker/worker_base.py +279 -0
- vllm_cpu-0.11.0.post2.dist-info/METADATA +348 -0
- vllm_cpu-0.11.0.post2.dist-info/RECORD +1398 -0
- vllm_cpu-0.11.0.post2.dist-info/WHEEL +5 -0
- vllm_cpu-0.11.0.post2.dist-info/entry_points.txt +5 -0
- vllm_cpu-0.11.0.post2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1597 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
3
|
+
|
|
4
|
+
import asyncio
|
|
5
|
+
import json
|
|
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
|
+
import regex as re
|
|
14
|
+
from fastapi import Request
|
|
15
|
+
from openai_harmony import Message as OpenAIMessage
|
|
16
|
+
from pydantic import TypeAdapter
|
|
17
|
+
|
|
18
|
+
from vllm.config import ModelConfig
|
|
19
|
+
from vllm.engine.protocol import EngineClient
|
|
20
|
+
from vllm.entrypoints.chat_utils import (ChatTemplateContentFormatOption,
|
|
21
|
+
ConversationMessage,
|
|
22
|
+
get_history_tool_calls_cnt,
|
|
23
|
+
make_tool_call_id)
|
|
24
|
+
from vllm.entrypoints.harmony_utils import (
|
|
25
|
+
get_developer_message, get_stop_tokens_for_assistant_actions,
|
|
26
|
+
get_streamable_parser_for_assistant, get_system_message, parse_chat_input,
|
|
27
|
+
parse_chat_output, render_for_completion)
|
|
28
|
+
from vllm.entrypoints.logger import RequestLogger
|
|
29
|
+
from vllm.entrypoints.openai.protocol import (
|
|
30
|
+
ChatCompletionLogProb, ChatCompletionLogProbs,
|
|
31
|
+
ChatCompletionLogProbsContent, ChatCompletionNamedToolChoiceParam,
|
|
32
|
+
ChatCompletionRequest, ChatCompletionResponse,
|
|
33
|
+
ChatCompletionResponseChoice, ChatCompletionResponseStreamChoice,
|
|
34
|
+
ChatCompletionStreamResponse, ChatMessage, DeltaFunctionCall, DeltaMessage,
|
|
35
|
+
DeltaToolCall, ErrorResponse, FunctionCall, FunctionDefinition,
|
|
36
|
+
PromptTokenUsageInfo, RequestResponseMetadata, ToolCall, UsageInfo)
|
|
37
|
+
from vllm.entrypoints.openai.serving_engine import (OpenAIServing,
|
|
38
|
+
clamp_prompt_logprobs)
|
|
39
|
+
from vllm.entrypoints.openai.serving_models import OpenAIServingModels
|
|
40
|
+
from vllm.entrypoints.openai.tool_parsers import ToolParser, ToolParserManager
|
|
41
|
+
from vllm.entrypoints.openai.tool_parsers.mistral_tool_parser import (
|
|
42
|
+
MistralToolCall)
|
|
43
|
+
from vllm.entrypoints.utils import get_max_tokens
|
|
44
|
+
from vllm.inputs.data import TokensPrompt as EngineTokensPrompt
|
|
45
|
+
from vllm.logger import init_logger
|
|
46
|
+
from vllm.logprobs import Logprob
|
|
47
|
+
from vllm.outputs import CompletionOutput, RequestOutput
|
|
48
|
+
from vllm.reasoning import ReasoningParser, ReasoningParserManager
|
|
49
|
+
from vllm.sampling_params import BeamSearchParams, SamplingParams
|
|
50
|
+
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
|
|
51
|
+
from vllm.transformers_utils.tokenizers import (maybe_serialize_tool_calls,
|
|
52
|
+
truncate_tool_call_ids,
|
|
53
|
+
validate_request_params)
|
|
54
|
+
from vllm.utils import as_list
|
|
55
|
+
|
|
56
|
+
logger = init_logger(__name__)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class OpenAIServingChat(OpenAIServing):
|
|
60
|
+
|
|
61
|
+
def __init__(
|
|
62
|
+
self,
|
|
63
|
+
engine_client: EngineClient,
|
|
64
|
+
model_config: ModelConfig,
|
|
65
|
+
models: OpenAIServingModels,
|
|
66
|
+
response_role: str,
|
|
67
|
+
*,
|
|
68
|
+
request_logger: Optional[RequestLogger],
|
|
69
|
+
chat_template: Optional[str],
|
|
70
|
+
chat_template_content_format: ChatTemplateContentFormatOption,
|
|
71
|
+
trust_request_chat_template: bool = False,
|
|
72
|
+
return_tokens_as_token_ids: bool = False,
|
|
73
|
+
reasoning_parser: str = "",
|
|
74
|
+
enable_auto_tools: bool = False,
|
|
75
|
+
exclude_tools_when_tool_choice_none: bool = False,
|
|
76
|
+
tool_parser: Optional[str] = None,
|
|
77
|
+
enable_prompt_tokens_details: bool = False,
|
|
78
|
+
enable_force_include_usage: bool = False,
|
|
79
|
+
enable_log_outputs: bool = False,
|
|
80
|
+
log_error_stack: bool = False,
|
|
81
|
+
) -> None:
|
|
82
|
+
super().__init__(engine_client=engine_client,
|
|
83
|
+
model_config=model_config,
|
|
84
|
+
models=models,
|
|
85
|
+
request_logger=request_logger,
|
|
86
|
+
return_tokens_as_token_ids=return_tokens_as_token_ids,
|
|
87
|
+
enable_force_include_usage=enable_force_include_usage,
|
|
88
|
+
log_error_stack=log_error_stack)
|
|
89
|
+
|
|
90
|
+
self.response_role = response_role
|
|
91
|
+
self.chat_template = chat_template
|
|
92
|
+
self.chat_template_content_format: Final = chat_template_content_format
|
|
93
|
+
self.trust_request_chat_template = trust_request_chat_template
|
|
94
|
+
self.enable_log_outputs = enable_log_outputs
|
|
95
|
+
|
|
96
|
+
# set up tool use
|
|
97
|
+
self.enable_auto_tools: bool = enable_auto_tools
|
|
98
|
+
if self.enable_auto_tools:
|
|
99
|
+
logger.info(
|
|
100
|
+
"\"auto\" tool choice has been enabled please note that while"
|
|
101
|
+
" the parallel_tool_calls client option is preset for "
|
|
102
|
+
"compatibility reasons, it will be ignored.")
|
|
103
|
+
|
|
104
|
+
self.reasoning_parser: Optional[Callable[[AnyTokenizer],
|
|
105
|
+
ReasoningParser]] = None
|
|
106
|
+
if reasoning_parser:
|
|
107
|
+
try:
|
|
108
|
+
self.reasoning_parser = (
|
|
109
|
+
ReasoningParserManager.get_reasoning_parser(
|
|
110
|
+
reasoning_parser))
|
|
111
|
+
assert self.reasoning_parser is not None
|
|
112
|
+
except Exception as e:
|
|
113
|
+
raise TypeError(
|
|
114
|
+
f"{reasoning_parser=} has not been registered") from e
|
|
115
|
+
self.tool_parser: Optional[Callable[[AnyTokenizer], ToolParser]] = None
|
|
116
|
+
if self.enable_auto_tools:
|
|
117
|
+
try:
|
|
118
|
+
if (tool_parser == "pythonic" and
|
|
119
|
+
model_config.model.startswith("meta-llama/Llama-3.2")):
|
|
120
|
+
logger.warning(
|
|
121
|
+
"Llama3.2 models may struggle to emit valid pythonic"
|
|
122
|
+
" tool calls")
|
|
123
|
+
self.tool_parser = ToolParserManager.get_tool_parser(
|
|
124
|
+
tool_parser)
|
|
125
|
+
except Exception as e:
|
|
126
|
+
raise TypeError("Error: --enable-auto-tool-choice requires "
|
|
127
|
+
f"tool_parser:'{tool_parser}' which has not "
|
|
128
|
+
"been registered") from e
|
|
129
|
+
self.exclude_tools_when_tool_choice_none = (
|
|
130
|
+
exclude_tools_when_tool_choice_none)
|
|
131
|
+
|
|
132
|
+
self.enable_prompt_tokens_details = enable_prompt_tokens_details
|
|
133
|
+
self.enable_force_include_usage = enable_force_include_usage
|
|
134
|
+
self.default_sampling_params = (
|
|
135
|
+
self.model_config.get_diff_sampling_param())
|
|
136
|
+
if self.default_sampling_params:
|
|
137
|
+
source = self.model_config.generation_config
|
|
138
|
+
source = "model" if source == "auto" else source
|
|
139
|
+
logger.info("Using default chat sampling params from %s: %s",
|
|
140
|
+
source, self.default_sampling_params)
|
|
141
|
+
if self.model_config.hf_config.model_type == 'kimi_k2':
|
|
142
|
+
self.tool_call_id_type = 'kimi_k2'
|
|
143
|
+
else:
|
|
144
|
+
self.tool_call_id_type = 'random'
|
|
145
|
+
|
|
146
|
+
self.use_harmony = model_config.hf_config.model_type == "gpt_oss"
|
|
147
|
+
if self.use_harmony:
|
|
148
|
+
if "stop_token_ids" not in self.default_sampling_params:
|
|
149
|
+
self.default_sampling_params["stop_token_ids"] = []
|
|
150
|
+
self.default_sampling_params["stop_token_ids"].extend(
|
|
151
|
+
get_stop_tokens_for_assistant_actions())
|
|
152
|
+
|
|
153
|
+
# NOTE(woosuk): While OpenAI's chat completion API supports browsing
|
|
154
|
+
# for some models, currently vLLM doesn't support it. Please use the
|
|
155
|
+
# Responses API instead.
|
|
156
|
+
self.supports_browsing = False
|
|
157
|
+
self.browser_tool = None
|
|
158
|
+
# NOTE(woosuk): Chat completion API does not support code interpreter.
|
|
159
|
+
# Please use the Responses API instead.
|
|
160
|
+
self.supports_code_interpreter = False
|
|
161
|
+
self.python_tool = None
|
|
162
|
+
|
|
163
|
+
async def create_chat_completion(
|
|
164
|
+
self,
|
|
165
|
+
request: ChatCompletionRequest,
|
|
166
|
+
raw_request: Optional[Request] = None,
|
|
167
|
+
) -> Union[AsyncGenerator[str, None], ChatCompletionResponse,
|
|
168
|
+
ErrorResponse]:
|
|
169
|
+
"""
|
|
170
|
+
Chat Completion API similar to OpenAI's API.
|
|
171
|
+
|
|
172
|
+
See https://platform.openai.com/docs/api-reference/chat/create
|
|
173
|
+
for the API specification. This API mimics the OpenAI
|
|
174
|
+
Chat Completion API.
|
|
175
|
+
"""
|
|
176
|
+
error_check_ret = await self._check_model(request)
|
|
177
|
+
if error_check_ret is not None:
|
|
178
|
+
logger.error("Error with model %s", error_check_ret)
|
|
179
|
+
return error_check_ret
|
|
180
|
+
|
|
181
|
+
# If the engine is dead, raise the engine's DEAD_ERROR.
|
|
182
|
+
# This is required for the streaming case, where we return a
|
|
183
|
+
# success status before we actually start generating text :).
|
|
184
|
+
if self.engine_client.errored:
|
|
185
|
+
raise self.engine_client.dead_error
|
|
186
|
+
|
|
187
|
+
try:
|
|
188
|
+
lora_request = self._maybe_get_adapters(
|
|
189
|
+
request, supports_default_mm_loras=True)
|
|
190
|
+
|
|
191
|
+
model_name = self.models.model_name(lora_request)
|
|
192
|
+
|
|
193
|
+
tokenizer = await self.engine_client.get_tokenizer()
|
|
194
|
+
|
|
195
|
+
tool_parser = self.tool_parser
|
|
196
|
+
|
|
197
|
+
if isinstance(tokenizer, MistralTokenizer):
|
|
198
|
+
# because of issues with pydantic we need to potentially
|
|
199
|
+
# re-serialize the tool_calls field of the request
|
|
200
|
+
# for more info: see comment in `maybe_serialize_tool_calls`
|
|
201
|
+
maybe_serialize_tool_calls(request)
|
|
202
|
+
truncate_tool_call_ids(request)
|
|
203
|
+
validate_request_params(request)
|
|
204
|
+
|
|
205
|
+
if (request.tool_choice == "auto" and
|
|
206
|
+
not (self.enable_auto_tools and tool_parser is not None)
|
|
207
|
+
and not isinstance(tokenizer, MistralTokenizer)
|
|
208
|
+
and not self.use_harmony):
|
|
209
|
+
# for hf tokenizers, "auto" tools requires
|
|
210
|
+
# --enable-auto-tool-choice and --tool-call-parser
|
|
211
|
+
return self.create_error_response(
|
|
212
|
+
"\"auto\" tool choice requires "
|
|
213
|
+
"--enable-auto-tool-choice and --tool-call-parser to be set"
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
if (request.tools is None
|
|
217
|
+
or (request.tool_choice == "none"
|
|
218
|
+
and self.exclude_tools_when_tool_choice_none)):
|
|
219
|
+
tool_dicts = None
|
|
220
|
+
else:
|
|
221
|
+
tool_dicts = [tool.model_dump() for tool in request.tools]
|
|
222
|
+
|
|
223
|
+
if not self.use_harmony:
|
|
224
|
+
# Common case.
|
|
225
|
+
request_chat_template = request.chat_template
|
|
226
|
+
chat_template_kwargs = request.chat_template_kwargs
|
|
227
|
+
if not self.trust_request_chat_template and (
|
|
228
|
+
request_chat_template is not None or
|
|
229
|
+
(chat_template_kwargs and
|
|
230
|
+
chat_template_kwargs.get("chat_template") is not None)):
|
|
231
|
+
return self.create_error_response(
|
|
232
|
+
"Chat template is passed with request, but "
|
|
233
|
+
"--trust-request-chat-template is not set. "
|
|
234
|
+
"Refused request with untrusted chat template.")
|
|
235
|
+
(
|
|
236
|
+
conversation,
|
|
237
|
+
request_prompts,
|
|
238
|
+
engine_prompts,
|
|
239
|
+
) = await self._preprocess_chat(
|
|
240
|
+
request,
|
|
241
|
+
tokenizer,
|
|
242
|
+
request.messages,
|
|
243
|
+
chat_template=request_chat_template or self.chat_template,
|
|
244
|
+
chat_template_content_format=self.
|
|
245
|
+
chat_template_content_format,
|
|
246
|
+
add_generation_prompt=request.add_generation_prompt,
|
|
247
|
+
continue_final_message=request.continue_final_message,
|
|
248
|
+
tool_dicts=tool_dicts,
|
|
249
|
+
documents=request.documents,
|
|
250
|
+
chat_template_kwargs=request.chat_template_kwargs,
|
|
251
|
+
tool_parser=tool_parser,
|
|
252
|
+
add_special_tokens=request.add_special_tokens,
|
|
253
|
+
)
|
|
254
|
+
else:
|
|
255
|
+
# For GPT-OSS.
|
|
256
|
+
(
|
|
257
|
+
conversation,
|
|
258
|
+
request_prompts,
|
|
259
|
+
engine_prompts,
|
|
260
|
+
) = self._make_request_with_harmony(request)
|
|
261
|
+
except (ValueError, TypeError, RuntimeError,
|
|
262
|
+
jinja2.TemplateError) as e:
|
|
263
|
+
logger.exception("Error in preprocessing prompt inputs")
|
|
264
|
+
return self.create_error_response(f"{e} {e.__cause__}")
|
|
265
|
+
|
|
266
|
+
request_id = "chatcmpl-" \
|
|
267
|
+
f"{self._base_request_id(raw_request, request.request_id)}"
|
|
268
|
+
|
|
269
|
+
request_metadata = RequestResponseMetadata(request_id=request_id)
|
|
270
|
+
if raw_request:
|
|
271
|
+
raw_request.state.request_metadata = request_metadata
|
|
272
|
+
|
|
273
|
+
# Schedule the request and get the result generator.
|
|
274
|
+
generators: list[AsyncGenerator[RequestOutput, None]] = []
|
|
275
|
+
try:
|
|
276
|
+
for i, engine_prompt in enumerate(engine_prompts):
|
|
277
|
+
sampling_params: Union[SamplingParams, BeamSearchParams]
|
|
278
|
+
|
|
279
|
+
if self.default_sampling_params is None:
|
|
280
|
+
self.default_sampling_params = {}
|
|
281
|
+
|
|
282
|
+
max_tokens = get_max_tokens(
|
|
283
|
+
max_model_len=self.max_model_len,
|
|
284
|
+
request=request,
|
|
285
|
+
input_length=len(engine_prompt["prompt_token_ids"]),
|
|
286
|
+
default_sampling_params=self.default_sampling_params)
|
|
287
|
+
|
|
288
|
+
if request.use_beam_search:
|
|
289
|
+
sampling_params = request.to_beam_search_params(
|
|
290
|
+
max_tokens, self.default_sampling_params)
|
|
291
|
+
else:
|
|
292
|
+
sampling_params = request.to_sampling_params(
|
|
293
|
+
max_tokens, self.model_config.logits_processor_pattern,
|
|
294
|
+
self.default_sampling_params)
|
|
295
|
+
|
|
296
|
+
self._log_inputs(request_id,
|
|
297
|
+
request_prompts[i],
|
|
298
|
+
params=sampling_params,
|
|
299
|
+
lora_request=lora_request)
|
|
300
|
+
|
|
301
|
+
trace_headers = (None if raw_request is None else await
|
|
302
|
+
self._get_trace_headers(raw_request.headers))
|
|
303
|
+
|
|
304
|
+
if isinstance(sampling_params, BeamSearchParams):
|
|
305
|
+
generator = self.engine_client.beam_search(
|
|
306
|
+
prompt=engine_prompt,
|
|
307
|
+
request_id=request_id,
|
|
308
|
+
params=sampling_params,
|
|
309
|
+
lora_request=lora_request,
|
|
310
|
+
)
|
|
311
|
+
else:
|
|
312
|
+
generator = self.engine_client.generate(
|
|
313
|
+
engine_prompt,
|
|
314
|
+
sampling_params,
|
|
315
|
+
request_id,
|
|
316
|
+
lora_request=lora_request,
|
|
317
|
+
trace_headers=trace_headers,
|
|
318
|
+
priority=request.priority,
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
generators.append(generator)
|
|
322
|
+
except ValueError as e:
|
|
323
|
+
# TODO: Use a vllm-specific Validation Error
|
|
324
|
+
return self.create_error_response(str(e))
|
|
325
|
+
|
|
326
|
+
assert len(generators) == 1
|
|
327
|
+
result_generator, = generators
|
|
328
|
+
|
|
329
|
+
# Streaming response
|
|
330
|
+
if request.stream:
|
|
331
|
+
return self.chat_completion_stream_generator(
|
|
332
|
+
request,
|
|
333
|
+
result_generator,
|
|
334
|
+
request_id,
|
|
335
|
+
model_name,
|
|
336
|
+
conversation,
|
|
337
|
+
tokenizer,
|
|
338
|
+
request_metadata,
|
|
339
|
+
enable_force_include_usage=self.enable_force_include_usage)
|
|
340
|
+
|
|
341
|
+
try:
|
|
342
|
+
return await self.chat_completion_full_generator(
|
|
343
|
+
request, result_generator, request_id, model_name,
|
|
344
|
+
conversation, tokenizer, request_metadata)
|
|
345
|
+
except ValueError as e:
|
|
346
|
+
# TODO: Use a vllm-specific Validation Error
|
|
347
|
+
return self.create_error_response(str(e))
|
|
348
|
+
|
|
349
|
+
def get_chat_request_role(self, request: ChatCompletionRequest) -> str:
|
|
350
|
+
if request.add_generation_prompt:
|
|
351
|
+
return self.response_role
|
|
352
|
+
return request.messages[-1]["role"]
|
|
353
|
+
|
|
354
|
+
@staticmethod
|
|
355
|
+
def _bracket_level(s: str, opening='{', closing='}') -> int:
|
|
356
|
+
"""
|
|
357
|
+
Calculate the current level of nested brackets in a given string.
|
|
358
|
+
"""
|
|
359
|
+
level = 0
|
|
360
|
+
for char in s:
|
|
361
|
+
if char == opening:
|
|
362
|
+
level += 1
|
|
363
|
+
elif char == closing:
|
|
364
|
+
level -= 1
|
|
365
|
+
return level
|
|
366
|
+
|
|
367
|
+
@staticmethod
|
|
368
|
+
def _filter_delta_text(delta_text: str,
|
|
369
|
+
previous_text: str) -> tuple[str, bool]:
|
|
370
|
+
# remove last '},' of the tool definition stemming from the
|
|
371
|
+
# "name"/"parameters" outer object or closing ']' of the tool list
|
|
372
|
+
# count occurrences of opening and closing curly braces and
|
|
373
|
+
# once level 0 is reached stop outputting text
|
|
374
|
+
# if 0 is reached while parsing the delta_text we know the current
|
|
375
|
+
# tool will finish in this current iteration
|
|
376
|
+
bracket_level = OpenAIServingChat._bracket_level(previous_text)
|
|
377
|
+
updated_delta, passed_zero = "", False
|
|
378
|
+
for c in delta_text:
|
|
379
|
+
if c == '{':
|
|
380
|
+
bracket_level += 1
|
|
381
|
+
passed_zero = bracket_level == 0
|
|
382
|
+
elif c == '}':
|
|
383
|
+
bracket_level -= 1
|
|
384
|
+
passed_zero = bracket_level == 0
|
|
385
|
+
|
|
386
|
+
if bracket_level != 0:
|
|
387
|
+
updated_delta += c
|
|
388
|
+
else:
|
|
389
|
+
# if a comma is reached at level 0 we can stop
|
|
390
|
+
if c == ',':
|
|
391
|
+
break
|
|
392
|
+
return updated_delta, passed_zero
|
|
393
|
+
|
|
394
|
+
def extract_tool_call_required_streaming(
|
|
395
|
+
self,
|
|
396
|
+
previous_text: str,
|
|
397
|
+
current_text: Optional[str],
|
|
398
|
+
delta_text: str,
|
|
399
|
+
function_name_returned: bool,
|
|
400
|
+
tool_call_idx: Optional[int] = None
|
|
401
|
+
) -> tuple[Optional[DeltaMessage], bool]:
|
|
402
|
+
if current_text is None or current_text == "":
|
|
403
|
+
# if the current text is empty, we cannot parse it
|
|
404
|
+
return None, function_name_returned
|
|
405
|
+
try:
|
|
406
|
+
obj = partial_json_parser.loads(current_text)
|
|
407
|
+
except partial_json_parser.core.exceptions.MalformedJSON:
|
|
408
|
+
logger.debug('not enough tokens to parse into JSON yet')
|
|
409
|
+
obj = None
|
|
410
|
+
|
|
411
|
+
# check if the current text is a valid array
|
|
412
|
+
# containing a partial tool calling object
|
|
413
|
+
# if not repeat
|
|
414
|
+
if obj is None or not isinstance(obj, list) or not len(obj) > 0:
|
|
415
|
+
function_name_returned = False
|
|
416
|
+
delta_message = None
|
|
417
|
+
else:
|
|
418
|
+
_, finishes_previous_tool = OpenAIServingChat._filter_delta_text(
|
|
419
|
+
delta_text, previous_text)
|
|
420
|
+
# take the last tool call from the generated list
|
|
421
|
+
current_tool_call = obj[-1]
|
|
422
|
+
|
|
423
|
+
# once parameters have been generated the name is complete as well
|
|
424
|
+
if not finishes_previous_tool and ("name" not in current_tool_call
|
|
425
|
+
or "parameters"
|
|
426
|
+
not in current_tool_call):
|
|
427
|
+
function_name_returned = False
|
|
428
|
+
delta_message = None
|
|
429
|
+
else:
|
|
430
|
+
if not function_name_returned:
|
|
431
|
+
# get partly generated arguments from the latest tool call
|
|
432
|
+
param_match = re.search(r'.*"parameters":\s*(.*)',
|
|
433
|
+
current_text, re.DOTALL)
|
|
434
|
+
arguments = param_match.group(1) if param_match else ""
|
|
435
|
+
arguments, _ = OpenAIServingChat._filter_delta_text(
|
|
436
|
+
arguments, previous_text)
|
|
437
|
+
|
|
438
|
+
# if this iteration finishes a previous tool call but a
|
|
439
|
+
# new incomplete tool is already generated, take the
|
|
440
|
+
# previous from the list
|
|
441
|
+
if (finishes_previous_tool
|
|
442
|
+
and "parameters" not in current_tool_call):
|
|
443
|
+
current_tool_call = obj[-2]
|
|
444
|
+
|
|
445
|
+
function_name_returned = True
|
|
446
|
+
tool_call_id = make_tool_call_id(
|
|
447
|
+
id_type=self.tool_call_id_type,
|
|
448
|
+
func_name=current_tool_call["name"],
|
|
449
|
+
idx=tool_call_idx)
|
|
450
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
451
|
+
DeltaToolCall(id=tool_call_id,
|
|
452
|
+
function=DeltaFunctionCall(
|
|
453
|
+
name=current_tool_call["name"],
|
|
454
|
+
arguments=arguments),
|
|
455
|
+
index=len(obj) - 1,
|
|
456
|
+
type="function")
|
|
457
|
+
])
|
|
458
|
+
|
|
459
|
+
else:
|
|
460
|
+
delta_text, _ = OpenAIServingChat._filter_delta_text(
|
|
461
|
+
delta_text, previous_text)
|
|
462
|
+
|
|
463
|
+
if delta_text != "":
|
|
464
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
465
|
+
DeltaToolCall(
|
|
466
|
+
function=DeltaFunctionCall(
|
|
467
|
+
# OpenAI API returns None
|
|
468
|
+
# instead of name every time
|
|
469
|
+
name=None,
|
|
470
|
+
arguments=delta_text),
|
|
471
|
+
index=len(obj) - 1)
|
|
472
|
+
])
|
|
473
|
+
else:
|
|
474
|
+
delta_message = None
|
|
475
|
+
|
|
476
|
+
return delta_message, function_name_returned
|
|
477
|
+
|
|
478
|
+
async def chat_completion_stream_generator(
|
|
479
|
+
self,
|
|
480
|
+
request: ChatCompletionRequest,
|
|
481
|
+
result_generator: AsyncIterator[RequestOutput],
|
|
482
|
+
request_id: str,
|
|
483
|
+
model_name: str,
|
|
484
|
+
conversation: list[ConversationMessage],
|
|
485
|
+
tokenizer: AnyTokenizer,
|
|
486
|
+
request_metadata: RequestResponseMetadata,
|
|
487
|
+
enable_force_include_usage: bool,
|
|
488
|
+
) -> AsyncGenerator[str, None]:
|
|
489
|
+
created_time = int(time.time())
|
|
490
|
+
chunk_object_type: Final = "chat.completion.chunk"
|
|
491
|
+
first_iteration = True
|
|
492
|
+
|
|
493
|
+
# Send response for each token for each request.n (index)
|
|
494
|
+
num_choices = 1 if request.n is None else request.n
|
|
495
|
+
previous_num_tokens = [0] * num_choices
|
|
496
|
+
finish_reason_sent = [False] * num_choices
|
|
497
|
+
num_prompt_tokens = 0
|
|
498
|
+
num_cached_tokens = None
|
|
499
|
+
if self.use_harmony:
|
|
500
|
+
harmony_parsers = [
|
|
501
|
+
get_streamable_parser_for_assistant()
|
|
502
|
+
for _ in range(num_choices)
|
|
503
|
+
]
|
|
504
|
+
harmony_tools_streamed = [False] * num_choices
|
|
505
|
+
tools_streamed = [False] * num_choices
|
|
506
|
+
|
|
507
|
+
if isinstance(request.tool_choice, ChatCompletionNamedToolChoiceParam):
|
|
508
|
+
tool_choice_function_name = request.tool_choice.function.name
|
|
509
|
+
else:
|
|
510
|
+
tool_choice_function_name = None
|
|
511
|
+
|
|
512
|
+
# Determine whether tools are in use with "auto" tool choice
|
|
513
|
+
tool_choice_auto = (
|
|
514
|
+
not tool_choice_function_name
|
|
515
|
+
and self._should_stream_with_auto_tool_parsing(request))
|
|
516
|
+
|
|
517
|
+
all_previous_token_ids: Optional[list[list[int]]]
|
|
518
|
+
function_name_returned = [False] * num_choices
|
|
519
|
+
if self.tool_call_id_type == 'kimi_k2':
|
|
520
|
+
history_tool_call_cnt = get_history_tool_calls_cnt(conversation)
|
|
521
|
+
else:
|
|
522
|
+
history_tool_call_cnt = 0
|
|
523
|
+
|
|
524
|
+
# Always track previous_texts for comprehensive output logging
|
|
525
|
+
previous_texts = [""] * num_choices
|
|
526
|
+
|
|
527
|
+
# Only one of these will be used, thus previous_texts and
|
|
528
|
+
# all_previous_token_ids will not be used twice in the same iteration.
|
|
529
|
+
if tool_choice_auto or self.reasoning_parser:
|
|
530
|
+
# These are only required in "auto" tool choice case
|
|
531
|
+
all_previous_token_ids = [[]] * num_choices
|
|
532
|
+
# For reasoning parser and tool call all enabled
|
|
533
|
+
added_content_delta_arr = [False] * num_choices
|
|
534
|
+
reasoning_end_arr = [False] * num_choices
|
|
535
|
+
elif request.tool_choice == "required":
|
|
536
|
+
all_previous_token_ids = None
|
|
537
|
+
else:
|
|
538
|
+
all_previous_token_ids = None
|
|
539
|
+
|
|
540
|
+
try:
|
|
541
|
+
if self.reasoning_parser:
|
|
542
|
+
reasoning_parser = self.reasoning_parser(tokenizer)
|
|
543
|
+
except RuntimeError as e:
|
|
544
|
+
logger.exception("Error in reasoning parser creation.")
|
|
545
|
+
data = self.create_streaming_error_response(str(e))
|
|
546
|
+
yield f"data: {data}\n\n"
|
|
547
|
+
yield "data: [DONE]\n\n"
|
|
548
|
+
return
|
|
549
|
+
# Prepare the tool parser if it's needed
|
|
550
|
+
try:
|
|
551
|
+
if tool_choice_auto and self.tool_parser:
|
|
552
|
+
tool_parsers: list[Optional[ToolParser]] = [
|
|
553
|
+
self.tool_parser(tokenizer)
|
|
554
|
+
] * num_choices
|
|
555
|
+
else:
|
|
556
|
+
tool_parsers = [None] * num_choices
|
|
557
|
+
except Exception as e:
|
|
558
|
+
logger.exception("Error in tool parser creation.")
|
|
559
|
+
data = self.create_streaming_error_response(str(e))
|
|
560
|
+
yield f"data: {data}\n\n"
|
|
561
|
+
yield "data: [DONE]\n\n"
|
|
562
|
+
return
|
|
563
|
+
|
|
564
|
+
stream_options = request.stream_options
|
|
565
|
+
if stream_options:
|
|
566
|
+
include_usage = stream_options.include_usage \
|
|
567
|
+
or enable_force_include_usage
|
|
568
|
+
include_continuous_usage = include_usage and \
|
|
569
|
+
stream_options.continuous_usage_stats
|
|
570
|
+
else:
|
|
571
|
+
include_usage, include_continuous_usage = False, False
|
|
572
|
+
|
|
573
|
+
try:
|
|
574
|
+
async for res in result_generator:
|
|
575
|
+
if res.prompt_token_ids is not None:
|
|
576
|
+
num_prompt_tokens = len(res.prompt_token_ids)
|
|
577
|
+
if res.encoder_prompt_token_ids is not None:
|
|
578
|
+
num_prompt_tokens += len(res.encoder_prompt_token_ids)
|
|
579
|
+
|
|
580
|
+
# We need to do it here, because if there are exceptions in
|
|
581
|
+
# the result_generator, it needs to be sent as the FIRST
|
|
582
|
+
# response (by the try...catch).
|
|
583
|
+
if first_iteration:
|
|
584
|
+
num_cached_tokens = res.num_cached_tokens
|
|
585
|
+
# Send first response for each request.n (index) with
|
|
586
|
+
# the role
|
|
587
|
+
role = self.get_chat_request_role(request)
|
|
588
|
+
|
|
589
|
+
# NOTE num_choices defaults to 1 so this usually executes
|
|
590
|
+
# once per request
|
|
591
|
+
for i in range(num_choices):
|
|
592
|
+
choice_data = ChatCompletionResponseStreamChoice(
|
|
593
|
+
index=i,
|
|
594
|
+
delta=DeltaMessage(
|
|
595
|
+
role=role,
|
|
596
|
+
content="",
|
|
597
|
+
),
|
|
598
|
+
logprobs=None,
|
|
599
|
+
finish_reason=None)
|
|
600
|
+
|
|
601
|
+
# return prompt_token_ids at the first chunk ever
|
|
602
|
+
chunk = ChatCompletionStreamResponse(
|
|
603
|
+
id=request_id,
|
|
604
|
+
object=chunk_object_type,
|
|
605
|
+
created=created_time,
|
|
606
|
+
choices=[choice_data],
|
|
607
|
+
model=model_name,
|
|
608
|
+
prompt_token_ids=(res.prompt_token_ids
|
|
609
|
+
if request.return_token_ids else
|
|
610
|
+
None))
|
|
611
|
+
|
|
612
|
+
# if continuous usage stats are requested, add it
|
|
613
|
+
if include_continuous_usage:
|
|
614
|
+
chunk.usage = UsageInfo(
|
|
615
|
+
prompt_tokens=num_prompt_tokens,
|
|
616
|
+
completion_tokens=0,
|
|
617
|
+
total_tokens=num_prompt_tokens)
|
|
618
|
+
|
|
619
|
+
data = chunk.model_dump_json(exclude_unset=True)
|
|
620
|
+
yield f"data: {data}\n\n"
|
|
621
|
+
|
|
622
|
+
# Send response to echo the input portion of the
|
|
623
|
+
# last message
|
|
624
|
+
if request.echo:
|
|
625
|
+
last_msg_content: Union[str, list[dict[str, str]]] = ""
|
|
626
|
+
if conversation and "content" in conversation[
|
|
627
|
+
-1] and conversation[-1].get("role") == role:
|
|
628
|
+
last_msg_content = conversation[-1]["content"] or ""
|
|
629
|
+
|
|
630
|
+
if last_msg_content:
|
|
631
|
+
for i in range(num_choices):
|
|
632
|
+
choice_data = (
|
|
633
|
+
ChatCompletionResponseStreamChoice(
|
|
634
|
+
index=i,
|
|
635
|
+
delta=DeltaMessage(
|
|
636
|
+
content=last_msg_content),
|
|
637
|
+
logprobs=None,
|
|
638
|
+
finish_reason=None))
|
|
639
|
+
chunk = ChatCompletionStreamResponse(
|
|
640
|
+
id=request_id,
|
|
641
|
+
object=chunk_object_type,
|
|
642
|
+
created=created_time,
|
|
643
|
+
choices=[choice_data],
|
|
644
|
+
model=model_name)
|
|
645
|
+
if include_continuous_usage:
|
|
646
|
+
chunk.usage = UsageInfo(
|
|
647
|
+
prompt_tokens=num_prompt_tokens,
|
|
648
|
+
completion_tokens=0,
|
|
649
|
+
total_tokens=num_prompt_tokens)
|
|
650
|
+
|
|
651
|
+
data = chunk.model_dump_json(
|
|
652
|
+
exclude_unset=True)
|
|
653
|
+
yield f"data: {data}\n\n"
|
|
654
|
+
first_iteration = False
|
|
655
|
+
|
|
656
|
+
for output in res.outputs:
|
|
657
|
+
i = output.index
|
|
658
|
+
tool_parser = tool_parsers[i]
|
|
659
|
+
|
|
660
|
+
if finish_reason_sent[i]:
|
|
661
|
+
continue
|
|
662
|
+
|
|
663
|
+
if request.logprobs and request.top_logprobs is not None:
|
|
664
|
+
assert output.logprobs is not None, (
|
|
665
|
+
"Did not output logprobs")
|
|
666
|
+
logprobs = self._create_chat_logprobs(
|
|
667
|
+
token_ids=output.token_ids,
|
|
668
|
+
top_logprobs=output.logprobs,
|
|
669
|
+
tokenizer=tokenizer,
|
|
670
|
+
num_output_top_logprobs=request.top_logprobs,
|
|
671
|
+
return_as_token_id=request.
|
|
672
|
+
return_tokens_as_token_ids,
|
|
673
|
+
)
|
|
674
|
+
else:
|
|
675
|
+
logprobs = None
|
|
676
|
+
|
|
677
|
+
if self.use_harmony:
|
|
678
|
+
harmony_parser = harmony_parsers[i]
|
|
679
|
+
prev_recipient = harmony_parser.current_recipient
|
|
680
|
+
for token_id in output.token_ids:
|
|
681
|
+
harmony_parser.process(token_id)
|
|
682
|
+
cur_channel = harmony_parser.current_channel
|
|
683
|
+
cur_recipient = harmony_parser.current_recipient
|
|
684
|
+
delta_text = harmony_parser.last_content_delta or ""
|
|
685
|
+
else:
|
|
686
|
+
delta_text = output.text
|
|
687
|
+
|
|
688
|
+
if not delta_text and not output.token_ids and \
|
|
689
|
+
not previous_num_tokens[i]:
|
|
690
|
+
# Chunked prefill case, don't return empty chunks
|
|
691
|
+
continue
|
|
692
|
+
|
|
693
|
+
delta_message: Optional[DeltaMessage]
|
|
694
|
+
|
|
695
|
+
# just update previous_texts and previous_token_ids
|
|
696
|
+
if tool_choice_auto or self.reasoning_parser:
|
|
697
|
+
assert previous_texts is not None
|
|
698
|
+
assert all_previous_token_ids is not None
|
|
699
|
+
previous_text = previous_texts[i]
|
|
700
|
+
previous_token_ids = all_previous_token_ids[i]
|
|
701
|
+
current_text = previous_text + delta_text
|
|
702
|
+
# avoid the None + list error.
|
|
703
|
+
if previous_token_ids:
|
|
704
|
+
current_token_ids = previous_token_ids + as_list(
|
|
705
|
+
output.token_ids)
|
|
706
|
+
else:
|
|
707
|
+
current_token_ids = as_list(output.token_ids)
|
|
708
|
+
|
|
709
|
+
if self.use_harmony:
|
|
710
|
+
if cur_channel == "final":
|
|
711
|
+
delta_message = DeltaMessage(content=delta_text)
|
|
712
|
+
elif cur_channel == "analysis":
|
|
713
|
+
if request.include_reasoning:
|
|
714
|
+
delta_message = DeltaMessage(
|
|
715
|
+
reasoning_content=delta_text)
|
|
716
|
+
else:
|
|
717
|
+
delta_message = None
|
|
718
|
+
elif (cur_channel == "commentary" and cur_recipient
|
|
719
|
+
and cur_recipient.startswith("functions.")):
|
|
720
|
+
# Count completed tool calls to determine index
|
|
721
|
+
base_index = 0
|
|
722
|
+
for msg in harmony_parser.messages:
|
|
723
|
+
if (msg.channel == "commentary"
|
|
724
|
+
and msg.recipient
|
|
725
|
+
and msg.recipient.startswith(
|
|
726
|
+
"functions.")):
|
|
727
|
+
base_index += 1
|
|
728
|
+
|
|
729
|
+
if prev_recipient != cur_recipient:
|
|
730
|
+
tool_name = cur_recipient.split(
|
|
731
|
+
"functions.", 1)[1]
|
|
732
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
733
|
+
DeltaToolCall(
|
|
734
|
+
id=make_tool_call_id(),
|
|
735
|
+
type="function",
|
|
736
|
+
function=DeltaFunctionCall(
|
|
737
|
+
name=tool_name,
|
|
738
|
+
arguments="",
|
|
739
|
+
),
|
|
740
|
+
index=base_index,
|
|
741
|
+
)
|
|
742
|
+
])
|
|
743
|
+
elif delta_text:
|
|
744
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
745
|
+
DeltaToolCall(
|
|
746
|
+
index=base_index,
|
|
747
|
+
function=DeltaFunctionCall(
|
|
748
|
+
arguments=delta_text),
|
|
749
|
+
)
|
|
750
|
+
])
|
|
751
|
+
else:
|
|
752
|
+
delta_message = None
|
|
753
|
+
|
|
754
|
+
if delta_message is not None:
|
|
755
|
+
harmony_tools_streamed[i] = True
|
|
756
|
+
else:
|
|
757
|
+
delta_message = None
|
|
758
|
+
# handle streaming deltas for tools with named tool_choice
|
|
759
|
+
elif tool_choice_function_name:
|
|
760
|
+
if (self.reasoning_parser and not reasoning_end_arr[i]
|
|
761
|
+
and not reasoning_parser.is_reasoning_end(
|
|
762
|
+
previous_token_ids)):
|
|
763
|
+
assert reasoning_parser is not None
|
|
764
|
+
delta_message = (
|
|
765
|
+
reasoning_parser.
|
|
766
|
+
extract_reasoning_content_streaming(
|
|
767
|
+
previous_text,
|
|
768
|
+
current_text,
|
|
769
|
+
delta_text,
|
|
770
|
+
previous_token_ids,
|
|
771
|
+
current_token_ids,
|
|
772
|
+
output.token_ids,
|
|
773
|
+
))
|
|
774
|
+
# When encountering think end id in delta_token_ids
|
|
775
|
+
# or think end id in prompt_token_ids
|
|
776
|
+
# i.e {"enable_thinking": False},
|
|
777
|
+
# set reasoning status to end.
|
|
778
|
+
# Only keep 'content', remove 'reasoning_content'.
|
|
779
|
+
if reasoning_parser.is_reasoning_end(
|
|
780
|
+
as_list(output.token_ids)) or (
|
|
781
|
+
res.prompt_token_ids
|
|
782
|
+
and reasoning_parser.is_reasoning_end(
|
|
783
|
+
res.prompt_token_ids)):
|
|
784
|
+
reasoning_end_arr[i] = True
|
|
785
|
+
if delta_message and delta_message.content:
|
|
786
|
+
# This need to be added to next `delta_text`
|
|
787
|
+
current_text = delta_message.content
|
|
788
|
+
delta_message.content = None
|
|
789
|
+
else:
|
|
790
|
+
current_text = ""
|
|
791
|
+
else:
|
|
792
|
+
# Just to add remaining `content`
|
|
793
|
+
if self.reasoning_parser:
|
|
794
|
+
delta_text = previous_text + delta_text
|
|
795
|
+
current_text = ""
|
|
796
|
+
|
|
797
|
+
if function_name_returned[i]:
|
|
798
|
+
delta_tool_call = DeltaToolCall(
|
|
799
|
+
function=DeltaFunctionCall(
|
|
800
|
+
arguments=delta_text),
|
|
801
|
+
index=i)
|
|
802
|
+
else:
|
|
803
|
+
delta_tool_call = DeltaToolCall(
|
|
804
|
+
id=make_tool_call_id(),
|
|
805
|
+
type="function",
|
|
806
|
+
function=DeltaFunctionCall(
|
|
807
|
+
name=tool_choice_function_name,
|
|
808
|
+
arguments=delta_text),
|
|
809
|
+
index=i)
|
|
810
|
+
function_name_returned[i] = True
|
|
811
|
+
|
|
812
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
813
|
+
delta_tool_call,
|
|
814
|
+
])
|
|
815
|
+
tools_streamed[i] = True
|
|
816
|
+
|
|
817
|
+
elif request.tool_choice == "required":
|
|
818
|
+
assert previous_texts is not None
|
|
819
|
+
previous_text = previous_texts[i]
|
|
820
|
+
current_text = previous_text + delta_text
|
|
821
|
+
fn_name_returned = function_name_returned[i]
|
|
822
|
+
|
|
823
|
+
if self.reasoning_parser:
|
|
824
|
+
_, content = \
|
|
825
|
+
reasoning_parser.extract_reasoning_content(
|
|
826
|
+
current_text,
|
|
827
|
+
request
|
|
828
|
+
)
|
|
829
|
+
else:
|
|
830
|
+
content = current_text
|
|
831
|
+
delta_message, function_name_returned[i] = (
|
|
832
|
+
self.extract_tool_call_required_streaming(
|
|
833
|
+
previous_text=previous_text,
|
|
834
|
+
current_text=content,
|
|
835
|
+
delta_text=delta_text,
|
|
836
|
+
function_name_returned=fn_name_returned,
|
|
837
|
+
tool_call_idx=history_tool_call_cnt))
|
|
838
|
+
if (delta_message and delta_message.tool_calls and
|
|
839
|
+
delta_message.tool_calls[0].id is not None):
|
|
840
|
+
history_tool_call_cnt += 1
|
|
841
|
+
tools_streamed[i] = True
|
|
842
|
+
|
|
843
|
+
# handle streaming deltas for tools with "auto" tool choice
|
|
844
|
+
# and reasoning parser
|
|
845
|
+
elif tool_choice_auto and self.reasoning_parser:
|
|
846
|
+
assert tool_parser is not None
|
|
847
|
+
assert reasoning_parser is not None
|
|
848
|
+
assert added_content_delta_arr is not None
|
|
849
|
+
assert reasoning_end_arr is not None
|
|
850
|
+
output_token_ids = as_list(output.token_ids)
|
|
851
|
+
if not reasoning_end_arr[i]:
|
|
852
|
+
delta_message = (
|
|
853
|
+
reasoning_parser.
|
|
854
|
+
extract_reasoning_content_streaming(
|
|
855
|
+
previous_text,
|
|
856
|
+
current_text,
|
|
857
|
+
delta_text,
|
|
858
|
+
previous_token_ids,
|
|
859
|
+
current_token_ids,
|
|
860
|
+
output_token_ids,
|
|
861
|
+
))
|
|
862
|
+
# When encountering think end id in prompt_token_ids
|
|
863
|
+
# i.e {"enable_thinking": False},
|
|
864
|
+
# set reasoning status to end.
|
|
865
|
+
# Remove the text and token ids related
|
|
866
|
+
# to 'reasoning_content'.
|
|
867
|
+
if res.prompt_token_ids and \
|
|
868
|
+
reasoning_parser.is_reasoning_end(
|
|
869
|
+
res.prompt_token_ids):
|
|
870
|
+
reasoning_end_arr[i] = True
|
|
871
|
+
current_token_ids = output_token_ids
|
|
872
|
+
if delta_message and delta_message.content:
|
|
873
|
+
current_text = delta_message.content
|
|
874
|
+
delta_message.content = None
|
|
875
|
+
else:
|
|
876
|
+
current_text = ""
|
|
877
|
+
# When encountering think end id in delta_token_ids,
|
|
878
|
+
# set reasoning status to end.
|
|
879
|
+
# Remove the text and token ids related
|
|
880
|
+
# to 'reasoning_content'.
|
|
881
|
+
if reasoning_parser.is_reasoning_end(
|
|
882
|
+
output_token_ids):
|
|
883
|
+
reasoning_end_arr[i] = True
|
|
884
|
+
current_token_ids = \
|
|
885
|
+
reasoning_parser.extract_content_ids(
|
|
886
|
+
output_token_ids)
|
|
887
|
+
if delta_message and delta_message.content:
|
|
888
|
+
current_text = delta_message.content
|
|
889
|
+
delta_message.content = None
|
|
890
|
+
else:
|
|
891
|
+
current_text = ""
|
|
892
|
+
|
|
893
|
+
# handle tool calls only after reasoning is done,
|
|
894
|
+
else:
|
|
895
|
+
delta_token_ids = output_token_ids
|
|
896
|
+
# First time to tool call,
|
|
897
|
+
# add the remaining text and token ids
|
|
898
|
+
# to delta from previous
|
|
899
|
+
if not added_content_delta_arr[i]:
|
|
900
|
+
added_content_delta_arr[i] = True
|
|
901
|
+
previous_text = ""
|
|
902
|
+
previous_token_ids = []
|
|
903
|
+
delta_text = current_text
|
|
904
|
+
delta_token_ids = current_token_ids
|
|
905
|
+
|
|
906
|
+
delta_message = (
|
|
907
|
+
tool_parser.extract_tool_calls_streaming(
|
|
908
|
+
previous_text=previous_text,
|
|
909
|
+
current_text=current_text,
|
|
910
|
+
delta_text=delta_text,
|
|
911
|
+
previous_token_ids=previous_token_ids,
|
|
912
|
+
current_token_ids=current_token_ids,
|
|
913
|
+
delta_token_ids=delta_token_ids,
|
|
914
|
+
request=request))
|
|
915
|
+
if delta_message and delta_message.tool_calls:
|
|
916
|
+
tools_streamed[i] = True
|
|
917
|
+
# when only tool calls
|
|
918
|
+
elif tool_choice_auto:
|
|
919
|
+
assert tool_parser is not None
|
|
920
|
+
delta_message = (
|
|
921
|
+
tool_parser.extract_tool_calls_streaming(
|
|
922
|
+
previous_text=previous_text,
|
|
923
|
+
current_text=current_text,
|
|
924
|
+
delta_text=delta_text,
|
|
925
|
+
previous_token_ids=previous_token_ids,
|
|
926
|
+
current_token_ids=current_token_ids,
|
|
927
|
+
delta_token_ids=output.token_ids,
|
|
928
|
+
request=request))
|
|
929
|
+
if delta_message and delta_message.tool_calls:
|
|
930
|
+
tools_streamed[i] = True
|
|
931
|
+
|
|
932
|
+
# when only reasoning
|
|
933
|
+
elif self.reasoning_parser:
|
|
934
|
+
delta_message = (reasoning_parser.
|
|
935
|
+
extract_reasoning_content_streaming(
|
|
936
|
+
previous_text,
|
|
937
|
+
current_text,
|
|
938
|
+
delta_text,
|
|
939
|
+
previous_token_ids,
|
|
940
|
+
current_token_ids,
|
|
941
|
+
output.token_ids,
|
|
942
|
+
))
|
|
943
|
+
# handle streaming just a content delta
|
|
944
|
+
else:
|
|
945
|
+
delta_message = DeltaMessage(content=delta_text)
|
|
946
|
+
|
|
947
|
+
# update the previous values for the next iteration
|
|
948
|
+
if ((tool_choice_auto or self.reasoning_parser)
|
|
949
|
+
and not self.use_harmony):
|
|
950
|
+
assert previous_texts is not None
|
|
951
|
+
assert all_previous_token_ids is not None
|
|
952
|
+
previous_texts[i] = current_text
|
|
953
|
+
all_previous_token_ids[i] = current_token_ids
|
|
954
|
+
else:
|
|
955
|
+
# Update for comprehensive logging even in simple case
|
|
956
|
+
assert previous_texts is not None
|
|
957
|
+
previous_texts[i] += delta_text
|
|
958
|
+
|
|
959
|
+
# set the previous values for the next iteration
|
|
960
|
+
previous_num_tokens[i] += len(output.token_ids)
|
|
961
|
+
|
|
962
|
+
# if the message delta is None (e.g. because it was a
|
|
963
|
+
# "control token" for tool calls or the parser otherwise
|
|
964
|
+
# wasn't ready to send a token, then
|
|
965
|
+
# get the next token without streaming a chunk
|
|
966
|
+
if delta_message is None:
|
|
967
|
+
if output.finish_reason is None:
|
|
968
|
+
continue
|
|
969
|
+
else:
|
|
970
|
+
delta_message = DeltaMessage()
|
|
971
|
+
|
|
972
|
+
# Log streaming delta if output logging is enabled
|
|
973
|
+
if self.enable_log_outputs and self.request_logger:
|
|
974
|
+
delta_content = ""
|
|
975
|
+
if delta_message.content:
|
|
976
|
+
delta_content = delta_message.content
|
|
977
|
+
elif delta_message.tool_calls:
|
|
978
|
+
delta_content = "".join(
|
|
979
|
+
tc.function.arguments
|
|
980
|
+
for tc in delta_message.tool_calls
|
|
981
|
+
if tc.function and tc.function.arguments)
|
|
982
|
+
|
|
983
|
+
if delta_content:
|
|
984
|
+
self.request_logger.log_outputs(
|
|
985
|
+
request_id=request_id,
|
|
986
|
+
outputs=delta_content,
|
|
987
|
+
output_token_ids=as_list(output.token_ids),
|
|
988
|
+
finish_reason=output.finish_reason,
|
|
989
|
+
is_streaming=True,
|
|
990
|
+
delta=True,
|
|
991
|
+
)
|
|
992
|
+
|
|
993
|
+
if output.finish_reason is None:
|
|
994
|
+
# Send token-by-token response for each request.n
|
|
995
|
+
choice_data = ChatCompletionResponseStreamChoice(
|
|
996
|
+
index=i,
|
|
997
|
+
delta=delta_message,
|
|
998
|
+
logprobs=logprobs,
|
|
999
|
+
finish_reason=None,
|
|
1000
|
+
token_ids=(as_list(output.token_ids)
|
|
1001
|
+
if request.return_token_ids else None))
|
|
1002
|
+
|
|
1003
|
+
# if the model is finished generating
|
|
1004
|
+
else:
|
|
1005
|
+
# check to make sure we haven't "forgotten" to stream
|
|
1006
|
+
# any tokens that were generated but previously
|
|
1007
|
+
# matched by partial json parsing
|
|
1008
|
+
# only happens if we are NOT using structured outputs
|
|
1009
|
+
auto_tools_called = False
|
|
1010
|
+
if tool_parser:
|
|
1011
|
+
auto_tools_called = len(
|
|
1012
|
+
tool_parser.prev_tool_call_arr) > 0
|
|
1013
|
+
index = len(tool_parser.prev_tool_call_arr
|
|
1014
|
+
) - 1 if auto_tools_called else 0
|
|
1015
|
+
else:
|
|
1016
|
+
index = 0
|
|
1017
|
+
|
|
1018
|
+
if self._should_check_for_unstreamed_tool_arg_tokens(
|
|
1019
|
+
delta_message, output) and tool_parser:
|
|
1020
|
+
latest_delta_len = 0
|
|
1021
|
+
if ((isinstance(
|
|
1022
|
+
delta_message.tool_calls[0].function,
|
|
1023
|
+
DeltaFunctionCall)) and isinstance(
|
|
1024
|
+
delta_message.tool_calls[0].function.
|
|
1025
|
+
arguments, str)):
|
|
1026
|
+
latest_delta_len = len(
|
|
1027
|
+
delta_message.tool_calls[0].function.
|
|
1028
|
+
arguments)
|
|
1029
|
+
|
|
1030
|
+
# get the expected call based on partial JSON
|
|
1031
|
+
# parsing which "autocompletes" the JSON
|
|
1032
|
+
expected_call = json.dumps(
|
|
1033
|
+
tool_parser.prev_tool_call_arr[index].get(
|
|
1034
|
+
"arguments", {}),
|
|
1035
|
+
ensure_ascii=False)
|
|
1036
|
+
|
|
1037
|
+
# get what we've streamed so far for arguments
|
|
1038
|
+
# for the current tool
|
|
1039
|
+
actual_call = tool_parser.streamed_args_for_tool[
|
|
1040
|
+
index]
|
|
1041
|
+
if (latest_delta_len > 0):
|
|
1042
|
+
actual_call = actual_call[:-latest_delta_len]
|
|
1043
|
+
|
|
1044
|
+
# check to see if there's anything left to stream
|
|
1045
|
+
remaining_call = expected_call.replace(
|
|
1046
|
+
actual_call, "", 1)
|
|
1047
|
+
# set that as a delta message
|
|
1048
|
+
delta_message = DeltaMessage(tool_calls=[
|
|
1049
|
+
DeltaToolCall(index=index,
|
|
1050
|
+
function=DeltaFunctionCall(
|
|
1051
|
+
arguments=remaining_call).
|
|
1052
|
+
model_dump(exclude_none=True))
|
|
1053
|
+
])
|
|
1054
|
+
|
|
1055
|
+
# Send the finish response for each request.n only once
|
|
1056
|
+
if auto_tools_called or tools_streamed[i] or (
|
|
1057
|
+
self.use_harmony
|
|
1058
|
+
and harmony_tools_streamed[i]):
|
|
1059
|
+
finish_reason_ = "tool_calls"
|
|
1060
|
+
else:
|
|
1061
|
+
finish_reason_ = output.finish_reason \
|
|
1062
|
+
if output.finish_reason else "stop"
|
|
1063
|
+
choice_data = ChatCompletionResponseStreamChoice(
|
|
1064
|
+
index=i,
|
|
1065
|
+
delta=delta_message,
|
|
1066
|
+
logprobs=logprobs,
|
|
1067
|
+
finish_reason=finish_reason_,
|
|
1068
|
+
stop_reason=output.stop_reason,
|
|
1069
|
+
token_ids=(as_list(output.token_ids)
|
|
1070
|
+
if request.return_token_ids else None))
|
|
1071
|
+
|
|
1072
|
+
finish_reason_sent[i] = True
|
|
1073
|
+
|
|
1074
|
+
chunk = ChatCompletionStreamResponse(
|
|
1075
|
+
id=request_id,
|
|
1076
|
+
object=chunk_object_type,
|
|
1077
|
+
created=created_time,
|
|
1078
|
+
choices=[choice_data],
|
|
1079
|
+
model=model_name)
|
|
1080
|
+
|
|
1081
|
+
# handle usage stats if requested & if continuous
|
|
1082
|
+
if include_continuous_usage:
|
|
1083
|
+
completion_tokens = previous_num_tokens[i]
|
|
1084
|
+
chunk.usage = UsageInfo(
|
|
1085
|
+
prompt_tokens=num_prompt_tokens,
|
|
1086
|
+
completion_tokens=completion_tokens,
|
|
1087
|
+
total_tokens=num_prompt_tokens + completion_tokens,
|
|
1088
|
+
)
|
|
1089
|
+
|
|
1090
|
+
data = chunk.model_dump_json(exclude_unset=True)
|
|
1091
|
+
yield f"data: {data}\n\n"
|
|
1092
|
+
|
|
1093
|
+
# once the final token is handled, if stream_options.include_usage
|
|
1094
|
+
# is sent, send the usage
|
|
1095
|
+
if include_usage:
|
|
1096
|
+
completion_tokens = sum(previous_num_tokens)
|
|
1097
|
+
final_usage = UsageInfo(prompt_tokens=num_prompt_tokens,
|
|
1098
|
+
completion_tokens=completion_tokens,
|
|
1099
|
+
total_tokens=num_prompt_tokens +
|
|
1100
|
+
completion_tokens)
|
|
1101
|
+
if self.enable_prompt_tokens_details and num_cached_tokens:
|
|
1102
|
+
final_usage.prompt_tokens_details = PromptTokenUsageInfo(
|
|
1103
|
+
cached_tokens=num_cached_tokens)
|
|
1104
|
+
|
|
1105
|
+
final_usage_chunk = ChatCompletionStreamResponse(
|
|
1106
|
+
id=request_id,
|
|
1107
|
+
object=chunk_object_type,
|
|
1108
|
+
created=created_time,
|
|
1109
|
+
choices=[],
|
|
1110
|
+
model=model_name,
|
|
1111
|
+
usage=final_usage)
|
|
1112
|
+
final_usage_data = (final_usage_chunk.model_dump_json(
|
|
1113
|
+
exclude_unset=True, exclude_none=True))
|
|
1114
|
+
yield f"data: {final_usage_data}\n\n"
|
|
1115
|
+
|
|
1116
|
+
# report to FastAPI middleware aggregate usage across all choices
|
|
1117
|
+
num_completion_tokens = sum(previous_num_tokens)
|
|
1118
|
+
request_metadata.final_usage_info = UsageInfo(
|
|
1119
|
+
prompt_tokens=num_prompt_tokens,
|
|
1120
|
+
completion_tokens=num_completion_tokens,
|
|
1121
|
+
total_tokens=num_prompt_tokens + num_completion_tokens,
|
|
1122
|
+
)
|
|
1123
|
+
|
|
1124
|
+
# Log complete streaming response if output logging is enabled
|
|
1125
|
+
if self.enable_log_outputs and self.request_logger:
|
|
1126
|
+
# Log the complete response for each choice
|
|
1127
|
+
for i in range(num_choices):
|
|
1128
|
+
full_text = (
|
|
1129
|
+
previous_texts[i]
|
|
1130
|
+
if previous_texts and i < len(previous_texts) else
|
|
1131
|
+
f"<streaming_complete: {previous_num_tokens[i]} tokens>"
|
|
1132
|
+
)
|
|
1133
|
+
self.request_logger.log_outputs(
|
|
1134
|
+
request_id=request_id,
|
|
1135
|
+
outputs=full_text,
|
|
1136
|
+
output_token_ids=
|
|
1137
|
+
None, # Consider also logging all token IDs
|
|
1138
|
+
finish_reason="streaming_complete",
|
|
1139
|
+
is_streaming=True,
|
|
1140
|
+
delta=False,
|
|
1141
|
+
)
|
|
1142
|
+
|
|
1143
|
+
except Exception as e:
|
|
1144
|
+
# TODO: Use a vllm-specific Validation Error
|
|
1145
|
+
logger.exception("Error in chat completion stream generator.")
|
|
1146
|
+
data = self.create_streaming_error_response(str(e))
|
|
1147
|
+
yield f"data: {data}\n\n"
|
|
1148
|
+
# Send the final done message after all response.n are finished
|
|
1149
|
+
yield "data: [DONE]\n\n"
|
|
1150
|
+
|
|
1151
|
+
async def chat_completion_full_generator(
|
|
1152
|
+
self,
|
|
1153
|
+
request: ChatCompletionRequest,
|
|
1154
|
+
result_generator: AsyncIterator[RequestOutput],
|
|
1155
|
+
request_id: str,
|
|
1156
|
+
model_name: str,
|
|
1157
|
+
conversation: list[ConversationMessage],
|
|
1158
|
+
tokenizer: AnyTokenizer,
|
|
1159
|
+
request_metadata: RequestResponseMetadata,
|
|
1160
|
+
) -> Union[ErrorResponse, ChatCompletionResponse]:
|
|
1161
|
+
|
|
1162
|
+
created_time = int(time.time())
|
|
1163
|
+
final_res: Optional[RequestOutput] = None
|
|
1164
|
+
|
|
1165
|
+
try:
|
|
1166
|
+
async for res in result_generator:
|
|
1167
|
+
final_res = res
|
|
1168
|
+
except asyncio.CancelledError:
|
|
1169
|
+
return self.create_error_response("Client disconnected")
|
|
1170
|
+
except ValueError as e:
|
|
1171
|
+
# TODO: Use a vllm-specific Validation Error
|
|
1172
|
+
return self.create_error_response(str(e))
|
|
1173
|
+
|
|
1174
|
+
assert final_res is not None
|
|
1175
|
+
|
|
1176
|
+
choices: list[ChatCompletionResponseChoice] = []
|
|
1177
|
+
if self.tool_call_id_type == 'kimi_k2':
|
|
1178
|
+
history_tool_call_cnt = get_history_tool_calls_cnt(conversation)
|
|
1179
|
+
else:
|
|
1180
|
+
history_tool_call_cnt = 0
|
|
1181
|
+
|
|
1182
|
+
role = self.get_chat_request_role(request)
|
|
1183
|
+
for output in final_res.outputs:
|
|
1184
|
+
token_ids = output.token_ids
|
|
1185
|
+
out_logprobs = output.logprobs
|
|
1186
|
+
tool_call_info = None
|
|
1187
|
+
|
|
1188
|
+
if request.logprobs and request.top_logprobs is not None:
|
|
1189
|
+
assert out_logprobs is not None, "Did not output logprobs"
|
|
1190
|
+
logprobs = self._create_chat_logprobs(
|
|
1191
|
+
token_ids=token_ids,
|
|
1192
|
+
top_logprobs=out_logprobs,
|
|
1193
|
+
num_output_top_logprobs=request.top_logprobs,
|
|
1194
|
+
tokenizer=tokenizer,
|
|
1195
|
+
return_as_token_id=request.return_tokens_as_token_ids,
|
|
1196
|
+
)
|
|
1197
|
+
else:
|
|
1198
|
+
logprobs = None
|
|
1199
|
+
|
|
1200
|
+
if self.use_harmony:
|
|
1201
|
+
reasoning_content, content, _ = parse_chat_output(token_ids)
|
|
1202
|
+
if not request.include_reasoning:
|
|
1203
|
+
reasoning_content = None
|
|
1204
|
+
|
|
1205
|
+
if self.tool_parser is not None:
|
|
1206
|
+
tool_parser = self.tool_parser(tokenizer)
|
|
1207
|
+
# NOTE: We use token_ids for openai tool parser
|
|
1208
|
+
tool_call_info = tool_parser.extract_tool_calls(
|
|
1209
|
+
"",
|
|
1210
|
+
request=request,
|
|
1211
|
+
token_ids=token_ids, # type: ignore
|
|
1212
|
+
)
|
|
1213
|
+
content = tool_call_info.content
|
|
1214
|
+
message = ChatMessage(
|
|
1215
|
+
role=role,
|
|
1216
|
+
reasoning_content=reasoning_content,
|
|
1217
|
+
content=content,
|
|
1218
|
+
tool_calls=tool_call_info.tool_calls,
|
|
1219
|
+
)
|
|
1220
|
+
else:
|
|
1221
|
+
message = ChatMessage(
|
|
1222
|
+
role=role,
|
|
1223
|
+
reasoning_content=reasoning_content,
|
|
1224
|
+
content=content,
|
|
1225
|
+
)
|
|
1226
|
+
|
|
1227
|
+
choice_data = ChatCompletionResponseChoice(
|
|
1228
|
+
index=output.index,
|
|
1229
|
+
message=message,
|
|
1230
|
+
logprobs=logprobs,
|
|
1231
|
+
finish_reason="tool_calls" if
|
|
1232
|
+
(tool_call_info is not None
|
|
1233
|
+
and tool_call_info.tools_called) else
|
|
1234
|
+
output.finish_reason if output.finish_reason else "stop",
|
|
1235
|
+
stop_reason=output.stop_reason,
|
|
1236
|
+
)
|
|
1237
|
+
choices.append(choice_data)
|
|
1238
|
+
continue
|
|
1239
|
+
|
|
1240
|
+
if self.reasoning_parser:
|
|
1241
|
+
try:
|
|
1242
|
+
reasoning_parser = self.reasoning_parser(tokenizer)
|
|
1243
|
+
except RuntimeError as e:
|
|
1244
|
+
logger.exception("Error in reasoning parser creation.")
|
|
1245
|
+
return self.create_error_response(str(e))
|
|
1246
|
+
# If the reasoning parser is enabled,
|
|
1247
|
+
# tool calls are extracted exclusively from the content.
|
|
1248
|
+
reasoning_content, content = (
|
|
1249
|
+
reasoning_parser.extract_reasoning_content(
|
|
1250
|
+
output.text, request=request))
|
|
1251
|
+
if not request.include_reasoning:
|
|
1252
|
+
reasoning_content = None
|
|
1253
|
+
else:
|
|
1254
|
+
reasoning_content = None
|
|
1255
|
+
content = output.text
|
|
1256
|
+
|
|
1257
|
+
auto_tools_called = False
|
|
1258
|
+
# if auto tools are not enabled, and a named tool choice using
|
|
1259
|
+
# outlines is not being used
|
|
1260
|
+
if (not self.enable_auto_tools or not self.tool_parser) and \
|
|
1261
|
+
(not isinstance(request.tool_choice,
|
|
1262
|
+
ChatCompletionNamedToolChoiceParam
|
|
1263
|
+
) and request.tool_choice != "required"):
|
|
1264
|
+
message = ChatMessage(role=role,
|
|
1265
|
+
reasoning_content=reasoning_content,
|
|
1266
|
+
content=content)
|
|
1267
|
+
|
|
1268
|
+
# if the request uses tools and specified a tool choice
|
|
1269
|
+
elif request.tool_choice and type(
|
|
1270
|
+
request.tool_choice) is ChatCompletionNamedToolChoiceParam:
|
|
1271
|
+
|
|
1272
|
+
tool_call_class = MistralToolCall if isinstance(
|
|
1273
|
+
tokenizer, MistralTokenizer) else ToolCall
|
|
1274
|
+
message = ChatMessage(
|
|
1275
|
+
role=role,
|
|
1276
|
+
reasoning_content=reasoning_content,
|
|
1277
|
+
content="",
|
|
1278
|
+
tool_calls=[
|
|
1279
|
+
tool_call_class(function=FunctionCall(
|
|
1280
|
+
name=request.tool_choice.function.name,
|
|
1281
|
+
arguments=content,
|
|
1282
|
+
))
|
|
1283
|
+
],
|
|
1284
|
+
)
|
|
1285
|
+
|
|
1286
|
+
elif request.tool_choice and request.tool_choice == "required":
|
|
1287
|
+
tool_call_class = MistralToolCall if isinstance(
|
|
1288
|
+
tokenizer, MistralTokenizer) else ToolCall
|
|
1289
|
+
|
|
1290
|
+
# the fields of FunctionDefinition are a superset of the
|
|
1291
|
+
# tool call outputs and can be used for parsing
|
|
1292
|
+
assert content is not None
|
|
1293
|
+
tool_calls = TypeAdapter(
|
|
1294
|
+
list[FunctionDefinition]).validate_json(content)
|
|
1295
|
+
tool_call_ids = []
|
|
1296
|
+
for tool_call in tool_calls:
|
|
1297
|
+
tool_call_ids.append(
|
|
1298
|
+
make_tool_call_id(id_type=self.tool_call_id_type,
|
|
1299
|
+
func_name=tool_call.name,
|
|
1300
|
+
idx=history_tool_call_cnt))
|
|
1301
|
+
history_tool_call_cnt += 1
|
|
1302
|
+
message = ChatMessage(
|
|
1303
|
+
role=role,
|
|
1304
|
+
content="",
|
|
1305
|
+
tool_calls=[
|
|
1306
|
+
tool_call_class(id=tool_call_ids[i],
|
|
1307
|
+
function=FunctionCall(
|
|
1308
|
+
name=tool_call.name,
|
|
1309
|
+
arguments=json.dumps(
|
|
1310
|
+
tool_call.parameters,
|
|
1311
|
+
ensure_ascii=False)))
|
|
1312
|
+
for i, tool_call in enumerate(tool_calls)
|
|
1313
|
+
],
|
|
1314
|
+
reasoning_content=reasoning_content)
|
|
1315
|
+
|
|
1316
|
+
# if the request doesn't use tool choice
|
|
1317
|
+
# OR specifies to not use a tool
|
|
1318
|
+
elif not request.tool_choice or request.tool_choice == "none":
|
|
1319
|
+
|
|
1320
|
+
message = ChatMessage(role=role,
|
|
1321
|
+
reasoning_content=reasoning_content,
|
|
1322
|
+
content=content)
|
|
1323
|
+
|
|
1324
|
+
# handle when there are tools and tool choice is auto
|
|
1325
|
+
elif request.tools and (
|
|
1326
|
+
request.tool_choice == "auto"
|
|
1327
|
+
or request.tool_choice is None) and self.enable_auto_tools \
|
|
1328
|
+
and self.tool_parser:
|
|
1329
|
+
|
|
1330
|
+
try:
|
|
1331
|
+
tool_parser = self.tool_parser(tokenizer)
|
|
1332
|
+
except RuntimeError as e:
|
|
1333
|
+
logger.exception("Error in tool parser creation.")
|
|
1334
|
+
return self.create_error_response(str(e))
|
|
1335
|
+
|
|
1336
|
+
tool_call_info = tool_parser.extract_tool_calls(
|
|
1337
|
+
content if content is not None else "", request=request)
|
|
1338
|
+
# In the OpenAI API the finish_reason is "tools_called"
|
|
1339
|
+
# if the tool choice is auto and the model produced a tool
|
|
1340
|
+
# call. The same is not true for named function calls
|
|
1341
|
+
auto_tools_called = tool_call_info.tools_called
|
|
1342
|
+
if tool_call_info.tools_called:
|
|
1343
|
+
message = ChatMessage(role=role,
|
|
1344
|
+
reasoning_content=reasoning_content,
|
|
1345
|
+
content=tool_call_info.content,
|
|
1346
|
+
tool_calls=tool_call_info.tool_calls)
|
|
1347
|
+
|
|
1348
|
+
else:
|
|
1349
|
+
# FOR NOW make it a chat message; we will have to detect
|
|
1350
|
+
# the type to make it later.
|
|
1351
|
+
ret_content = content
|
|
1352
|
+
|
|
1353
|
+
# try to use content return from tool parser first,
|
|
1354
|
+
# tool parser may do some modify for the content.
|
|
1355
|
+
if (tool_call_info.content
|
|
1356
|
+
and len(tool_call_info.content) > 0):
|
|
1357
|
+
ret_content = tool_call_info.content
|
|
1358
|
+
message = ChatMessage(role=role,
|
|
1359
|
+
reasoning_content=reasoning_content,
|
|
1360
|
+
content=ret_content)
|
|
1361
|
+
|
|
1362
|
+
# undetermined case that is still important to handle
|
|
1363
|
+
else:
|
|
1364
|
+
logger.error(
|
|
1365
|
+
"Error in chat_completion_full_generator - cannot determine"
|
|
1366
|
+
" if tools should be extracted. Returning a standard chat "
|
|
1367
|
+
"completion.")
|
|
1368
|
+
message = ChatMessage(role=role,
|
|
1369
|
+
reasoning_content=reasoning_content,
|
|
1370
|
+
content=content)
|
|
1371
|
+
|
|
1372
|
+
choice_data = ChatCompletionResponseChoice(
|
|
1373
|
+
index=output.index,
|
|
1374
|
+
message=message,
|
|
1375
|
+
logprobs=logprobs,
|
|
1376
|
+
finish_reason="tool_calls" if auto_tools_called else
|
|
1377
|
+
output.finish_reason if output.finish_reason else "stop",
|
|
1378
|
+
stop_reason=output.stop_reason,
|
|
1379
|
+
token_ids=(as_list(output.token_ids)
|
|
1380
|
+
if request.return_token_ids else None),
|
|
1381
|
+
)
|
|
1382
|
+
|
|
1383
|
+
choices.append(choice_data)
|
|
1384
|
+
|
|
1385
|
+
if request.echo:
|
|
1386
|
+
last_msg_content: Union[str, list[dict[str, str]]] = ""
|
|
1387
|
+
if (conversation and "content" in conversation[-1]
|
|
1388
|
+
and conversation[-1].get("role") == role):
|
|
1389
|
+
last_msg_content = conversation[-1]["content"] or ""
|
|
1390
|
+
if isinstance(last_msg_content, list):
|
|
1391
|
+
last_msg_content = "\n".join(msg['text']
|
|
1392
|
+
for msg in last_msg_content)
|
|
1393
|
+
|
|
1394
|
+
for choice in choices:
|
|
1395
|
+
full_message = last_msg_content + (choice.message.content
|
|
1396
|
+
or "")
|
|
1397
|
+
choice.message.content = full_message
|
|
1398
|
+
|
|
1399
|
+
assert final_res.prompt_token_ids is not None
|
|
1400
|
+
num_prompt_tokens = len(final_res.prompt_token_ids)
|
|
1401
|
+
if final_res.encoder_prompt_token_ids is not None:
|
|
1402
|
+
num_prompt_tokens += len(final_res.encoder_prompt_token_ids)
|
|
1403
|
+
num_generated_tokens = sum(
|
|
1404
|
+
len(output.token_ids) for output in final_res.outputs)
|
|
1405
|
+
usage = UsageInfo(prompt_tokens=num_prompt_tokens,
|
|
1406
|
+
completion_tokens=num_generated_tokens,
|
|
1407
|
+
total_tokens=num_prompt_tokens +
|
|
1408
|
+
num_generated_tokens)
|
|
1409
|
+
if self.enable_prompt_tokens_details and final_res.num_cached_tokens:
|
|
1410
|
+
usage.prompt_tokens_details = PromptTokenUsageInfo(
|
|
1411
|
+
cached_tokens=final_res.num_cached_tokens)
|
|
1412
|
+
|
|
1413
|
+
request_metadata.final_usage_info = usage
|
|
1414
|
+
|
|
1415
|
+
response = ChatCompletionResponse(
|
|
1416
|
+
id=request_id,
|
|
1417
|
+
created=created_time,
|
|
1418
|
+
model=model_name,
|
|
1419
|
+
choices=choices,
|
|
1420
|
+
usage=usage,
|
|
1421
|
+
prompt_logprobs=clamp_prompt_logprobs(final_res.prompt_logprobs),
|
|
1422
|
+
prompt_token_ids=(final_res.prompt_token_ids
|
|
1423
|
+
if request.return_token_ids else None),
|
|
1424
|
+
kv_transfer_params=final_res.kv_transfer_params,
|
|
1425
|
+
)
|
|
1426
|
+
|
|
1427
|
+
# Log complete response if output logging is enabled
|
|
1428
|
+
if self.enable_log_outputs and self.request_logger:
|
|
1429
|
+
for choice in choices:
|
|
1430
|
+
output_text = ""
|
|
1431
|
+
if choice.message.content:
|
|
1432
|
+
output_text = choice.message.content
|
|
1433
|
+
elif choice.message.tool_calls:
|
|
1434
|
+
# For tool calls, log the function name and arguments
|
|
1435
|
+
tool_call_descriptions = []
|
|
1436
|
+
for tc in choice.message.tool_calls:
|
|
1437
|
+
if hasattr(tc.function, "name") and hasattr(
|
|
1438
|
+
tc.function, "arguments"):
|
|
1439
|
+
tool_call_descriptions.append(
|
|
1440
|
+
f"{tc.function.name}({tc.function.arguments})")
|
|
1441
|
+
tool_calls_str = ", ".join(tool_call_descriptions)
|
|
1442
|
+
output_text = f"[tool_calls: {tool_calls_str}]"
|
|
1443
|
+
|
|
1444
|
+
if output_text:
|
|
1445
|
+
# Get the corresponding output token IDs
|
|
1446
|
+
output_token_ids = None
|
|
1447
|
+
if choice.index < len(final_res.outputs):
|
|
1448
|
+
output_token_ids = final_res.outputs[
|
|
1449
|
+
choice.index].token_ids
|
|
1450
|
+
|
|
1451
|
+
self.request_logger.log_outputs(
|
|
1452
|
+
request_id=request_id,
|
|
1453
|
+
outputs=output_text,
|
|
1454
|
+
output_token_ids=output_token_ids,
|
|
1455
|
+
finish_reason=choice.finish_reason,
|
|
1456
|
+
is_streaming=False,
|
|
1457
|
+
delta=False,
|
|
1458
|
+
)
|
|
1459
|
+
|
|
1460
|
+
return response
|
|
1461
|
+
|
|
1462
|
+
def _get_top_logprobs(
|
|
1463
|
+
self, logprobs: dict[int, Logprob], top_logprobs: Optional[int],
|
|
1464
|
+
tokenizer: AnyTokenizer,
|
|
1465
|
+
should_return_as_token_id: bool) -> list[ChatCompletionLogProb]:
|
|
1466
|
+
return [
|
|
1467
|
+
ChatCompletionLogProb(
|
|
1468
|
+
token=(token := self._get_decoded_token(
|
|
1469
|
+
p[1],
|
|
1470
|
+
p[0],
|
|
1471
|
+
tokenizer,
|
|
1472
|
+
return_as_token_id=should_return_as_token_id,
|
|
1473
|
+
)),
|
|
1474
|
+
logprob=max(p[1].logprob, -9999.0),
|
|
1475
|
+
bytes=list(token.encode("utf-8", errors="replace")),
|
|
1476
|
+
) for i, p in enumerate(logprobs.items())
|
|
1477
|
+
if top_logprobs and i < top_logprobs
|
|
1478
|
+
]
|
|
1479
|
+
|
|
1480
|
+
def _create_chat_logprobs(
|
|
1481
|
+
self,
|
|
1482
|
+
token_ids: GenericSequence[int],
|
|
1483
|
+
top_logprobs: GenericSequence[Optional[dict[int, Logprob]]],
|
|
1484
|
+
tokenizer: AnyTokenizer,
|
|
1485
|
+
num_output_top_logprobs: Optional[int] = None,
|
|
1486
|
+
return_as_token_id: Optional[bool] = None,
|
|
1487
|
+
) -> ChatCompletionLogProbs:
|
|
1488
|
+
"""Create OpenAI-style logprobs."""
|
|
1489
|
+
logprobs_content: list[ChatCompletionLogProbsContent] = []
|
|
1490
|
+
|
|
1491
|
+
should_return_as_token_id = return_as_token_id if \
|
|
1492
|
+
return_as_token_id is not None else self.return_tokens_as_token_ids
|
|
1493
|
+
for i, token_id in enumerate(token_ids):
|
|
1494
|
+
step_top_logprobs = top_logprobs[i]
|
|
1495
|
+
if step_top_logprobs is None or step_top_logprobs.get(
|
|
1496
|
+
token_id) is None:
|
|
1497
|
+
if should_return_as_token_id:
|
|
1498
|
+
token = f"token_id:{token_id}"
|
|
1499
|
+
else:
|
|
1500
|
+
token = tokenizer.decode(token_id)
|
|
1501
|
+
|
|
1502
|
+
logprobs_content.append(
|
|
1503
|
+
ChatCompletionLogProbsContent(
|
|
1504
|
+
token=token,
|
|
1505
|
+
bytes=list(token.encode("utf-8", errors="replace")),
|
|
1506
|
+
))
|
|
1507
|
+
else:
|
|
1508
|
+
step_token = step_top_logprobs[token_id]
|
|
1509
|
+
step_decoded = step_token.decoded_token
|
|
1510
|
+
|
|
1511
|
+
logprobs_content.append(
|
|
1512
|
+
ChatCompletionLogProbsContent(
|
|
1513
|
+
token=self._get_decoded_token(
|
|
1514
|
+
step_token,
|
|
1515
|
+
token_id,
|
|
1516
|
+
tokenizer,
|
|
1517
|
+
should_return_as_token_id,
|
|
1518
|
+
),
|
|
1519
|
+
logprob=max(step_token.logprob, -9999.0),
|
|
1520
|
+
bytes=None if step_decoded is None else list(
|
|
1521
|
+
step_decoded.encode("utf-8", errors="replace")),
|
|
1522
|
+
top_logprobs=self._get_top_logprobs(
|
|
1523
|
+
step_top_logprobs, num_output_top_logprobs,
|
|
1524
|
+
tokenizer, should_return_as_token_id),
|
|
1525
|
+
))
|
|
1526
|
+
|
|
1527
|
+
return ChatCompletionLogProbs(content=logprobs_content)
|
|
1528
|
+
|
|
1529
|
+
def _should_stream_with_auto_tool_parsing(self,
|
|
1530
|
+
request: ChatCompletionRequest):
|
|
1531
|
+
"""
|
|
1532
|
+
Utility function to check if streamed tokens should go through the tool
|
|
1533
|
+
call parser that was configured.
|
|
1534
|
+
|
|
1535
|
+
We only want to do this IF user-provided tools are set, a tool parser
|
|
1536
|
+
is configured, "auto" tool choice is enabled, and the request's tool
|
|
1537
|
+
choice field indicates that "auto" tool choice should be used.
|
|
1538
|
+
"""
|
|
1539
|
+
return (request.tools and self.tool_parser and self.enable_auto_tools
|
|
1540
|
+
and request.tool_choice in ['auto', None])
|
|
1541
|
+
|
|
1542
|
+
def _should_check_for_unstreamed_tool_arg_tokens(
|
|
1543
|
+
self,
|
|
1544
|
+
delta_message: Optional[DeltaMessage],
|
|
1545
|
+
output: CompletionOutput,
|
|
1546
|
+
) -> bool:
|
|
1547
|
+
"""
|
|
1548
|
+
Check to see if we should check for unstreamed tool arguments tokens.
|
|
1549
|
+
This is only applicable when auto tool parsing is enabled, the delta
|
|
1550
|
+
is a tool call with arguments.
|
|
1551
|
+
"""
|
|
1552
|
+
|
|
1553
|
+
# yapf: disable
|
|
1554
|
+
return bool(
|
|
1555
|
+
# if there is a delta message that includes tool calls which
|
|
1556
|
+
# include a function that has arguments
|
|
1557
|
+
output.finish_reason is not None
|
|
1558
|
+
and self.enable_auto_tools and self.tool_parser and delta_message
|
|
1559
|
+
and delta_message.tool_calls and delta_message.tool_calls[0]
|
|
1560
|
+
and delta_message.tool_calls[0].function
|
|
1561
|
+
and delta_message.tool_calls[0].function.arguments is not None
|
|
1562
|
+
)
|
|
1563
|
+
|
|
1564
|
+
def _make_request_with_harmony(
|
|
1565
|
+
self,
|
|
1566
|
+
request: ChatCompletionRequest,
|
|
1567
|
+
):
|
|
1568
|
+
messages: list[OpenAIMessage] = []
|
|
1569
|
+
|
|
1570
|
+
# Add system message.
|
|
1571
|
+
# NOTE: In Chat Completion API, browsing is enabled by default
|
|
1572
|
+
# if the model supports it. TODO: Support browsing.
|
|
1573
|
+
assert not self.supports_browsing
|
|
1574
|
+
assert not self.supports_code_interpreter
|
|
1575
|
+
sys_msg = get_system_message(
|
|
1576
|
+
reasoning_effort=request.reasoning_effort,
|
|
1577
|
+
browser_description=None,
|
|
1578
|
+
python_description=None)
|
|
1579
|
+
messages.append(sys_msg)
|
|
1580
|
+
|
|
1581
|
+
# Add developer message.
|
|
1582
|
+
dev_msg = get_developer_message(tools=request.tools)
|
|
1583
|
+
messages.append(dev_msg)
|
|
1584
|
+
|
|
1585
|
+
# Add user message.
|
|
1586
|
+
for chat_msg in request.messages:
|
|
1587
|
+
messages.extend(parse_chat_input(chat_msg))
|
|
1588
|
+
|
|
1589
|
+
# Render prompt token ids.
|
|
1590
|
+
prompt_token_ids = render_for_completion(messages)
|
|
1591
|
+
engine_prompt = EngineTokensPrompt(prompt_token_ids=prompt_token_ids)
|
|
1592
|
+
|
|
1593
|
+
# Add cache_salt if provided in the request
|
|
1594
|
+
if request.cache_salt is not None:
|
|
1595
|
+
engine_prompt["cache_salt"] = request.cache_salt
|
|
1596
|
+
|
|
1597
|
+
return messages, [prompt_token_ids], [engine_prompt]
|