MemoryMonitorConfig#
- class tensorrt_llm.llmapi.MemoryMonitorConfig(
- *,
- mode: Literal['off', 'oom', 'full'] = 'oom',
- ranks: Annotated[List[Annotated[int, Ge(ge=0)]] | None, MinLen(min_length=1)] = None,
- record_stacks: bool = False,
- periodic_report_interval_s: Annotated[float | None, Ge(ge=1.0), Le(le=604800.0), _PydanticGeneralMetadata(allow_inf_nan=False)] = None,
- oom_report_interval_s: Annotated[float, Ge(ge=0.0), Le(le=604800.0), _PydanticGeneralMetadata(allow_inf_nan=False)] = 60.0,
- report_dir: Annotated[str | None, MinLen(min_length=1)] = None,
Bases:
StrictBaseModelConfiguration for the GPU memory monitor.
Each field corresponds to a
TLLM_MEM_MONITOR*environment variable; a variable set to a non-blank value overrides the field, andTorchLlmArgsapplies it when the arguments are validated. Seedocs/source/features/memory-monitor.md.- field mode: Literal['off', 'oom', 'full'] = 'oom'#
‘oom’ reports out-of-memory errors that the executor’s own error handling sees and records nothing else; ‘full’ also records startup, reports when it completes, compares later reports with that point and reports out-of-memory errors seen anywhere in the process; ‘off’ produces no reports on its own. YAML’s unquoted off and on (booleans) and 0 and 1 are read as ‘off’ and ‘full’. Overridden by TLLM_MEM_MONITOR.
- field oom_report_interval_s: float = 60.0#
Minimum seconds between two out-of-memory reports, at most a week. Overridden by TLLM_MEM_MONITOR_OOM_INTERVAL.
- Constraints:
ge = 0.0
le = 604800.0
allow_inf_nan = False
- field periodic_report_interval_s: float | None = None#
In ‘full’ mode, report every this many seconds while serving, at most once a week. Overridden by TLLM_MEM_MONITOR_INTERVAL, where 0 turns the periodic report off.
- Constraints:
ge = 1.0
le = 604800.0
allow_inf_nan = False
- field ranks: List[Annotated[int, Ge(ge=0)]] | None = None#
Ranks that report; all ranks when unset. Each must be below the job’s world size. Overridden by TLLM_MEM_MONITOR_RANKS.
- Constraints:
min_length = 1
- field record_stacks: bool = False#
In ‘full’ mode, record the Python stack of every live PyTorch allocation so that unattributed PyTorch memory is broken down by the code that allocated it. Slows every PyTorch allocation; meant for reproducing a problem. Overridden by TLLM_MEM_MONITOR_STACKS.
- field report_dir: str | None = None#
Directory to which every report except on-demand ones is also written, one file per report. It is created readable by its owner only, and only the newest 100 periodic reports of each rank and process are kept. Overridden by TLLM_MEM_MONITOR_DIR.
- Constraints:
min_length = 1
- __init__(**data: Any) None#
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.