mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-24 18:44:29 +08:00
adjust config type and remove config path for simplicity
Signed-off-by: Lu Fang <fanglu@fb.com>
This commit is contained in:
parent
87c737016d
commit
76c9ec0ddf
@ -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\\."}'
|
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
|
#### Configuration Parameters
|
||||||
|
|
||||||
|
|||||||
@ -4122,11 +4122,6 @@ class IntermediateLoggingConfig:
|
|||||||
output_dir: str = "/tmp/vllm_intermediates"
|
output_dir: str = "/tmp/vllm_intermediates"
|
||||||
"""Directory where to save the intermediate tensors."""
|
"""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
|
module_call_match: Optional[list[str]] = None
|
||||||
"""Match modules by name regex and call index (
|
"""Match modules by name regex and call index (
|
||||||
a module can be called multiple times in a step)
|
a module can be called multiple times in a step)
|
||||||
|
|||||||
@ -25,8 +25,7 @@ from vllm.config import (BlockSize, CacheConfig, CacheDType, CompilationConfig,
|
|||||||
ConfigFormat, ConfigType, ConvertOption,
|
ConfigFormat, ConfigType, ConvertOption,
|
||||||
DecodingConfig, DetailedTraceModules, Device,
|
DecodingConfig, DetailedTraceModules, Device,
|
||||||
DeviceConfig, DistributedExecutorBackend,
|
DeviceConfig, DistributedExecutorBackend,
|
||||||
GuidedDecodingBackend, HfOverrides,
|
GuidedDecodingBackend, HfOverrides, KVEventsConfig,
|
||||||
IntermediateLoggingConfig, KVEventsConfig,
|
|
||||||
KVTransferConfig, LoadConfig, LogprobsMode,
|
KVTransferConfig, LoadConfig, LogprobsMode,
|
||||||
LoRAConfig, ModelConfig, ModelDType, ModelImpl,
|
LoRAConfig, ModelConfig, ModelDType, ModelImpl,
|
||||||
MultiModalConfig, ObservabilityConfig, ParallelConfig,
|
MultiModalConfig, ObservabilityConfig, ParallelConfig,
|
||||||
@ -449,9 +448,8 @@ class EngineArgs:
|
|||||||
async_scheduling: bool = SchedulerConfig.async_scheduling
|
async_scheduling: bool = SchedulerConfig.async_scheduling
|
||||||
# DEPRECATED
|
# DEPRECATED
|
||||||
enable_prompt_adapter: bool = False
|
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 = \
|
kv_sharing_fast_prefill: bool = \
|
||||||
CacheConfig.kv_sharing_fast_prefill
|
CacheConfig.kv_sharing_fast_prefill
|
||||||
@ -853,11 +851,6 @@ class EngineArgs:
|
|||||||
|
|
||||||
vllm_group.add_argument("--intermediate-log-config",
|
vllm_group.add_argument("--intermediate-log-config",
|
||||||
**vllm_kwargs["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_group.add_argument("--kv-transfer-config",
|
||||||
**vllm_kwargs["kv_transfer_config"])
|
**vllm_kwargs["kv_transfer_config"])
|
||||||
vllm_group.add_argument('--kv-events-config',
|
vllm_group.add_argument('--kv-events-config',
|
||||||
@ -979,18 +972,6 @@ class EngineArgs:
|
|||||||
pt_load_map_location=self.pt_load_map_location,
|
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(
|
def create_speculative_config(
|
||||||
self,
|
self,
|
||||||
target_model_config: ModelConfig,
|
target_model_config: ModelConfig,
|
||||||
@ -1274,8 +1255,6 @@ class EngineArgs:
|
|||||||
disable_log_stats=self.disable_log_stats,
|
disable_log_stats=self.disable_log_stats,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.create_intermediate_log_config_from_path()
|
|
||||||
|
|
||||||
# Reminder: Please update docs/features/compatibility_matrix.md
|
# Reminder: Please update docs/features/compatibility_matrix.md
|
||||||
# If the feature combo become valid
|
# If the feature combo become valid
|
||||||
if self.num_scheduler_steps > 1:
|
if self.num_scheduler_steps > 1:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user