adjust config type and remove config path for simplicity

Signed-off-by: Lu Fang <fanglu@fb.com>
This commit is contained in:
Lu Fang 2025-09-08 17:23:15 -07:00
parent 87c737016d
commit 76c9ec0ddf
3 changed files with 2 additions and 44 deletions

View File

@ -30,22 +30,6 @@ Dump first layers module, all devices for step 0
python3 ./examples/offline_inference/llm_engine_example.py --model "meta-llama/Llama-3.1-8B-Instruct" --enforce-eager --intermediate-log-config '{"enabled": true, "module_call_match": "layers\\.0\\."}'
```
Dump customized layers, devices, steps through a config file
The configuration file should be a JSON file with the following structure:
```json
{
"output_dir": "/tmp/vllm_intermediates",
"module_call_match": ["layers\\.0\\.(?!.*rotary_emb).*", "rotary_emb:0", "embed_tokens", "model\\.norm"],
"log_step_ids": [0, 1],
"device_names": ["cuda:0"]
}
```
```bash
python3 ./examples/offline_inference/llm_engine_example.py --model "meta-llama/Llama-3.1-8B-Instruct" --enforce-eager --intermediate-log-config-path $HOME/intermediate_logging_config.json
```
#### Configuration Parameters

View File

@ -4122,11 +4122,6 @@ class IntermediateLoggingConfig:
output_dir: str = "/tmp/vllm_intermediates"
"""Directory where to save the intermediate tensors."""
reload_input_dir: Optional[str] = None
"""Directory where to load the inputs for the steps/modules.
This is used when we want to check per module numerical gaps instead
of accumulated gap to further dive into the actual numerical issues."""
module_call_match: Optional[list[str]] = None
"""Match modules by name regex and call index (
a module can be called multiple times in a step)

View File

@ -25,8 +25,7 @@ from vllm.config import (BlockSize, CacheConfig, CacheDType, CompilationConfig,
ConfigFormat, ConfigType, ConvertOption,
DecodingConfig, DetailedTraceModules, Device,
DeviceConfig, DistributedExecutorBackend,
GuidedDecodingBackend, HfOverrides,
IntermediateLoggingConfig, KVEventsConfig,
GuidedDecodingBackend, HfOverrides, KVEventsConfig,
KVTransferConfig, LoadConfig, LogprobsMode,
LoRAConfig, ModelConfig, ModelDType, ModelImpl,
MultiModalConfig, ObservabilityConfig, ParallelConfig,
@ -449,9 +448,8 @@ class EngineArgs:
async_scheduling: bool = SchedulerConfig.async_scheduling
# DEPRECATED
enable_prompt_adapter: bool = False
intermediate_log_config_path: Optional[str] = None
intermediate_log_config: Optional[IntermediateLoggingConfig] = None
intermediate_log_config: Optional[dict[str, Any]] = None
kv_sharing_fast_prefill: bool = \
CacheConfig.kv_sharing_fast_prefill
@ -853,11 +851,6 @@ class EngineArgs:
vllm_group.add_argument("--intermediate-log-config",
**vllm_kwargs["intermediate_log_config"])
vllm_group.add_argument(
"--intermediate-log-config-path",
type=str,
help="The path to the configurations for intermediate loggings. "
"Should be a string.")
vllm_group.add_argument("--kv-transfer-config",
**vllm_kwargs["kv_transfer_config"])
vllm_group.add_argument('--kv-events-config',
@ -979,18 +972,6 @@ class EngineArgs:
pt_load_map_location=self.pt_load_map_location,
)
def create_intermediate_log_config_from_path(self, ) -> None:
"""set intermediate_log_config from intermediate_log_config_path
"""
if self.intermediate_log_config_path is not None:
if self.intermediate_log_config is not None:
logger.warning("The `intermediate_log_config` is set,"
"`intermediate_log_config_path` "
"will be ignored.")
with open(self.intermediate_log_config_path) as f:
self.intermediate_log_config = \
IntermediateLoggingConfig.from_dict(json.load(f))
def create_speculative_config(
self,
target_model_config: ModelConfig,
@ -1274,8 +1255,6 @@ class EngineArgs:
disable_log_stats=self.disable_log_stats,
)
self.create_intermediate_log_config_from_path()
# Reminder: Please update docs/features/compatibility_matrix.md
# If the feature combo become valid
if self.num_scheduler_steps > 1: