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,1670 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
3
|
+
|
|
4
|
+
# Adapted from
|
|
5
|
+
# https://github.com/huggingface/transformers/blob/19e6e80e10118f855137b90740936c0b11ac397f/src/transformers/models/qwen2_vl/modeling_qwen2_vl.py
|
|
6
|
+
# Copyright 2024 The Qwen team.
|
|
7
|
+
# Copyright 2023 The vLLM team.
|
|
8
|
+
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
|
|
9
|
+
#
|
|
10
|
+
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
|
|
11
|
+
# and OPT implementations in this library. It has been modified from its
|
|
12
|
+
# original forms to accommodate minor architectural differences compared
|
|
13
|
+
# to GPT-NeoX and OPT used by the Meta AI team that trained the model.
|
|
14
|
+
#
|
|
15
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
# you may not use this file except in compliance with the License.
|
|
17
|
+
# You may obtain a copy of the License at
|
|
18
|
+
#
|
|
19
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
#
|
|
21
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
22
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
+
# See the License for the specific language governing permissions and
|
|
25
|
+
# limitations under the License.
|
|
26
|
+
"""Inference-only Qwen2-VL model compatible with HuggingFace weights."""
|
|
27
|
+
from collections.abc import Iterable, Mapping, Sequence
|
|
28
|
+
from functools import partial
|
|
29
|
+
from typing import Annotated, Any, Callable, Literal, Optional, Union
|
|
30
|
+
|
|
31
|
+
import torch
|
|
32
|
+
import torch.nn as nn
|
|
33
|
+
import torch.nn.functional as F
|
|
34
|
+
from einops import rearrange, repeat
|
|
35
|
+
from transformers import AutoConfig, BatchFeature, PretrainedConfig
|
|
36
|
+
from transformers.models.qwen2_vl import (Qwen2VLImageProcessor,
|
|
37
|
+
Qwen2VLProcessor)
|
|
38
|
+
from transformers.models.qwen2_vl.configuration_qwen2_vl import (
|
|
39
|
+
Qwen2VLConfig, Qwen2VLVisionConfig)
|
|
40
|
+
from transformers.models.qwen2_vl.image_processing_qwen2_vl import smart_resize
|
|
41
|
+
from transformers.models.qwen2_vl.video_processing_qwen2_vl import (
|
|
42
|
+
Qwen2VLVideoProcessor)
|
|
43
|
+
|
|
44
|
+
from vllm.attention.layer import check_upstream_fa_availability
|
|
45
|
+
from vllm.config import VllmConfig
|
|
46
|
+
from vllm.distributed import parallel_state, tensor_model_parallel_all_gather
|
|
47
|
+
from vllm.distributed import utils as dist_utils
|
|
48
|
+
from vllm.logger import init_logger
|
|
49
|
+
from vllm.model_executor.layers.activation import QuickGELU
|
|
50
|
+
from vllm.model_executor.layers.linear import (ColumnParallelLinear,
|
|
51
|
+
RowParallelLinear)
|
|
52
|
+
from vllm.model_executor.layers.quantization import QuantizationConfig
|
|
53
|
+
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
|
|
54
|
+
from vllm.model_executor.models.module_mapping import MultiModelKeys
|
|
55
|
+
from vllm.multimodal import MULTIMODAL_REGISTRY
|
|
56
|
+
from vllm.multimodal.inputs import (ImageItem, ModalityData,
|
|
57
|
+
MultiModalDataDict, MultiModalFieldConfig,
|
|
58
|
+
MultiModalKwargsItems, VideoItem)
|
|
59
|
+
from vllm.multimodal.parse import (DictEmbeddingItems, ImageSize,
|
|
60
|
+
ModalityDataItems, MultiModalDataItems,
|
|
61
|
+
MultiModalDataParser)
|
|
62
|
+
from vllm.multimodal.processing import (BaseMultiModalProcessor,
|
|
63
|
+
BaseProcessingInfo, PromptReplacement,
|
|
64
|
+
PromptUpdate)
|
|
65
|
+
from vllm.multimodal.profiling import BaseDummyInputsBuilder
|
|
66
|
+
from vllm.platforms import _Backend, current_platform
|
|
67
|
+
from vllm.sequence import IntermediateTensors
|
|
68
|
+
from vllm.transformers_utils.config import uses_mrope
|
|
69
|
+
from vllm.transformers_utils.tokenizer import AnyTokenizer
|
|
70
|
+
from vllm.utils.tensor_schema import TensorSchema, TensorShape
|
|
71
|
+
|
|
72
|
+
from .interfaces import (MultiModalEmbeddings, SupportsLoRA, SupportsMRoPE,
|
|
73
|
+
SupportsMultiModal, SupportsPP)
|
|
74
|
+
from .utils import (AutoWeightsLoader, WeightsMapper,
|
|
75
|
+
init_vllm_registered_model, maybe_prefix,
|
|
76
|
+
merge_multimodal_embeddings)
|
|
77
|
+
from .vision import get_vit_attn_backend, run_dp_sharded_mrope_vision_model
|
|
78
|
+
|
|
79
|
+
logger = init_logger(__name__)
|
|
80
|
+
|
|
81
|
+
# For profile run
|
|
82
|
+
_MAX_FRAMES_PER_VIDEO = 14
|
|
83
|
+
|
|
84
|
+
# === Vision Inputs === #
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class Qwen2VLImagePixelInputs(TensorSchema):
|
|
88
|
+
"""
|
|
89
|
+
Dimensions:
|
|
90
|
+
- np: The total number of patches over each image over each prompt in
|
|
91
|
+
the batch
|
|
92
|
+
- ni: Number of images
|
|
93
|
+
- cps: Number of channels * patch_size * patch_size
|
|
94
|
+
|
|
95
|
+
Historical context:
|
|
96
|
+
- pixel_values shape: (num_patches, num_channels * patch_size *
|
|
97
|
+
patch_size)
|
|
98
|
+
- image_grid_thw shape: (num_images, 3) in (grid_t, grid_h, grid_w)
|
|
99
|
+
format
|
|
100
|
+
"""
|
|
101
|
+
type: Literal["pixel_values"]
|
|
102
|
+
|
|
103
|
+
pixel_values: Annotated[
|
|
104
|
+
torch.Tensor,
|
|
105
|
+
TensorShape("np", "cps"),
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
image_grid_thw: Annotated[
|
|
109
|
+
torch.Tensor,
|
|
110
|
+
TensorShape("ni", 3),
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class Qwen2VLImageEmbeddingInputs(TensorSchema):
|
|
115
|
+
"""
|
|
116
|
+
Dimensions:
|
|
117
|
+
- nf: Number of image features
|
|
118
|
+
- hs: Hidden size
|
|
119
|
+
- ni: Number of images
|
|
120
|
+
|
|
121
|
+
Historical context:
|
|
122
|
+
- image_embeds shape: (num_image_features, hidden_size)
|
|
123
|
+
- num_image_features varies based on the number and resolution of the
|
|
124
|
+
images.
|
|
125
|
+
- hidden_size must match the hidden size of language model backbone.
|
|
126
|
+
- image_grid_thw shape: (num_images, 3) in (grid_t, grid_h, grid_w)
|
|
127
|
+
format
|
|
128
|
+
"""
|
|
129
|
+
type: Literal["image_embeds"]
|
|
130
|
+
|
|
131
|
+
image_embeds: Annotated[
|
|
132
|
+
torch.Tensor,
|
|
133
|
+
TensorShape("nf", "hs"),
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
image_grid_thw: Annotated[
|
|
137
|
+
torch.Tensor,
|
|
138
|
+
TensorShape("ni", 3),
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
Qwen2VLImageInputs = Union[Qwen2VLImagePixelInputs,
|
|
143
|
+
Qwen2VLImageEmbeddingInputs]
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class Qwen2VLVideoPixelInputs(TensorSchema):
|
|
147
|
+
"""
|
|
148
|
+
Dimensions:
|
|
149
|
+
- np: The total number of patches over each video over each prompt in
|
|
150
|
+
the batch
|
|
151
|
+
- ctps: Number of channels * temporal_patch_size * patch_size *
|
|
152
|
+
patch_size
|
|
153
|
+
- nv: Number of videos
|
|
154
|
+
|
|
155
|
+
Historical context:
|
|
156
|
+
- pixel_values_videos shape: (num_patches, num_channels *
|
|
157
|
+
temporal_patch_size * patch_size * patch_size)
|
|
158
|
+
- video_grid_thw shape: (num_videos, 3) in (grid_t, grid_h, grid_w)
|
|
159
|
+
format
|
|
160
|
+
"""
|
|
161
|
+
type: Literal["pixel_values_videos"]
|
|
162
|
+
|
|
163
|
+
pixel_values_videos: Annotated[
|
|
164
|
+
torch.Tensor,
|
|
165
|
+
TensorShape("np", "ctps"),
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
video_grid_thw: Annotated[
|
|
169
|
+
torch.Tensor,
|
|
170
|
+
TensorShape("nv", 3),
|
|
171
|
+
]
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class Qwen2VLVideoEmbeddingInputs(TensorSchema):
|
|
175
|
+
"""
|
|
176
|
+
Dimensions:
|
|
177
|
+
- nf: Number of video features
|
|
178
|
+
- hs: Hidden size
|
|
179
|
+
- nv: Number of videos
|
|
180
|
+
|
|
181
|
+
Historical context:
|
|
182
|
+
- video_embeds shape: (num_video_features, hidden_size)
|
|
183
|
+
- num_video_features varies based on the number and resolution of the
|
|
184
|
+
videos.
|
|
185
|
+
- hidden_size must match the hidden size of language model backbone.
|
|
186
|
+
- video_grid_thw shape: (num_videos, 3) in (grid_t, grid_h, grid_w)
|
|
187
|
+
format
|
|
188
|
+
"""
|
|
189
|
+
type: Literal["video_embeds"]
|
|
190
|
+
|
|
191
|
+
video_embeds: Annotated[
|
|
192
|
+
torch.Tensor,
|
|
193
|
+
TensorShape("nf", "hs"),
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
video_grid_thw: Annotated[
|
|
197
|
+
torch.Tensor,
|
|
198
|
+
TensorShape("nv", 3),
|
|
199
|
+
]
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
Qwen2VLVideoInputs = Union[Qwen2VLVideoPixelInputs,
|
|
203
|
+
Qwen2VLVideoEmbeddingInputs]
|
|
204
|
+
|
|
205
|
+
# === Vision Encoder === #
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class Qwen2VisionMLP(nn.Module):
|
|
209
|
+
|
|
210
|
+
def __init__(
|
|
211
|
+
self,
|
|
212
|
+
in_features: int,
|
|
213
|
+
hidden_features: int,
|
|
214
|
+
act_layer: type[nn.Module] = QuickGELU,
|
|
215
|
+
quant_config: Optional[QuantizationConfig] = None,
|
|
216
|
+
prefix: str = "",
|
|
217
|
+
use_data_parallel: bool = False,
|
|
218
|
+
):
|
|
219
|
+
super().__init__()
|
|
220
|
+
self.fc1 = ColumnParallelLinear(in_features,
|
|
221
|
+
hidden_features,
|
|
222
|
+
quant_config=quant_config,
|
|
223
|
+
prefix=f"{prefix}.fc1",
|
|
224
|
+
disable_tp=use_data_parallel)
|
|
225
|
+
self.act = act_layer()
|
|
226
|
+
self.fc2 = RowParallelLinear(hidden_features,
|
|
227
|
+
in_features,
|
|
228
|
+
quant_config=quant_config,
|
|
229
|
+
prefix=f"{prefix}.fc2",
|
|
230
|
+
disable_tp=use_data_parallel)
|
|
231
|
+
|
|
232
|
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
|
233
|
+
x_parallel, _ = self.fc1(x)
|
|
234
|
+
x_parallel = self.act(x_parallel)
|
|
235
|
+
x, _ = self.fc2(x_parallel)
|
|
236
|
+
return x
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def rotate_half(x: torch.Tensor, interleaved: bool = False) -> torch.Tensor:
|
|
240
|
+
if not interleaved:
|
|
241
|
+
x1, x2 = x.chunk(2, dim=-1)
|
|
242
|
+
return torch.cat((-x2, x1), dim=-1)
|
|
243
|
+
else:
|
|
244
|
+
x1, x2 = x[..., ::2], x[..., 1::2]
|
|
245
|
+
return rearrange(torch.stack((-x2, x1), dim=-1),
|
|
246
|
+
"... d two -> ... (d two)",
|
|
247
|
+
two=2)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def apply_rotary_emb_torch(x: torch.Tensor,
|
|
251
|
+
cos: torch.Tensor,
|
|
252
|
+
sin: torch.Tensor,
|
|
253
|
+
interleaved: bool = False) -> torch.Tensor:
|
|
254
|
+
"""
|
|
255
|
+
x: (batch_size, seqlen, nheads, headdim)
|
|
256
|
+
cos, sin: (seqlen, rotary_dim / 2) or (batch_size, seqlen, rotary_dim / 2)
|
|
257
|
+
"""
|
|
258
|
+
ro_dim = cos.shape[-1] * 2
|
|
259
|
+
assert ro_dim <= x.shape[-1]
|
|
260
|
+
cos = repeat(
|
|
261
|
+
cos,
|
|
262
|
+
"... d -> ... 1 (2 d)" if not interleaved else "... d -> ... 1 (d 2)")
|
|
263
|
+
sin = repeat(
|
|
264
|
+
sin,
|
|
265
|
+
"... d -> ... 1 (2 d)" if not interleaved else "... d -> ... 1 (d 2)")
|
|
266
|
+
return torch.cat(
|
|
267
|
+
[
|
|
268
|
+
x[..., :ro_dim] * cos +
|
|
269
|
+
rotate_half(x[..., :ro_dim], interleaved) * sin, x[..., ro_dim:]
|
|
270
|
+
],
|
|
271
|
+
dim=-1,
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
def apply_rotary_pos_emb_vision(t: torch.Tensor,
|
|
276
|
+
freqs: torch.Tensor) -> torch.Tensor:
|
|
277
|
+
t_ = t.float()
|
|
278
|
+
cos = freqs.cos()
|
|
279
|
+
sin = freqs.sin()
|
|
280
|
+
apply_rotary_emb = apply_rotary_emb_torch
|
|
281
|
+
if current_platform.is_cuda():
|
|
282
|
+
from vllm.vllm_flash_attn.layers.rotary import apply_rotary_emb
|
|
283
|
+
output = apply_rotary_emb(t_, cos, sin).type_as(t)
|
|
284
|
+
return output
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
class Qwen2VisionAttention(nn.Module):
|
|
288
|
+
|
|
289
|
+
def __init__(
|
|
290
|
+
self,
|
|
291
|
+
embed_dim: int,
|
|
292
|
+
num_heads: int,
|
|
293
|
+
projection_size: int,
|
|
294
|
+
quant_config: Optional[QuantizationConfig] = None,
|
|
295
|
+
prefix: str = "",
|
|
296
|
+
use_data_parallel: bool = False,
|
|
297
|
+
) -> None:
|
|
298
|
+
super().__init__()
|
|
299
|
+
# Per attention head and per partition values.
|
|
300
|
+
self.tp_size = (1 if use_data_parallel else
|
|
301
|
+
parallel_state.get_tensor_model_parallel_world_size())
|
|
302
|
+
self.tp_rank = parallel_state.get_tensor_model_parallel_rank()
|
|
303
|
+
self.hidden_size_per_attention_head = dist_utils.divide(
|
|
304
|
+
projection_size, num_heads)
|
|
305
|
+
self.num_attention_heads_per_partition = dist_utils.divide(
|
|
306
|
+
num_heads, self.tp_size)
|
|
307
|
+
|
|
308
|
+
self.qkv = ColumnParallelLinear(input_size=embed_dim,
|
|
309
|
+
output_size=3 * projection_size,
|
|
310
|
+
quant_config=quant_config,
|
|
311
|
+
prefix=f"{prefix}.qkv",
|
|
312
|
+
disable_tp=use_data_parallel)
|
|
313
|
+
self.proj = RowParallelLinear(input_size=projection_size,
|
|
314
|
+
output_size=embed_dim,
|
|
315
|
+
quant_config=quant_config,
|
|
316
|
+
prefix=f"{prefix}.proj",
|
|
317
|
+
disable_tp=use_data_parallel)
|
|
318
|
+
|
|
319
|
+
# Detect attention implementation.
|
|
320
|
+
self.attn_backend = get_vit_attn_backend(
|
|
321
|
+
head_size=self.hidden_size_per_attention_head,
|
|
322
|
+
dtype=torch.get_default_dtype())
|
|
323
|
+
self.use_upstream_fa = False
|
|
324
|
+
if self.attn_backend != _Backend.FLASH_ATTN and \
|
|
325
|
+
check_upstream_fa_availability(
|
|
326
|
+
torch.get_default_dtype()):
|
|
327
|
+
self.attn_backend = _Backend.FLASH_ATTN
|
|
328
|
+
self.use_upstream_fa = True
|
|
329
|
+
|
|
330
|
+
if self.attn_backend not in {
|
|
331
|
+
_Backend.FLASH_ATTN, _Backend.TORCH_SDPA, _Backend.XFORMERS,
|
|
332
|
+
_Backend.ROCM_AITER_FA
|
|
333
|
+
}:
|
|
334
|
+
raise RuntimeError(
|
|
335
|
+
f"Qwen2-VL does not support {self.attn_backend} backend now.")
|
|
336
|
+
self.is_flash_attn_backend = self.attn_backend in {
|
|
337
|
+
_Backend.FLASH_ATTN, _Backend.ROCM_AITER_FA
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
def split_qkv(self, qkv: torch.Tensor) -> tuple[torch.Tensor, ...]:
|
|
341
|
+
# [s, b, 3 * head * head_dim]
|
|
342
|
+
seq_len, bs, _ = qkv.shape
|
|
343
|
+
if self.tp_size > 1:
|
|
344
|
+
qkv = tensor_model_parallel_all_gather(qkv)
|
|
345
|
+
|
|
346
|
+
# [s, b, 3 * head * head_dim] -> 3 * [s, b, head * head_dim]
|
|
347
|
+
q, k, v = qkv.chunk(3, dim=2)
|
|
348
|
+
|
|
349
|
+
# 3 * [s, b, head * head_dim]
|
|
350
|
+
if self.tp_size > 1:
|
|
351
|
+
splitter = partial(dist_utils.split_tensor_along_last_dim,
|
|
352
|
+
num_partitions=self.tp_size)
|
|
353
|
+
q = splitter(q)[self.tp_rank]
|
|
354
|
+
k = splitter(k)[self.tp_rank]
|
|
355
|
+
v = splitter(v)[self.tp_rank]
|
|
356
|
+
|
|
357
|
+
# 3 * [s, b, head * head_dim] -> 3 * [s, b, head, head_dim]
|
|
358
|
+
new_shape = (seq_len, bs, self.num_attention_heads_per_partition,
|
|
359
|
+
self.hidden_size_per_attention_head)
|
|
360
|
+
q, k, v = (x.view(*new_shape) for x in (q, k, v))
|
|
361
|
+
return q, k, v
|
|
362
|
+
|
|
363
|
+
def forward(
|
|
364
|
+
self,
|
|
365
|
+
x: torch.Tensor,
|
|
366
|
+
cu_seqlens: torch.Tensor,
|
|
367
|
+
rotary_pos_emb: torch.Tensor,
|
|
368
|
+
max_seqlen: Optional[int] = None, # Only used for Flash Attention
|
|
369
|
+
seqlens: Optional[list[int]] = None, # Only used for xFormers
|
|
370
|
+
) -> torch.Tensor:
|
|
371
|
+
|
|
372
|
+
# [s, b, c] --> [s, b, 3 * head * head_dim]
|
|
373
|
+
x, _ = self.qkv(x)
|
|
374
|
+
|
|
375
|
+
# [s, b, 3 * head * head_dim] -> 3 * [s, b, head, head_dim]
|
|
376
|
+
q, k, v = self.split_qkv(x)
|
|
377
|
+
batch_size = q.shape[1]
|
|
378
|
+
|
|
379
|
+
q, k, v = (rearrange(x, "s b ... -> b s ...").contiguous()
|
|
380
|
+
for x in (q, k, v))
|
|
381
|
+
if rotary_pos_emb is not None:
|
|
382
|
+
# [2 * b, s, heads, head_dim]
|
|
383
|
+
qk_concat = torch.cat([q, k], dim=0)
|
|
384
|
+
qk_rotated = apply_rotary_pos_emb_vision(qk_concat, rotary_pos_emb)
|
|
385
|
+
q, k = torch.chunk(qk_rotated, 2, dim=0)
|
|
386
|
+
|
|
387
|
+
if self.is_flash_attn_backend:
|
|
388
|
+
if self.attn_backend == _Backend.ROCM_AITER_FA:
|
|
389
|
+
from aiter import flash_attn_varlen_func
|
|
390
|
+
else:
|
|
391
|
+
if self.use_upstream_fa:
|
|
392
|
+
from flash_attn import flash_attn_varlen_func
|
|
393
|
+
else:
|
|
394
|
+
from vllm.vllm_flash_attn import flash_attn_varlen_func
|
|
395
|
+
|
|
396
|
+
q, k, v = (rearrange(x, "b s ... -> (b s) ...") for x in [q, k, v])
|
|
397
|
+
|
|
398
|
+
output = flash_attn_varlen_func(q,
|
|
399
|
+
k,
|
|
400
|
+
v,
|
|
401
|
+
cu_seqlens_q=cu_seqlens,
|
|
402
|
+
cu_seqlens_k=cu_seqlens,
|
|
403
|
+
max_seqlen_q=max_seqlen,
|
|
404
|
+
max_seqlen_k=max_seqlen,
|
|
405
|
+
dropout_p=0.0,
|
|
406
|
+
causal=False)
|
|
407
|
+
|
|
408
|
+
context_layer = rearrange(output,
|
|
409
|
+
"(b s) h d -> s b (h d)",
|
|
410
|
+
b=batch_size).contiguous()
|
|
411
|
+
elif self.attn_backend == _Backend.TORCH_SDPA:
|
|
412
|
+
# Execute attention entry by entry for speed & less VRAM.
|
|
413
|
+
outputs = []
|
|
414
|
+
for i in range(1, len(cu_seqlens)):
|
|
415
|
+
start_idx = cu_seqlens[i - 1]
|
|
416
|
+
end_idx = cu_seqlens[i]
|
|
417
|
+
q_i = q[:, start_idx:end_idx]
|
|
418
|
+
k_i = k[:, start_idx:end_idx]
|
|
419
|
+
v_i = v[:, start_idx:end_idx]
|
|
420
|
+
q_i, k_i, v_i = (rearrange(x, "b s h d -> b h s d")
|
|
421
|
+
for x in [q_i, k_i, v_i])
|
|
422
|
+
output_i = F.scaled_dot_product_attention(q_i,
|
|
423
|
+
k_i,
|
|
424
|
+
v_i,
|
|
425
|
+
dropout_p=0.0)
|
|
426
|
+
output_i = rearrange(output_i, "b h s d -> b s h d ")
|
|
427
|
+
outputs.append(output_i)
|
|
428
|
+
context_layer = torch.cat(outputs, dim=1)
|
|
429
|
+
context_layer = rearrange(context_layer,
|
|
430
|
+
"b s h d -> s b (h d)").contiguous()
|
|
431
|
+
elif self.attn_backend == _Backend.XFORMERS:
|
|
432
|
+
from xformers import ops as xops
|
|
433
|
+
from xformers.ops.fmha.attn_bias import BlockDiagonalMask
|
|
434
|
+
|
|
435
|
+
attn_bias = BlockDiagonalMask.from_seqlens(q_seqlen=seqlens,
|
|
436
|
+
kv_seqlen=None,
|
|
437
|
+
device=q.device)
|
|
438
|
+
|
|
439
|
+
context_layer = xops.memory_efficient_attention_forward(
|
|
440
|
+
q, k, v, attn_bias=attn_bias, p=0, scale=None)
|
|
441
|
+
context_layer = rearrange(context_layer,
|
|
442
|
+
"b s h d -> s b (h d)").contiguous()
|
|
443
|
+
|
|
444
|
+
output, _ = self.proj(context_layer)
|
|
445
|
+
return output
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
class Qwen2VisionBlock(nn.Module):
|
|
449
|
+
|
|
450
|
+
def __init__(
|
|
451
|
+
self,
|
|
452
|
+
dim: int,
|
|
453
|
+
num_heads: int,
|
|
454
|
+
mlp_ratio: float,
|
|
455
|
+
act_layer: type[nn.Module] = QuickGELU,
|
|
456
|
+
norm_layer: Optional[Callable[[int], nn.Module]] = None,
|
|
457
|
+
quant_config: Optional[QuantizationConfig] = None,
|
|
458
|
+
prefix: str = "",
|
|
459
|
+
use_data_parallel: bool = False,
|
|
460
|
+
) -> None:
|
|
461
|
+
super().__init__()
|
|
462
|
+
if norm_layer is None:
|
|
463
|
+
norm_layer = partial(nn.LayerNorm, eps=1e-6)
|
|
464
|
+
self.norm1 = norm_layer(dim)
|
|
465
|
+
self.norm2 = norm_layer(dim)
|
|
466
|
+
mlp_hidden_dim = int(dim * mlp_ratio)
|
|
467
|
+
|
|
468
|
+
self.attn = Qwen2VisionAttention(embed_dim=dim,
|
|
469
|
+
num_heads=num_heads,
|
|
470
|
+
projection_size=dim,
|
|
471
|
+
quant_config=quant_config,
|
|
472
|
+
prefix=f"{prefix}.attn",
|
|
473
|
+
use_data_parallel=use_data_parallel)
|
|
474
|
+
self.mlp = Qwen2VisionMLP(dim,
|
|
475
|
+
mlp_hidden_dim,
|
|
476
|
+
act_layer=act_layer,
|
|
477
|
+
quant_config=quant_config,
|
|
478
|
+
prefix=f"{prefix}.mlp",
|
|
479
|
+
use_data_parallel=use_data_parallel)
|
|
480
|
+
|
|
481
|
+
def forward(
|
|
482
|
+
self,
|
|
483
|
+
x: torch.Tensor,
|
|
484
|
+
cu_seqlens: torch.Tensor,
|
|
485
|
+
rotary_pos_emb: torch.Tensor,
|
|
486
|
+
max_seqlen: Optional[int] = None, # Only used for Flash Attention
|
|
487
|
+
seqlens: Optional[list[int]] = None, # Only used for xFormers
|
|
488
|
+
) -> torch.Tensor:
|
|
489
|
+
x = x + self.attn(
|
|
490
|
+
self.norm1(x),
|
|
491
|
+
cu_seqlens=cu_seqlens,
|
|
492
|
+
rotary_pos_emb=rotary_pos_emb,
|
|
493
|
+
max_seqlen=max_seqlen,
|
|
494
|
+
seqlens=seqlens,
|
|
495
|
+
)
|
|
496
|
+
|
|
497
|
+
x = x + self.mlp(self.norm2(x))
|
|
498
|
+
return x
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
class Qwen2VisionPatchEmbed(nn.Module):
|
|
502
|
+
|
|
503
|
+
def __init__(
|
|
504
|
+
self,
|
|
505
|
+
patch_size: int = 14,
|
|
506
|
+
temporal_patch_size: int = 2,
|
|
507
|
+
in_channels: int = 3,
|
|
508
|
+
embed_dim: int = 1152,
|
|
509
|
+
) -> None:
|
|
510
|
+
super().__init__()
|
|
511
|
+
self.patch_size = patch_size
|
|
512
|
+
self.temporal_patch_size = temporal_patch_size
|
|
513
|
+
self.embed_dim = embed_dim
|
|
514
|
+
|
|
515
|
+
kernel_size = (temporal_patch_size, patch_size, patch_size)
|
|
516
|
+
self.proj = nn.Conv3d(in_channels,
|
|
517
|
+
embed_dim,
|
|
518
|
+
kernel_size=kernel_size,
|
|
519
|
+
stride=kernel_size,
|
|
520
|
+
bias=False)
|
|
521
|
+
|
|
522
|
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
|
523
|
+
L, C = x.shape
|
|
524
|
+
x = x.view(L, -1, self.temporal_patch_size, self.patch_size,
|
|
525
|
+
self.patch_size)
|
|
526
|
+
x = self.proj(x).view(L, self.embed_dim)
|
|
527
|
+
return x
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
class Qwen2VisionPatchMerger(nn.Module):
|
|
531
|
+
|
|
532
|
+
def __init__(
|
|
533
|
+
self,
|
|
534
|
+
d_model: int,
|
|
535
|
+
context_dim: int,
|
|
536
|
+
norm_layer: Optional[Callable[[int], nn.Module]] = None,
|
|
537
|
+
spatial_merge_size: int = 2,
|
|
538
|
+
quant_config: Optional[QuantizationConfig] = None,
|
|
539
|
+
prefix: str = "",
|
|
540
|
+
use_data_parallel: bool = False,
|
|
541
|
+
) -> None:
|
|
542
|
+
super().__init__()
|
|
543
|
+
self.hidden_size = context_dim * (spatial_merge_size**2)
|
|
544
|
+
if norm_layer is None:
|
|
545
|
+
norm_layer = partial(nn.LayerNorm, eps=1e-6)
|
|
546
|
+
self.ln_q = norm_layer(context_dim)
|
|
547
|
+
self.mlp = nn.ModuleList([
|
|
548
|
+
ColumnParallelLinear(self.hidden_size,
|
|
549
|
+
self.hidden_size,
|
|
550
|
+
bias=True,
|
|
551
|
+
quant_config=quant_config,
|
|
552
|
+
prefix=f"{prefix}.mlp.0",
|
|
553
|
+
disable_tp=use_data_parallel),
|
|
554
|
+
nn.GELU(),
|
|
555
|
+
RowParallelLinear(self.hidden_size,
|
|
556
|
+
d_model,
|
|
557
|
+
bias=True,
|
|
558
|
+
quant_config=quant_config,
|
|
559
|
+
prefix=f"{prefix}.mlp.2",
|
|
560
|
+
disable_tp=use_data_parallel),
|
|
561
|
+
])
|
|
562
|
+
|
|
563
|
+
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
|
564
|
+
x = self.ln_q(x)
|
|
565
|
+
x = x.view(-1, self.hidden_size)
|
|
566
|
+
|
|
567
|
+
mlp_fc1, mlp_act, mlp_fc2 = self.mlp
|
|
568
|
+
x_parallel, _ = mlp_fc1(x)
|
|
569
|
+
x_parallel = mlp_act(x_parallel)
|
|
570
|
+
out, _ = mlp_fc2(x_parallel)
|
|
571
|
+
return out
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
class Qwen2VisionRotaryEmbedding(nn.Module):
|
|
575
|
+
|
|
576
|
+
def __init__(self, dim: int, theta: float = 10000.0) -> None:
|
|
577
|
+
super().__init__()
|
|
578
|
+
self.dim = dim
|
|
579
|
+
self.theta = theta
|
|
580
|
+
inv_freq = 1.0 / (theta
|
|
581
|
+
**(torch.arange(0, dim, 2, dtype=torch.float) / dim))
|
|
582
|
+
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
|
583
|
+
self._seq_len_cached = 0
|
|
584
|
+
self._freqs_cached = None
|
|
585
|
+
|
|
586
|
+
def update_freqs_cache(self, seqlen: int) -> None:
|
|
587
|
+
if seqlen > self._seq_len_cached:
|
|
588
|
+
seqlen *= 2
|
|
589
|
+
self._seq_len_cached = seqlen
|
|
590
|
+
self.inv_freq = 1.0 / (self.theta**(torch.arange(
|
|
591
|
+
0, self.dim, 2, dtype=torch.float, device=self.inv_freq.device)
|
|
592
|
+
/ self.dim))
|
|
593
|
+
seq = torch.arange(seqlen,
|
|
594
|
+
device=self.inv_freq.device,
|
|
595
|
+
dtype=self.inv_freq.dtype)
|
|
596
|
+
freqs = torch.outer(seq, self.inv_freq)
|
|
597
|
+
self._freqs_cached = freqs
|
|
598
|
+
|
|
599
|
+
def forward(self, seqlen: int) -> torch.Tensor:
|
|
600
|
+
self.update_freqs_cache(seqlen)
|
|
601
|
+
return self._freqs_cached[:seqlen]
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
class Qwen2VisionTransformer(nn.Module):
|
|
605
|
+
|
|
606
|
+
def __init__(
|
|
607
|
+
self,
|
|
608
|
+
vision_config: Qwen2VLVisionConfig,
|
|
609
|
+
norm_eps: float = 1e-6,
|
|
610
|
+
quant_config: Optional[QuantizationConfig] = None,
|
|
611
|
+
prefix: str = "",
|
|
612
|
+
use_data_parallel: bool = False,
|
|
613
|
+
) -> None:
|
|
614
|
+
super().__init__()
|
|
615
|
+
|
|
616
|
+
patch_size = vision_config.patch_size
|
|
617
|
+
temporal_patch_size = vision_config.temporal_patch_size
|
|
618
|
+
spatial_merge_size = vision_config.spatial_merge_size
|
|
619
|
+
in_channels = vision_config.in_channels
|
|
620
|
+
hidden_size = vision_config.hidden_size
|
|
621
|
+
embed_dim = vision_config.embed_dim
|
|
622
|
+
depth = vision_config.depth
|
|
623
|
+
num_heads = vision_config.num_heads
|
|
624
|
+
mlp_ratio = vision_config.mlp_ratio
|
|
625
|
+
|
|
626
|
+
self.use_data_parallel = use_data_parallel
|
|
627
|
+
self.out_hidden_size = vision_config.hidden_size
|
|
628
|
+
|
|
629
|
+
self.spatial_merge_size = spatial_merge_size
|
|
630
|
+
self.num_heads = num_heads
|
|
631
|
+
self.embed_dim = embed_dim
|
|
632
|
+
|
|
633
|
+
self.patch_embed = Qwen2VisionPatchEmbed(
|
|
634
|
+
patch_size=patch_size,
|
|
635
|
+
temporal_patch_size=temporal_patch_size,
|
|
636
|
+
in_channels=in_channels,
|
|
637
|
+
embed_dim=embed_dim,
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
norm_layer = partial(nn.LayerNorm, eps=norm_eps)
|
|
641
|
+
head_dim = embed_dim // num_heads
|
|
642
|
+
self.rotary_pos_emb = Qwen2VisionRotaryEmbedding(head_dim // 2)
|
|
643
|
+
|
|
644
|
+
self.blocks = nn.ModuleList([
|
|
645
|
+
Qwen2VisionBlock(dim=embed_dim,
|
|
646
|
+
num_heads=num_heads,
|
|
647
|
+
mlp_ratio=mlp_ratio,
|
|
648
|
+
norm_layer=norm_layer,
|
|
649
|
+
quant_config=quant_config,
|
|
650
|
+
prefix=f"{prefix}.blocks.{layer_idx}",
|
|
651
|
+
use_data_parallel=use_data_parallel)
|
|
652
|
+
for layer_idx in range(depth)
|
|
653
|
+
])
|
|
654
|
+
self.merger = Qwen2VisionPatchMerger(
|
|
655
|
+
d_model=hidden_size,
|
|
656
|
+
context_dim=embed_dim,
|
|
657
|
+
norm_layer=norm_layer,
|
|
658
|
+
quant_config=quant_config,
|
|
659
|
+
prefix=f"{prefix}.merger",
|
|
660
|
+
use_data_parallel=use_data_parallel,
|
|
661
|
+
)
|
|
662
|
+
self.attn_backend = get_vit_attn_backend(
|
|
663
|
+
head_size=head_dim, dtype=torch.get_default_dtype())
|
|
664
|
+
if self.attn_backend != _Backend.FLASH_ATTN and \
|
|
665
|
+
check_upstream_fa_availability(
|
|
666
|
+
torch.get_default_dtype()):
|
|
667
|
+
self.attn_backend = _Backend.FLASH_ATTN
|
|
668
|
+
|
|
669
|
+
@property
|
|
670
|
+
def dtype(self) -> torch.dtype:
|
|
671
|
+
return self.patch_embed.proj.weight.dtype
|
|
672
|
+
|
|
673
|
+
@property
|
|
674
|
+
def device(self) -> torch.device:
|
|
675
|
+
return self.patch_embed.proj.weight.device
|
|
676
|
+
|
|
677
|
+
def rot_pos_emb(self, grid_thw: list[list[int]]) -> torch.Tensor:
|
|
678
|
+
pos_ids = []
|
|
679
|
+
max_grid_size = 0
|
|
680
|
+
for t, h, w in grid_thw:
|
|
681
|
+
hpos_ids = torch.arange(h).unsqueeze(1).expand(-1, w)
|
|
682
|
+
wpos_ids = torch.arange(w).unsqueeze(0).expand(h, -1)
|
|
683
|
+
hpos_ids = hpos_ids.reshape(
|
|
684
|
+
h // self.spatial_merge_size,
|
|
685
|
+
self.spatial_merge_size,
|
|
686
|
+
w // self.spatial_merge_size,
|
|
687
|
+
self.spatial_merge_size,
|
|
688
|
+
).permute(0, 2, 1, 3).flatten()
|
|
689
|
+
wpos_ids = wpos_ids.reshape(
|
|
690
|
+
h // self.spatial_merge_size,
|
|
691
|
+
self.spatial_merge_size,
|
|
692
|
+
w // self.spatial_merge_size,
|
|
693
|
+
self.spatial_merge_size,
|
|
694
|
+
).permute(0, 2, 1, 3).flatten()
|
|
695
|
+
pos_ids.append(
|
|
696
|
+
torch.stack([hpos_ids, wpos_ids], dim=-1).repeat(t, 1))
|
|
697
|
+
max_grid_size = max(max_grid_size, h, w)
|
|
698
|
+
pos_ids = torch.cat(pos_ids, dim=0)
|
|
699
|
+
rotary_pos_emb_full = self.rotary_pos_emb(max_grid_size)
|
|
700
|
+
rotary_pos_emb = rotary_pos_emb_full[pos_ids].flatten(1)
|
|
701
|
+
return rotary_pos_emb
|
|
702
|
+
|
|
703
|
+
def compute_attn_mask_seqlen(
|
|
704
|
+
self, cu_seqlens: torch.Tensor
|
|
705
|
+
) -> tuple[Optional[int], Optional[list[int]]]:
|
|
706
|
+
max_seqlen, seqlens = None, None
|
|
707
|
+
if (self.attn_backend == _Backend.FLASH_ATTN
|
|
708
|
+
or self.attn_backend == _Backend.ROCM_AITER_FA):
|
|
709
|
+
max_seqlen = (cu_seqlens[1:] - cu_seqlens[:-1]).max().item()
|
|
710
|
+
elif self.attn_backend == _Backend.XFORMERS:
|
|
711
|
+
seqlens = (cu_seqlens[1:] - cu_seqlens[:-1]).tolist()
|
|
712
|
+
return max_seqlen, seqlens
|
|
713
|
+
|
|
714
|
+
def forward(
|
|
715
|
+
self,
|
|
716
|
+
x: torch.Tensor,
|
|
717
|
+
grid_thw: list[list[int]],
|
|
718
|
+
) -> torch.Tensor:
|
|
719
|
+
# patchify
|
|
720
|
+
x = x.to(device=self.device, dtype=self.dtype)
|
|
721
|
+
x = self.patch_embed(x)
|
|
722
|
+
|
|
723
|
+
# compute position embedding
|
|
724
|
+
rotary_pos_emb = self.rot_pos_emb(grid_thw)
|
|
725
|
+
|
|
726
|
+
# compute cu_seqlens
|
|
727
|
+
grid_thw_ = torch.tensor(grid_thw)
|
|
728
|
+
cu_seqlens = torch.repeat_interleave(grid_thw_[:, 1] * grid_thw_[:, 2],
|
|
729
|
+
grid_thw_[:, 0]).cumsum(
|
|
730
|
+
dim=0, dtype=torch.int32)
|
|
731
|
+
cu_seqlens = F.pad(cu_seqlens, (1, 0), "constant", 0)
|
|
732
|
+
|
|
733
|
+
# transformers
|
|
734
|
+
x = x.unsqueeze(1)
|
|
735
|
+
|
|
736
|
+
# pre-compute seqlens for attn mask to reduce cuMemcpy operations
|
|
737
|
+
max_seqlen, seqlens = self.compute_attn_mask_seqlen(cu_seqlens)
|
|
738
|
+
for blk in self.blocks:
|
|
739
|
+
x = blk(
|
|
740
|
+
x,
|
|
741
|
+
cu_seqlens=cu_seqlens,
|
|
742
|
+
rotary_pos_emb=rotary_pos_emb,
|
|
743
|
+
max_seqlen=max_seqlen,
|
|
744
|
+
seqlens=seqlens,
|
|
745
|
+
)
|
|
746
|
+
|
|
747
|
+
# adapter
|
|
748
|
+
x = self.merger(x)
|
|
749
|
+
|
|
750
|
+
return x
|
|
751
|
+
|
|
752
|
+
def load_weights(self, weights: Iterable[tuple[str,
|
|
753
|
+
torch.Tensor]]) -> set[str]:
|
|
754
|
+
stacked_params_mapping = [
|
|
755
|
+
# (param_name, shard_name, shard_id)
|
|
756
|
+
("qkv_proj", "q_proj", "q"),
|
|
757
|
+
("qkv_proj", "k_proj", "k"),
|
|
758
|
+
("qkv_proj", "v_proj", "v"),
|
|
759
|
+
]
|
|
760
|
+
params_dict = dict(self.named_parameters(remove_duplicate=False))
|
|
761
|
+
loaded_params: set[str] = set()
|
|
762
|
+
|
|
763
|
+
for name, loaded_weight in weights:
|
|
764
|
+
for (param_name, weight_name, shard_id) in stacked_params_mapping:
|
|
765
|
+
if weight_name not in name:
|
|
766
|
+
continue
|
|
767
|
+
name = name.replace(weight_name, param_name)
|
|
768
|
+
|
|
769
|
+
param = params_dict[name]
|
|
770
|
+
weight_loader = param.weight_loader
|
|
771
|
+
weight_loader(param, loaded_weight, shard_id)
|
|
772
|
+
break
|
|
773
|
+
else:
|
|
774
|
+
param = params_dict[name]
|
|
775
|
+
weight_loader = getattr(param, "weight_loader",
|
|
776
|
+
default_weight_loader)
|
|
777
|
+
weight_loader(param, loaded_weight)
|
|
778
|
+
loaded_params.add(name)
|
|
779
|
+
return loaded_params
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
def _create_qwen2vl_field_factory(
|
|
783
|
+
spatial_merge_size: int
|
|
784
|
+
) -> Callable[
|
|
785
|
+
[Mapping[str, torch.Tensor]],
|
|
786
|
+
Mapping[str, MultiModalFieldConfig],
|
|
787
|
+
]:
|
|
788
|
+
|
|
789
|
+
def _qwen2vl_field_config(hf_inputs: Mapping[str, torch.Tensor]):
|
|
790
|
+
image_grid_thw = hf_inputs.get("image_grid_thw", torch.empty((0, 3)))
|
|
791
|
+
image_pixel_grid_sizes = image_grid_thw.prod(-1)
|
|
792
|
+
image_embed_grid_sizes = (image_pixel_grid_sizes //
|
|
793
|
+
spatial_merge_size // spatial_merge_size)
|
|
794
|
+
|
|
795
|
+
video_grid_thw = hf_inputs.get("video_grid_thw", torch.empty((0, 3)))
|
|
796
|
+
video_grid_sizes = video_grid_thw.prod(-1)
|
|
797
|
+
video_embed_grid_sizes = (video_grid_sizes // spatial_merge_size //
|
|
798
|
+
spatial_merge_size)
|
|
799
|
+
|
|
800
|
+
return dict(
|
|
801
|
+
pixel_values=MultiModalFieldConfig.flat_from_sizes(
|
|
802
|
+
"image", image_pixel_grid_sizes),
|
|
803
|
+
image_embeds=MultiModalFieldConfig.flat_from_sizes(
|
|
804
|
+
"image", image_embed_grid_sizes),
|
|
805
|
+
image_grid_thw=MultiModalFieldConfig.batched("image"),
|
|
806
|
+
pixel_values_videos=MultiModalFieldConfig.flat_from_sizes(
|
|
807
|
+
"video", video_grid_sizes),
|
|
808
|
+
video_embeds=MultiModalFieldConfig.flat_from_sizes(
|
|
809
|
+
"video", video_embed_grid_sizes),
|
|
810
|
+
video_grid_thw=MultiModalFieldConfig.batched("video"),
|
|
811
|
+
)
|
|
812
|
+
|
|
813
|
+
return _qwen2vl_field_config
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
class Qwen2VLMultiModalDataParser(MultiModalDataParser):
|
|
817
|
+
|
|
818
|
+
def __init__(self, spatial_merge_size: int, *args, **kwargs):
|
|
819
|
+
self._spatial_merge_size = spatial_merge_size
|
|
820
|
+
super().__init__(*args, **kwargs)
|
|
821
|
+
|
|
822
|
+
def _parse_image_data(
|
|
823
|
+
self,
|
|
824
|
+
data: Union[dict[str, torch.Tensor], ModalityData[ImageItem]],
|
|
825
|
+
) -> Optional[ModalityDataItems[Any, Any]]:
|
|
826
|
+
if isinstance(data, dict):
|
|
827
|
+
return DictEmbeddingItems(
|
|
828
|
+
data,
|
|
829
|
+
modality="image",
|
|
830
|
+
required_fields={"image_embeds", "image_grid_thw"},
|
|
831
|
+
fields_factory=_create_qwen2vl_field_factory(
|
|
832
|
+
self._spatial_merge_size),
|
|
833
|
+
)
|
|
834
|
+
|
|
835
|
+
return super()._parse_image_data(data)
|
|
836
|
+
|
|
837
|
+
def _parse_video_data(
|
|
838
|
+
self,
|
|
839
|
+
data: Union[dict[str, torch.Tensor], ModalityData[VideoItem]],
|
|
840
|
+
) -> Optional[ModalityDataItems[Any, Any]]:
|
|
841
|
+
if isinstance(data, dict):
|
|
842
|
+
return DictEmbeddingItems(
|
|
843
|
+
data,
|
|
844
|
+
modality="video",
|
|
845
|
+
required_fields={"video_embeds", "video_grid_thw"},
|
|
846
|
+
fields_factory=_create_qwen2vl_field_factory(
|
|
847
|
+
self._spatial_merge_size),
|
|
848
|
+
)
|
|
849
|
+
|
|
850
|
+
return super()._parse_video_data(data)
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
class Qwen2VLProcessingInfo(BaseProcessingInfo):
|
|
854
|
+
|
|
855
|
+
def get_hf_config(self):
|
|
856
|
+
return self.ctx.get_hf_config(Qwen2VLConfig)
|
|
857
|
+
|
|
858
|
+
def get_hf_processor(self, **kwargs: object) -> Qwen2VLProcessor:
|
|
859
|
+
return self.ctx.get_hf_processor(
|
|
860
|
+
Qwen2VLProcessor,
|
|
861
|
+
use_fast=kwargs.pop("use_fast", True),
|
|
862
|
+
**kwargs,
|
|
863
|
+
)
|
|
864
|
+
|
|
865
|
+
def get_image_processor(self, **kwargs: object) -> Qwen2VLImageProcessor:
|
|
866
|
+
return self.get_hf_processor(**kwargs).image_processor
|
|
867
|
+
|
|
868
|
+
def get_supported_mm_limits(self) -> Mapping[str, Optional[int]]:
|
|
869
|
+
return {"image": None, "video": None}
|
|
870
|
+
|
|
871
|
+
def get_mm_max_tokens_per_item(
|
|
872
|
+
self,
|
|
873
|
+
seq_len: int,
|
|
874
|
+
mm_counts: Mapping[str, int],
|
|
875
|
+
) -> Mapping[str, int]:
|
|
876
|
+
max_image_tokens = self.get_max_image_tokens()
|
|
877
|
+
max_video_tokens = self.get_max_video_tokens(seq_len, mm_counts)
|
|
878
|
+
return {"image": max_image_tokens, "video": max_video_tokens}
|
|
879
|
+
|
|
880
|
+
def _get_vision_info(
|
|
881
|
+
self,
|
|
882
|
+
*,
|
|
883
|
+
image_width: int,
|
|
884
|
+
image_height: int,
|
|
885
|
+
num_frames: int = 1,
|
|
886
|
+
do_resize: bool = True,
|
|
887
|
+
image_processor: Optional[Qwen2VLImageProcessor],
|
|
888
|
+
) -> tuple[ImageSize, int]:
|
|
889
|
+
if image_processor is None:
|
|
890
|
+
image_processor = self.get_image_processor()
|
|
891
|
+
|
|
892
|
+
hf_config = self.get_hf_config()
|
|
893
|
+
vision_config = hf_config.vision_config
|
|
894
|
+
patch_size = vision_config.patch_size
|
|
895
|
+
merge_size = vision_config.spatial_merge_size
|
|
896
|
+
temporal_patch_size = vision_config.temporal_patch_size
|
|
897
|
+
|
|
898
|
+
if do_resize:
|
|
899
|
+
resized_height, resized_width = smart_resize(
|
|
900
|
+
height=image_height,
|
|
901
|
+
width=image_width,
|
|
902
|
+
factor=patch_size * merge_size,
|
|
903
|
+
min_pixels=image_processor.min_pixels,
|
|
904
|
+
max_pixels=image_processor.max_pixels,
|
|
905
|
+
)
|
|
906
|
+
preprocessed_size = ImageSize(width=resized_width,
|
|
907
|
+
height=resized_height)
|
|
908
|
+
else:
|
|
909
|
+
preprocessed_size = ImageSize(width=image_width,
|
|
910
|
+
height=image_height)
|
|
911
|
+
|
|
912
|
+
# NOTE: Frames are padded to be divisible by `temporal_patch_size`
|
|
913
|
+
# https://github.com/huggingface/transformers/blob/v4.48.3/src/transformers/models/qwen2_vl/image_processing_qwen2_vl.py#L294
|
|
914
|
+
padded_num_frames = num_frames + num_frames % temporal_patch_size
|
|
915
|
+
|
|
916
|
+
grid_t = max(padded_num_frames // temporal_patch_size, 1)
|
|
917
|
+
grid_h = preprocessed_size.height // patch_size
|
|
918
|
+
grid_w = preprocessed_size.width // patch_size
|
|
919
|
+
|
|
920
|
+
num_patches = grid_t * grid_h * grid_w
|
|
921
|
+
num_vision_tokens = num_patches // (merge_size**2)
|
|
922
|
+
|
|
923
|
+
return preprocessed_size, num_vision_tokens
|
|
924
|
+
|
|
925
|
+
def get_num_image_tokens(
|
|
926
|
+
self,
|
|
927
|
+
*,
|
|
928
|
+
image_width: int,
|
|
929
|
+
image_height: int,
|
|
930
|
+
image_processor: Optional[Qwen2VLImageProcessor],
|
|
931
|
+
) -> int:
|
|
932
|
+
_, num_image_tokens = self._get_vision_info(
|
|
933
|
+
image_width=image_width,
|
|
934
|
+
image_height=image_height,
|
|
935
|
+
num_frames=1,
|
|
936
|
+
image_processor=image_processor,
|
|
937
|
+
)
|
|
938
|
+
return num_image_tokens
|
|
939
|
+
|
|
940
|
+
def get_num_video_tokens(
|
|
941
|
+
self,
|
|
942
|
+
*,
|
|
943
|
+
image_width: int,
|
|
944
|
+
image_height: int,
|
|
945
|
+
num_frames: int,
|
|
946
|
+
image_processor: Optional[Qwen2VLImageProcessor],
|
|
947
|
+
) -> int:
|
|
948
|
+
_, num_video_tokens = self._get_vision_info(
|
|
949
|
+
image_width=image_width,
|
|
950
|
+
image_height=image_height,
|
|
951
|
+
num_frames=num_frames,
|
|
952
|
+
image_processor=image_processor,
|
|
953
|
+
)
|
|
954
|
+
return num_video_tokens
|
|
955
|
+
|
|
956
|
+
def get_image_size_with_most_features(self) -> ImageSize:
|
|
957
|
+
max_image_size, _ = self._get_vision_info(
|
|
958
|
+
image_width=9999999,
|
|
959
|
+
image_height=9999999,
|
|
960
|
+
num_frames=1,
|
|
961
|
+
image_processor=None,
|
|
962
|
+
)
|
|
963
|
+
return max_image_size
|
|
964
|
+
|
|
965
|
+
def get_max_image_tokens(self) -> int:
|
|
966
|
+
target_width, target_height = self.get_image_size_with_most_features()
|
|
967
|
+
|
|
968
|
+
return self.get_num_image_tokens(
|
|
969
|
+
image_width=target_width,
|
|
970
|
+
image_height=target_height,
|
|
971
|
+
image_processor=None,
|
|
972
|
+
)
|
|
973
|
+
|
|
974
|
+
def _get_max_video_frames(self,
|
|
975
|
+
max_tokens: int,
|
|
976
|
+
start_num_frames: int = 1) -> int:
|
|
977
|
+
target_width, target_height = self.get_image_size_with_most_features()
|
|
978
|
+
|
|
979
|
+
num_frames = start_num_frames
|
|
980
|
+
|
|
981
|
+
while True:
|
|
982
|
+
next_num_frames = num_frames + 1
|
|
983
|
+
next_max_tokens = self.get_num_video_tokens(
|
|
984
|
+
image_width=target_width,
|
|
985
|
+
image_height=target_height,
|
|
986
|
+
num_frames=next_num_frames,
|
|
987
|
+
image_processor=None,
|
|
988
|
+
)
|
|
989
|
+
|
|
990
|
+
if next_max_tokens > max_tokens:
|
|
991
|
+
break
|
|
992
|
+
|
|
993
|
+
num_frames = next_num_frames
|
|
994
|
+
|
|
995
|
+
return num_frames
|
|
996
|
+
|
|
997
|
+
def get_num_frames_with_most_features(
|
|
998
|
+
self,
|
|
999
|
+
seq_len: int,
|
|
1000
|
+
mm_counts: Mapping[str, int],
|
|
1001
|
+
max_frames_per_video: int = _MAX_FRAMES_PER_VIDEO,
|
|
1002
|
+
) -> int:
|
|
1003
|
+
max_videos = mm_counts.get("video", 0)
|
|
1004
|
+
|
|
1005
|
+
max_total_frames = self._get_max_video_frames(seq_len)
|
|
1006
|
+
max_frames_per_video = min(max_total_frames // max(max_videos, 1),
|
|
1007
|
+
max_frames_per_video)
|
|
1008
|
+
|
|
1009
|
+
return max(max_frames_per_video, 1)
|
|
1010
|
+
|
|
1011
|
+
def get_max_video_tokens(
|
|
1012
|
+
self,
|
|
1013
|
+
seq_len: int,
|
|
1014
|
+
mm_counts: Mapping[str, int],
|
|
1015
|
+
) -> int:
|
|
1016
|
+
target_width, target_height = self.get_image_size_with_most_features()
|
|
1017
|
+
|
|
1018
|
+
return self.get_num_video_tokens(
|
|
1019
|
+
image_width=target_width,
|
|
1020
|
+
image_height=target_height,
|
|
1021
|
+
num_frames=self.get_num_frames_with_most_features(
|
|
1022
|
+
seq_len, mm_counts),
|
|
1023
|
+
image_processor=None,
|
|
1024
|
+
)
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
class Qwen2VLDummyInputsBuilder(BaseDummyInputsBuilder[Qwen2VLProcessingInfo]):
|
|
1028
|
+
|
|
1029
|
+
def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str:
|
|
1030
|
+
num_images = mm_counts.get("image", 0)
|
|
1031
|
+
num_videos = mm_counts.get("video", 0)
|
|
1032
|
+
|
|
1033
|
+
hf_processor = self.info.get_hf_processor()
|
|
1034
|
+
image_token: str = hf_processor.image_token
|
|
1035
|
+
video_token: str = hf_processor.video_token
|
|
1036
|
+
|
|
1037
|
+
return image_token * num_images + video_token * num_videos
|
|
1038
|
+
|
|
1039
|
+
def get_dummy_mm_data(
|
|
1040
|
+
self,
|
|
1041
|
+
seq_len: int,
|
|
1042
|
+
mm_counts: Mapping[str, int],
|
|
1043
|
+
) -> MultiModalDataDict:
|
|
1044
|
+
num_images = mm_counts.get("image", 0)
|
|
1045
|
+
num_videos = mm_counts.get("video", 0)
|
|
1046
|
+
|
|
1047
|
+
target_width, target_height = \
|
|
1048
|
+
self.info.get_image_size_with_most_features()
|
|
1049
|
+
target_num_frames = \
|
|
1050
|
+
self.info.get_num_frames_with_most_features(seq_len, mm_counts)
|
|
1051
|
+
|
|
1052
|
+
return {
|
|
1053
|
+
"image":
|
|
1054
|
+
self._get_dummy_images(width=target_width,
|
|
1055
|
+
height=target_height,
|
|
1056
|
+
num_images=num_images),
|
|
1057
|
+
"video":
|
|
1058
|
+
self._get_dummy_videos(
|
|
1059
|
+
width=target_width,
|
|
1060
|
+
height=target_height,
|
|
1061
|
+
num_frames=target_num_frames,
|
|
1062
|
+
num_videos=num_videos,
|
|
1063
|
+
)
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
class Qwen2VLMultiModalProcessor(BaseMultiModalProcessor[Qwen2VLProcessingInfo]
|
|
1068
|
+
):
|
|
1069
|
+
|
|
1070
|
+
def _get_data_parser(self) -> MultiModalDataParser:
|
|
1071
|
+
return Qwen2VLMultiModalDataParser(
|
|
1072
|
+
self.info.get_hf_config().vision_config.spatial_merge_size)
|
|
1073
|
+
|
|
1074
|
+
def _get_prompt_updates(
|
|
1075
|
+
self,
|
|
1076
|
+
mm_items: MultiModalDataItems,
|
|
1077
|
+
hf_processor_mm_kwargs: Mapping[str, Any],
|
|
1078
|
+
out_mm_kwargs: MultiModalKwargsItems,
|
|
1079
|
+
) -> Sequence[PromptUpdate]:
|
|
1080
|
+
hf_processor = self.info.get_hf_processor(**hf_processor_mm_kwargs)
|
|
1081
|
+
image_processor = self.info.get_image_processor(
|
|
1082
|
+
**hf_processor_mm_kwargs)
|
|
1083
|
+
tokenizer = self.info.get_tokenizer()
|
|
1084
|
+
vocab = tokenizer.get_vocab()
|
|
1085
|
+
|
|
1086
|
+
placeholder = {
|
|
1087
|
+
"image": vocab[hf_processor.image_token],
|
|
1088
|
+
"video": vocab[hf_processor.video_token],
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
merge_length = image_processor.merge_size**2
|
|
1092
|
+
|
|
1093
|
+
def get_replacement_qwen2vl(item_idx: int, modality: str):
|
|
1094
|
+
out_item = out_mm_kwargs[modality][item_idx]
|
|
1095
|
+
grid_thw = out_item[f"{modality}_grid_thw"].data
|
|
1096
|
+
assert isinstance(grid_thw, torch.Tensor)
|
|
1097
|
+
|
|
1098
|
+
num_tokens = int(grid_thw.prod()) // merge_length
|
|
1099
|
+
return [placeholder[modality]] * num_tokens
|
|
1100
|
+
|
|
1101
|
+
return [
|
|
1102
|
+
PromptReplacement(
|
|
1103
|
+
modality=modality,
|
|
1104
|
+
target=[placeholder[modality]],
|
|
1105
|
+
replacement=partial(get_replacement_qwen2vl,
|
|
1106
|
+
modality=modality),
|
|
1107
|
+
) for modality in ("image", "video")
|
|
1108
|
+
]
|
|
1109
|
+
|
|
1110
|
+
def _get_mm_fields_config(
|
|
1111
|
+
self,
|
|
1112
|
+
hf_inputs: BatchFeature,
|
|
1113
|
+
hf_processor_mm_kwargs: Mapping[str, object],
|
|
1114
|
+
) -> Mapping[str, MultiModalFieldConfig]:
|
|
1115
|
+
return _create_qwen2vl_field_factory(
|
|
1116
|
+
self.info.get_hf_config().vision_config.spatial_merge_size)(
|
|
1117
|
+
hf_inputs)
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
@MULTIMODAL_REGISTRY.register_processor(Qwen2VLMultiModalProcessor,
|
|
1121
|
+
info=Qwen2VLProcessingInfo,
|
|
1122
|
+
dummy_inputs=Qwen2VLDummyInputsBuilder)
|
|
1123
|
+
class Qwen2VLForConditionalGeneration(nn.Module, SupportsMultiModal,
|
|
1124
|
+
SupportsLoRA, SupportsPP, SupportsMRoPE):
|
|
1125
|
+
|
|
1126
|
+
# To ensure correct weight loading and mapping.
|
|
1127
|
+
hf_to_vllm_mapper = WeightsMapper(
|
|
1128
|
+
orig_to_new_prefix={
|
|
1129
|
+
# mapping for new names in checkpoint saved after transformers v4.52
|
|
1130
|
+
"model.language_model.": "language_model.model.",
|
|
1131
|
+
"model.visual.": "visual.",
|
|
1132
|
+
# mapping for original checkpoint
|
|
1133
|
+
"lm_head.": "language_model.lm_head.",
|
|
1134
|
+
"model.": "language_model.model.",
|
|
1135
|
+
})
|
|
1136
|
+
|
|
1137
|
+
supports_encoder_tp_data = True
|
|
1138
|
+
|
|
1139
|
+
def get_mrope_input_positions(
|
|
1140
|
+
self,
|
|
1141
|
+
input_tokens: list[int],
|
|
1142
|
+
hf_config: PretrainedConfig,
|
|
1143
|
+
image_grid_thw: Optional[Union[list[list[int]], torch.Tensor]],
|
|
1144
|
+
video_grid_thw: Optional[Union[list[list[int]], torch.Tensor]],
|
|
1145
|
+
second_per_grid_ts: Optional[list[float]] = None,
|
|
1146
|
+
context_len: int = 0,
|
|
1147
|
+
seq_len: Optional[int] = None,
|
|
1148
|
+
audio_feature_lengths: Optional[torch.Tensor] = None,
|
|
1149
|
+
use_audio_in_video: bool = False,
|
|
1150
|
+
) -> tuple[torch.Tensor, int]:
|
|
1151
|
+
"""Get M-RoPE input positions for Qwen2-VL model."""
|
|
1152
|
+
if image_grid_thw is None:
|
|
1153
|
+
image_grid_thw = []
|
|
1154
|
+
if video_grid_thw is None:
|
|
1155
|
+
video_grid_thw = []
|
|
1156
|
+
if second_per_grid_ts is None:
|
|
1157
|
+
second_per_grid_ts = []
|
|
1158
|
+
|
|
1159
|
+
image_token_id = hf_config.image_token_id
|
|
1160
|
+
video_token_id = hf_config.video_token_id
|
|
1161
|
+
vision_start_token_id = hf_config.vision_start_token_id
|
|
1162
|
+
spatial_merge_size = hf_config.vision_config.spatial_merge_size
|
|
1163
|
+
tokens_per_second = getattr(hf_config.vision_config,
|
|
1164
|
+
"tokens_per_second", 1.0)
|
|
1165
|
+
|
|
1166
|
+
input_tokens_tensor = torch.tensor(input_tokens)
|
|
1167
|
+
vision_start_indices = torch.argwhere(
|
|
1168
|
+
input_tokens_tensor == vision_start_token_id).squeeze(1)
|
|
1169
|
+
vision_tokens = input_tokens_tensor[vision_start_indices + 1]
|
|
1170
|
+
image_nums = (vision_tokens == image_token_id).sum()
|
|
1171
|
+
video_nums = (vision_tokens == video_token_id).sum()
|
|
1172
|
+
llm_pos_ids_list: list = []
|
|
1173
|
+
|
|
1174
|
+
st = 0
|
|
1175
|
+
remain_images, remain_videos = image_nums, video_nums
|
|
1176
|
+
|
|
1177
|
+
image_index, video_index = 0, 0
|
|
1178
|
+
for _ in range(image_nums + video_nums):
|
|
1179
|
+
video_second_per_grid_t = 0.0
|
|
1180
|
+
if remain_images > 0:
|
|
1181
|
+
try:
|
|
1182
|
+
ed_image = input_tokens.index(image_token_id, st)
|
|
1183
|
+
except ValueError:
|
|
1184
|
+
ed_image = len(input_tokens) + 1
|
|
1185
|
+
else:
|
|
1186
|
+
ed_image = len(input_tokens) + 1
|
|
1187
|
+
if remain_videos > 0:
|
|
1188
|
+
try:
|
|
1189
|
+
ed_video = input_tokens.index(video_token_id, st)
|
|
1190
|
+
except ValueError:
|
|
1191
|
+
ed_video = len(input_tokens) + 1
|
|
1192
|
+
else:
|
|
1193
|
+
ed_video = len(input_tokens) + 1
|
|
1194
|
+
if ed_image < ed_video:
|
|
1195
|
+
t, h, w = (
|
|
1196
|
+
image_grid_thw[image_index][0],
|
|
1197
|
+
image_grid_thw[image_index][1],
|
|
1198
|
+
image_grid_thw[image_index][2],
|
|
1199
|
+
)
|
|
1200
|
+
image_index += 1
|
|
1201
|
+
remain_images -= 1
|
|
1202
|
+
ed = ed_image
|
|
1203
|
+
else:
|
|
1204
|
+
t, h, w = (
|
|
1205
|
+
video_grid_thw[video_index][0],
|
|
1206
|
+
video_grid_thw[video_index][1],
|
|
1207
|
+
video_grid_thw[video_index][2],
|
|
1208
|
+
)
|
|
1209
|
+
video_second_per_grid_t = 1.0
|
|
1210
|
+
if second_per_grid_ts:
|
|
1211
|
+
video_second_per_grid_t = second_per_grid_ts[video_index]
|
|
1212
|
+
video_index += 1
|
|
1213
|
+
remain_videos -= 1
|
|
1214
|
+
ed = ed_video
|
|
1215
|
+
|
|
1216
|
+
llm_grid_t, llm_grid_h, llm_grid_w = \
|
|
1217
|
+
t, h // spatial_merge_size, w // spatial_merge_size
|
|
1218
|
+
text_len = ed - st
|
|
1219
|
+
|
|
1220
|
+
st_idx = llm_pos_ids_list[-1].max() + 1 if len(
|
|
1221
|
+
llm_pos_ids_list) > 0 else 0
|
|
1222
|
+
llm_pos_ids_list.append(
|
|
1223
|
+
torch.arange(text_len).view(1, -1).expand(3, -1) + st_idx)
|
|
1224
|
+
|
|
1225
|
+
t_index = (torch.arange(llm_grid_t).view(-1, 1).expand(
|
|
1226
|
+
-1, llm_grid_h * llm_grid_w) * video_second_per_grid_t *
|
|
1227
|
+
tokens_per_second).long().flatten()
|
|
1228
|
+
|
|
1229
|
+
h_index = torch.arange(llm_grid_h).view(1, -1, 1).expand(
|
|
1230
|
+
llm_grid_t, -1, llm_grid_w).flatten()
|
|
1231
|
+
w_index = torch.arange(llm_grid_w).view(1, 1, -1).expand(
|
|
1232
|
+
llm_grid_t, llm_grid_h, -1).flatten()
|
|
1233
|
+
llm_pos_ids_list.append(
|
|
1234
|
+
torch.stack([t_index, h_index, w_index]) + text_len + st_idx)
|
|
1235
|
+
st = ed + llm_grid_t * llm_grid_h * llm_grid_w
|
|
1236
|
+
|
|
1237
|
+
if st < len(input_tokens):
|
|
1238
|
+
st_idx = llm_pos_ids_list[-1].max() + 1 if len(
|
|
1239
|
+
llm_pos_ids_list) > 0 else 0
|
|
1240
|
+
text_len = len(input_tokens) - st
|
|
1241
|
+
llm_pos_ids_list.append(
|
|
1242
|
+
torch.arange(text_len).view(1, -1).expand(3, -1) + st_idx)
|
|
1243
|
+
|
|
1244
|
+
llm_positions = torch.cat(llm_pos_ids_list, dim=1).reshape(3, -1)
|
|
1245
|
+
mrope_position_delta = (llm_positions.max() + 1 -
|
|
1246
|
+
len(input_tokens)).item()
|
|
1247
|
+
llm_positions = llm_positions[:, context_len:seq_len]
|
|
1248
|
+
|
|
1249
|
+
return llm_positions, mrope_position_delta
|
|
1250
|
+
|
|
1251
|
+
@classmethod
|
|
1252
|
+
def get_placeholder_str(cls, modality: str, i: int) -> Optional[str]:
|
|
1253
|
+
if modality.startswith("image"):
|
|
1254
|
+
return "<|vision_start|><|image_pad|><|vision_end|>"
|
|
1255
|
+
if modality.startswith("video"):
|
|
1256
|
+
return "<|vision_start|><|video_pad|><|vision_end|>"
|
|
1257
|
+
|
|
1258
|
+
raise ValueError("Only image or video modality is supported")
|
|
1259
|
+
|
|
1260
|
+
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
|
|
1261
|
+
super().__init__()
|
|
1262
|
+
config: Qwen2VLConfig = vllm_config.model_config.hf_config
|
|
1263
|
+
quant_config = vllm_config.quant_config
|
|
1264
|
+
multimodal_config = vllm_config.model_config.multimodal_config
|
|
1265
|
+
|
|
1266
|
+
self.use_data_parallel = multimodal_config.mm_encoder_tp_mode == "data"
|
|
1267
|
+
self.config = config
|
|
1268
|
+
self.multimodal_config = multimodal_config
|
|
1269
|
+
|
|
1270
|
+
if multimodal_config.get_limit_per_prompt("image") or \
|
|
1271
|
+
multimodal_config.get_limit_per_prompt("video"):
|
|
1272
|
+
self.visual = Qwen2VisionTransformer(
|
|
1273
|
+
config.vision_config,
|
|
1274
|
+
norm_eps=getattr(config, "rms_norm_eps", 1e-6),
|
|
1275
|
+
quant_config=quant_config,
|
|
1276
|
+
prefix=maybe_prefix(prefix, "visual"),
|
|
1277
|
+
use_data_parallel=self.use_data_parallel,
|
|
1278
|
+
)
|
|
1279
|
+
else:
|
|
1280
|
+
self.visual = None
|
|
1281
|
+
|
|
1282
|
+
self.language_model = init_vllm_registered_model(
|
|
1283
|
+
vllm_config=vllm_config,
|
|
1284
|
+
prefix=maybe_prefix(prefix, "language_model"),
|
|
1285
|
+
architectures=["Qwen2ForCausalLM"],
|
|
1286
|
+
)
|
|
1287
|
+
|
|
1288
|
+
self.make_empty_intermediate_tensors = (
|
|
1289
|
+
self.language_model.make_empty_intermediate_tensors)
|
|
1290
|
+
|
|
1291
|
+
def _validate_and_reshape_mm_tensor(self, mm_input: object,
|
|
1292
|
+
name: str) -> torch.Tensor:
|
|
1293
|
+
if not isinstance(mm_input, (torch.Tensor, list)):
|
|
1294
|
+
raise ValueError(f"Incorrect type of {name}. "
|
|
1295
|
+
f"Got type: {type(mm_input)}")
|
|
1296
|
+
if isinstance(mm_input, torch.Tensor):
|
|
1297
|
+
if mm_input.ndim == 2:
|
|
1298
|
+
return mm_input
|
|
1299
|
+
if mm_input.ndim != 3:
|
|
1300
|
+
raise ValueError(f"{name} should be 2D or batched 3D tensor. "
|
|
1301
|
+
f"Got ndim: {mm_input.ndim} "
|
|
1302
|
+
f"(shape={mm_input.shape})")
|
|
1303
|
+
return mm_input.reshape(-1, mm_input.shape[-1])
|
|
1304
|
+
else:
|
|
1305
|
+
return torch.concat(mm_input)
|
|
1306
|
+
|
|
1307
|
+
def _parse_and_validate_image_input(
|
|
1308
|
+
self, **kwargs: object) -> Optional[Qwen2VLImageInputs]:
|
|
1309
|
+
pixel_values = kwargs.pop("pixel_values", None)
|
|
1310
|
+
image_embeds = kwargs.pop("image_embeds", None)
|
|
1311
|
+
image_grid_thw = kwargs.pop("image_grid_thw", None)
|
|
1312
|
+
|
|
1313
|
+
if pixel_values is None and image_embeds is None:
|
|
1314
|
+
return None
|
|
1315
|
+
|
|
1316
|
+
if pixel_values is not None:
|
|
1317
|
+
pixel_values = self._validate_and_reshape_mm_tensor(
|
|
1318
|
+
pixel_values, "image pixel values")
|
|
1319
|
+
image_grid_thw = self._validate_and_reshape_mm_tensor(
|
|
1320
|
+
image_grid_thw, "image grid_thw")
|
|
1321
|
+
|
|
1322
|
+
return Qwen2VLImagePixelInputs(type="pixel_values",
|
|
1323
|
+
pixel_values=pixel_values,
|
|
1324
|
+
image_grid_thw=image_grid_thw)
|
|
1325
|
+
|
|
1326
|
+
if image_embeds is not None:
|
|
1327
|
+
image_embeds = self._validate_and_reshape_mm_tensor(
|
|
1328
|
+
image_embeds, "image embeds")
|
|
1329
|
+
image_grid_thw = self._validate_and_reshape_mm_tensor(
|
|
1330
|
+
image_grid_thw, "image grid_thw")
|
|
1331
|
+
|
|
1332
|
+
return Qwen2VLImageEmbeddingInputs(type="image_embeds",
|
|
1333
|
+
image_embeds=image_embeds,
|
|
1334
|
+
image_grid_thw=image_grid_thw)
|
|
1335
|
+
|
|
1336
|
+
def _parse_and_validate_video_input(
|
|
1337
|
+
self, **kwargs: object) -> Optional[Qwen2VLVideoInputs]:
|
|
1338
|
+
pixel_values_videos = kwargs.pop("pixel_values_videos", None)
|
|
1339
|
+
video_embeds = kwargs.pop("video_embeds", None)
|
|
1340
|
+
video_grid_thw = kwargs.pop("video_grid_thw", None)
|
|
1341
|
+
|
|
1342
|
+
if pixel_values_videos is None and video_embeds is None:
|
|
1343
|
+
return None
|
|
1344
|
+
|
|
1345
|
+
if pixel_values_videos is not None:
|
|
1346
|
+
pixel_values_videos = self._validate_and_reshape_mm_tensor(
|
|
1347
|
+
pixel_values_videos, "video pixel values")
|
|
1348
|
+
video_grid_thw = self._validate_and_reshape_mm_tensor(
|
|
1349
|
+
video_grid_thw, "video grid_thw")
|
|
1350
|
+
|
|
1351
|
+
return Qwen2VLVideoPixelInputs(
|
|
1352
|
+
type="pixel_values_videos",
|
|
1353
|
+
pixel_values_videos=pixel_values_videos,
|
|
1354
|
+
video_grid_thw=video_grid_thw,
|
|
1355
|
+
)
|
|
1356
|
+
|
|
1357
|
+
if video_embeds is not None:
|
|
1358
|
+
video_embeds = self._validate_and_reshape_mm_tensor(
|
|
1359
|
+
video_embeds, "video embeds")
|
|
1360
|
+
video_grid_thw = self._validate_and_reshape_mm_tensor(
|
|
1361
|
+
video_grid_thw, "video grid_thw")
|
|
1362
|
+
|
|
1363
|
+
return Qwen2VLVideoEmbeddingInputs(type="video_embeds",
|
|
1364
|
+
video_embeds=video_embeds,
|
|
1365
|
+
video_grid_thw=video_grid_thw)
|
|
1366
|
+
|
|
1367
|
+
def _process_image_input(
|
|
1368
|
+
self, image_input: Qwen2VLImageInputs) -> tuple[torch.Tensor, ...]:
|
|
1369
|
+
|
|
1370
|
+
grid_thw = image_input["image_grid_thw"]
|
|
1371
|
+
assert grid_thw.ndim == 2
|
|
1372
|
+
grid_thw_list = grid_thw.tolist()
|
|
1373
|
+
|
|
1374
|
+
if image_input["type"] == "image_embeds":
|
|
1375
|
+
image_embeds = image_input["image_embeds"]
|
|
1376
|
+
else:
|
|
1377
|
+
pixel_values = image_input["pixel_values"]
|
|
1378
|
+
|
|
1379
|
+
if self.use_data_parallel:
|
|
1380
|
+
return run_dp_sharded_mrope_vision_model(self.visual,
|
|
1381
|
+
pixel_values,
|
|
1382
|
+
grid_thw_list,
|
|
1383
|
+
rope_type="rope_3d")
|
|
1384
|
+
else:
|
|
1385
|
+
image_embeds = self.visual(pixel_values,
|
|
1386
|
+
grid_thw=grid_thw_list)
|
|
1387
|
+
|
|
1388
|
+
# Split concatenated embeddings for each image item.
|
|
1389
|
+
merge_size = self.visual.spatial_merge_size
|
|
1390
|
+
sizes = (torch.tensor(grid_thw_list, dtype=torch.long).prod(-1) //
|
|
1391
|
+
(merge_size * merge_size)).tolist()
|
|
1392
|
+
|
|
1393
|
+
return image_embeds.split(sizes)
|
|
1394
|
+
|
|
1395
|
+
def _process_video_input(
|
|
1396
|
+
self, video_input: Qwen2VLVideoInputs) -> tuple[torch.Tensor, ...]:
|
|
1397
|
+
|
|
1398
|
+
grid_thw = video_input["video_grid_thw"]
|
|
1399
|
+
assert grid_thw.ndim == 2
|
|
1400
|
+
grid_thw_list = grid_thw.tolist()
|
|
1401
|
+
|
|
1402
|
+
if video_input["type"] == "video_embeds":
|
|
1403
|
+
video_embeds = video_input["video_embeds"]
|
|
1404
|
+
else:
|
|
1405
|
+
pixel_values_videos = video_input["pixel_values_videos"]
|
|
1406
|
+
if self.use_data_parallel:
|
|
1407
|
+
return run_dp_sharded_mrope_vision_model(self.visual,
|
|
1408
|
+
pixel_values_videos,
|
|
1409
|
+
grid_thw_list,
|
|
1410
|
+
rope_type="rope_3d")
|
|
1411
|
+
else:
|
|
1412
|
+
video_embeds = self.visual(pixel_values_videos,
|
|
1413
|
+
grid_thw=grid_thw_list)
|
|
1414
|
+
|
|
1415
|
+
# Split concatenated embeddings for each video item.
|
|
1416
|
+
merge_size = self.visual.spatial_merge_size
|
|
1417
|
+
sizes = (torch.tensor(grid_thw_list, dtype=torch.long).prod(-1) //
|
|
1418
|
+
(merge_size * merge_size)).tolist()
|
|
1419
|
+
|
|
1420
|
+
return video_embeds.split(sizes)
|
|
1421
|
+
|
|
1422
|
+
def _parse_and_validate_multimodal_inputs(self, **kwargs: object) -> dict:
|
|
1423
|
+
modalities = {}
|
|
1424
|
+
|
|
1425
|
+
# Preserve the order of modalities if there are multiple of them
|
|
1426
|
+
# from the order of kwargs.
|
|
1427
|
+
for input_key in kwargs:
|
|
1428
|
+
if input_key in ("pixel_values",
|
|
1429
|
+
"image_embeds") and "images" not in modalities:
|
|
1430
|
+
modalities["images"] = self._parse_and_validate_image_input(
|
|
1431
|
+
**kwargs)
|
|
1432
|
+
if input_key in ("pixel_values_videos",
|
|
1433
|
+
"video_embeds") and "videos" not in modalities:
|
|
1434
|
+
modalities["videos"] = self._parse_and_validate_video_input(
|
|
1435
|
+
**kwargs)
|
|
1436
|
+
|
|
1437
|
+
return modalities
|
|
1438
|
+
|
|
1439
|
+
def get_language_model(self) -> torch.nn.Module:
|
|
1440
|
+
return self.language_model
|
|
1441
|
+
|
|
1442
|
+
def get_multimodal_embeddings(self,
|
|
1443
|
+
**kwargs: object) -> MultiModalEmbeddings:
|
|
1444
|
+
|
|
1445
|
+
modalities = self._parse_and_validate_multimodal_inputs(**kwargs)
|
|
1446
|
+
if not modalities:
|
|
1447
|
+
return []
|
|
1448
|
+
|
|
1449
|
+
# The result multimodal_embeddings is tuple of tensors, with each
|
|
1450
|
+
# tensor correspoending to a multimodal data item (image or video).
|
|
1451
|
+
multimodal_embeddings: tuple[torch.Tensor, ...] = ()
|
|
1452
|
+
|
|
1453
|
+
# NOTE: It is important to iterate over the keys in this dictionary
|
|
1454
|
+
# to preserve the order of the modalities.
|
|
1455
|
+
for modality in modalities:
|
|
1456
|
+
if modality == "images":
|
|
1457
|
+
image_input = modalities["images"]
|
|
1458
|
+
vision_embeddings = self._process_image_input(image_input)
|
|
1459
|
+
multimodal_embeddings += vision_embeddings
|
|
1460
|
+
if modality == "videos":
|
|
1461
|
+
video_input = modalities["videos"]
|
|
1462
|
+
video_embeddings = self._process_video_input(video_input)
|
|
1463
|
+
multimodal_embeddings += video_embeddings
|
|
1464
|
+
|
|
1465
|
+
return multimodal_embeddings
|
|
1466
|
+
|
|
1467
|
+
def get_input_embeddings(
|
|
1468
|
+
self,
|
|
1469
|
+
input_ids: torch.Tensor,
|
|
1470
|
+
multimodal_embeddings: Optional[MultiModalEmbeddings] = None,
|
|
1471
|
+
) -> torch.Tensor:
|
|
1472
|
+
inputs_embeds = self.language_model.get_input_embeddings(input_ids)
|
|
1473
|
+
if multimodal_embeddings is not None \
|
|
1474
|
+
and len(multimodal_embeddings) != 0:
|
|
1475
|
+
inputs_embeds = merge_multimodal_embeddings(
|
|
1476
|
+
input_ids, inputs_embeds, multimodal_embeddings,
|
|
1477
|
+
[self.config.image_token_id, self.config.video_token_id])
|
|
1478
|
+
return inputs_embeds
|
|
1479
|
+
|
|
1480
|
+
def get_input_embeddings_v0(
|
|
1481
|
+
self,
|
|
1482
|
+
input_ids: torch.Tensor,
|
|
1483
|
+
image_input: Optional[Qwen2VLImagePixelInputs] = None,
|
|
1484
|
+
video_input: Optional[Qwen2VLVideoPixelInputs] = None,
|
|
1485
|
+
) -> torch.Tensor:
|
|
1486
|
+
inputs_embeds = self.get_input_embeddings(input_ids)
|
|
1487
|
+
if image_input is not None:
|
|
1488
|
+
image_embeds = self._process_image_input(image_input)
|
|
1489
|
+
inputs_embeds = merge_multimodal_embeddings(
|
|
1490
|
+
input_ids,
|
|
1491
|
+
inputs_embeds,
|
|
1492
|
+
image_embeds,
|
|
1493
|
+
placeholder_token_id=self.config.image_token_id,
|
|
1494
|
+
)
|
|
1495
|
+
|
|
1496
|
+
if video_input is not None:
|
|
1497
|
+
video_embeds = self._process_video_input(video_input)
|
|
1498
|
+
inputs_embeds = merge_multimodal_embeddings(
|
|
1499
|
+
input_ids,
|
|
1500
|
+
inputs_embeds,
|
|
1501
|
+
video_embeds,
|
|
1502
|
+
placeholder_token_id=self.config.video_token_id,
|
|
1503
|
+
)
|
|
1504
|
+
return inputs_embeds
|
|
1505
|
+
|
|
1506
|
+
def forward(
|
|
1507
|
+
self,
|
|
1508
|
+
input_ids: torch.Tensor,
|
|
1509
|
+
positions: torch.Tensor,
|
|
1510
|
+
intermediate_tensors: Optional[IntermediateTensors] = None,
|
|
1511
|
+
inputs_embeds: Optional[torch.Tensor] = None,
|
|
1512
|
+
**kwargs: object,
|
|
1513
|
+
) -> Union[torch.Tensor, IntermediateTensors]:
|
|
1514
|
+
"""Run forward pass for Qwen2-VL.
|
|
1515
|
+
|
|
1516
|
+
Args:
|
|
1517
|
+
input_ids: Flattened (concatenated) input_ids corresponding to a
|
|
1518
|
+
batch.
|
|
1519
|
+
positions: Flattened (concatenated) position ids corresponding to a
|
|
1520
|
+
batch.
|
|
1521
|
+
**NOTE**: If mrope is enabled (default setting for Qwen2-VL
|
|
1522
|
+
opensource models), the shape will be `(3, seq_len)`,
|
|
1523
|
+
otherwise it will be `(seq_len,)`.
|
|
1524
|
+
intermediate_tensors: Intermediate tensors from prior forward pass.
|
|
1525
|
+
inputs_embeds: Optional tensor of input embeddings.
|
|
1526
|
+
"""
|
|
1527
|
+
|
|
1528
|
+
if intermediate_tensors is not None:
|
|
1529
|
+
inputs_embeds = None
|
|
1530
|
+
|
|
1531
|
+
# NOTE: In v1, inputs_embeds is always generated at model runner from
|
|
1532
|
+
# `get_multimodal_embeddings` and `get_input_embeddings`, this
|
|
1533
|
+
# condition is only for v0 compatibility.
|
|
1534
|
+
elif inputs_embeds is None:
|
|
1535
|
+
image_input = self._parse_and_validate_image_input(**kwargs)
|
|
1536
|
+
video_input = self._parse_and_validate_video_input(**kwargs)
|
|
1537
|
+
|
|
1538
|
+
if image_input is None and video_input is None:
|
|
1539
|
+
inputs_embeds = None
|
|
1540
|
+
else:
|
|
1541
|
+
if uses_mrope(self.config):
|
|
1542
|
+
assert positions.ndim == 2 and positions.size(0) == 3, (
|
|
1543
|
+
"multimodal section rotary embedding requires "
|
|
1544
|
+
f"(3, seq_len) positions, but got {positions.size()}")
|
|
1545
|
+
inputs_embeds = self.get_input_embeddings_v0(
|
|
1546
|
+
input_ids,
|
|
1547
|
+
image_input=image_input,
|
|
1548
|
+
video_input=video_input)
|
|
1549
|
+
input_ids = None
|
|
1550
|
+
|
|
1551
|
+
hidden_states = self.language_model.model(
|
|
1552
|
+
input_ids=input_ids,
|
|
1553
|
+
positions=positions,
|
|
1554
|
+
intermediate_tensors=intermediate_tensors,
|
|
1555
|
+
inputs_embeds=inputs_embeds,
|
|
1556
|
+
)
|
|
1557
|
+
return hidden_states
|
|
1558
|
+
|
|
1559
|
+
def compute_logits(
|
|
1560
|
+
self,
|
|
1561
|
+
hidden_states: torch.Tensor,
|
|
1562
|
+
) -> Optional[torch.Tensor]:
|
|
1563
|
+
return self.language_model.compute_logits(hidden_states)
|
|
1564
|
+
|
|
1565
|
+
def load_weights(self, weights: Iterable[tuple[str,
|
|
1566
|
+
torch.Tensor]]) -> set[str]:
|
|
1567
|
+
|
|
1568
|
+
skip_prefixes = []
|
|
1569
|
+
if self.visual is None:
|
|
1570
|
+
skip_prefixes.extend(["visual."])
|
|
1571
|
+
loader = AutoWeightsLoader(self, skip_prefixes=skip_prefixes)
|
|
1572
|
+
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
|
|
1573
|
+
|
|
1574
|
+
def get_mm_mapping(self) -> MultiModelKeys:
|
|
1575
|
+
"""
|
|
1576
|
+
Get the module prefix in multimodal models
|
|
1577
|
+
"""
|
|
1578
|
+
return MultiModelKeys.from_string_field(
|
|
1579
|
+
language_model="language_model",
|
|
1580
|
+
connector="visual.merger.",
|
|
1581
|
+
tower_model="visual.",
|
|
1582
|
+
)
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
class Tarsier2MultiModalProcessor(Qwen2VLMultiModalProcessor):
|
|
1586
|
+
pass
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
class Tarsier2ImageProcessor(Qwen2VLImageProcessor):
|
|
1590
|
+
|
|
1591
|
+
def __init__(
|
|
1592
|
+
self,
|
|
1593
|
+
size: Optional[dict[str, int]] = None,
|
|
1594
|
+
**kwargs,
|
|
1595
|
+
) -> None:
|
|
1596
|
+
if size is not None and "min_pixels" in size and "max_pixels" in size:
|
|
1597
|
+
# Remap if Tarsier2-specific format is provided
|
|
1598
|
+
remapped_size = {
|
|
1599
|
+
"shortest_edge": size["min_pixels"],
|
|
1600
|
+
"longest_edge": size["max_pixels"]
|
|
1601
|
+
}
|
|
1602
|
+
super().__init__(size=remapped_size, **kwargs)
|
|
1603
|
+
else:
|
|
1604
|
+
super().__init__(size=size, **kwargs)
|
|
1605
|
+
|
|
1606
|
+
|
|
1607
|
+
class Tarsier2Processor(Qwen2VLProcessor):
|
|
1608
|
+
|
|
1609
|
+
def __init__(
|
|
1610
|
+
self,
|
|
1611
|
+
vision_config: dict,
|
|
1612
|
+
tokenizer: AnyTokenizer,
|
|
1613
|
+
**kwargs,
|
|
1614
|
+
):
|
|
1615
|
+
self.image_processor = Tarsier2ImageProcessor(**vision_config)
|
|
1616
|
+
super().__init__(
|
|
1617
|
+
image_processor=self.image_processor,
|
|
1618
|
+
tokenizer=tokenizer,
|
|
1619
|
+
video_processor=Qwen2VLVideoProcessor(**vision_config),
|
|
1620
|
+
chat_template=None,
|
|
1621
|
+
**kwargs)
|
|
1622
|
+
|
|
1623
|
+
|
|
1624
|
+
class Tarsier2ProcessingInfo(Qwen2VLProcessingInfo):
|
|
1625
|
+
|
|
1626
|
+
def get_hf_config(self) -> Qwen2VLConfig:
|
|
1627
|
+
model_path = self.ctx.model_config.model
|
|
1628
|
+
original_config = AutoConfig.from_pretrained(model_path)
|
|
1629
|
+
config_dict = original_config.to_dict()
|
|
1630
|
+
correct_config = Qwen2VLConfig.from_dict(config_dict)
|
|
1631
|
+
|
|
1632
|
+
return correct_config
|
|
1633
|
+
|
|
1634
|
+
def get_hf_processor(self, **kwargs: object) -> Tarsier2Processor:
|
|
1635
|
+
return Tarsier2Processor(
|
|
1636
|
+
vision_config=self.ctx.get_hf_image_processor_config(),
|
|
1637
|
+
tokenizer=self.get_tokenizer(),
|
|
1638
|
+
**kwargs,
|
|
1639
|
+
)
|
|
1640
|
+
|
|
1641
|
+
def get_image_processor(self) -> Tarsier2ImageProcessor:
|
|
1642
|
+
return Tarsier2ImageProcessor(
|
|
1643
|
+
**self.ctx.get_hf_image_processor_config())
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
@MULTIMODAL_REGISTRY.register_processor(Tarsier2MultiModalProcessor,
|
|
1647
|
+
info=Tarsier2ProcessingInfo,
|
|
1648
|
+
dummy_inputs=Qwen2VLDummyInputsBuilder)
|
|
1649
|
+
class Tarsier2ForConditionalGeneration(Qwen2VLForConditionalGeneration):
|
|
1650
|
+
hf_to_vllm_mapper = WeightsMapper(orig_to_new_prefix={
|
|
1651
|
+
"vision_tower.": "visual.",
|
|
1652
|
+
})
|
|
1653
|
+
|
|
1654
|
+
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
|
|
1655
|
+
# Tarsier2 uses llava as model_type, which will create a Qwen2VLConfig
|
|
1656
|
+
# as text_config, we need to reconstruct Qwen2VLConfig from LlavaConfig.
|
|
1657
|
+
config = vllm_config.model_config.hf_config
|
|
1658
|
+
qwen2vl_config = config.text_config
|
|
1659
|
+
qwen2vl_config.architectures = config.architectures
|
|
1660
|
+
vllm_config.model_config.hf_config = qwen2vl_config
|
|
1661
|
+
super().__init__(vllm_config=vllm_config, prefix=prefix)
|
|
1662
|
+
|
|
1663
|
+
def load_weights(self, weights: Iterable[tuple[str,
|
|
1664
|
+
torch.Tensor]]) -> set[str]:
|
|
1665
|
+
|
|
1666
|
+
skip_prefixes = []
|
|
1667
|
+
if self.visual is None:
|
|
1668
|
+
skip_prefixes.extend(["visual."])
|
|
1669
|
+
loader = AutoWeightsLoader(self, skip_prefixes=skip_prefixes)
|
|
1670
|
+
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
|