| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | """Configuration for execution auxiliary outputs.""" |
| 4 | |
| 5 | from pydantic import Field |
| 6 | |
| 7 | from vllm.config.utils import config |
| 8 | |
| 9 | |
| 10 | @config |
| 11 | class AuxOutputConfig: |
| 12 | """Configuration for auxiliary-output delivery.""" |
| 13 | |
| 14 | enable_return_routed_experts: bool = False |
| 15 | """Capture and return routed-experts auxiliary outputs.""" |
| 16 | |
| 17 | max_bytes: int | None = Field(default=None, gt=0) |
| 18 | """LRU capacity, or ``None`` to derive it from the KV cache capacity.""" |
| 19 | |
| 20 | @property |
| 21 | def enabled(self) -> bool: |
| 22 | """Whether any execution auxiliary output is enabled.""" |
| 23 | return self.enable_return_routed_experts |
| 24 | |
| 25 | def compute_hash(self) -> str: |
| 26 | """Hash AuxOutput settings that alter the model forward graph.""" |
| 27 | from vllm.config.utils import hash_factors |
| 28 | |
| 29 | return hash_factors( |
| 30 | {"enable_return_routed_experts": self.enable_return_routed_experts} |
| 31 | ) |