[Startup][UX] Enable CUDAGraph memory profiling by default (#38284)
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com> Co-authored-by: Tyler Michael Smith <tlrmchlsmth@gmail.com>
This commit is contained in:
co-authored by
Tyler Michael Smith
parent
9db4650e5e
commit
96a85c5750
@@ -51,10 +51,10 @@ class CacheConfig:
|
||||
"""Whether block_size was explicitly provided. Derived automatically."""
|
||||
user_specified_mamba_block_size: bool = field(default=False, init=False)
|
||||
"""Whether mamba_block_size was explicitly provided. Derived automatically."""
|
||||
gpu_memory_utilization: float = Field(default=0.9, gt=0, le=1)
|
||||
gpu_memory_utilization: float = Field(default=0.92, gt=0, le=1)
|
||||
"""The fraction of GPU memory to be used for the model executor, which can
|
||||
range from 0 to 1. For example, a value of 0.5 would imply 50% GPU memory
|
||||
utilization. If unspecified, will use the default value of 0.9. This is a
|
||||
utilization. If unspecified, will use the default value of 0.92. This is a
|
||||
per-instance limit, and only applies to the current vLLM instance. It does
|
||||
not matter if you have another vLLM instance running on the same GPU. For
|
||||
example, if you have two vLLM instances running on the same GPU, you can
|
||||
|
||||
@@ -228,7 +228,7 @@ class LLM:
|
||||
tokenizer_revision: str | None = None,
|
||||
chat_template: Path | str | None = None,
|
||||
seed: int = 0,
|
||||
gpu_memory_utilization: float = 0.9,
|
||||
gpu_memory_utilization: float = 0.92,
|
||||
cpu_offload_gb: float = 0,
|
||||
offload_group_size: int = 0,
|
||||
offload_num_in_group: int = 1,
|
||||
|
||||
+3
-3
@@ -253,7 +253,7 @@ if TYPE_CHECKING:
|
||||
VLLM_CUDA_COMPATIBILITY_PATH: str | None = None
|
||||
VLLM_ELASTIC_EP_SCALE_UP_LAUNCH: bool = False
|
||||
VLLM_ELASTIC_EP_DRAIN_REQUESTS: bool = False
|
||||
VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS: bool = False
|
||||
VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS: bool = True
|
||||
VLLM_NIXL_EP_MAX_NUM_RANKS: int = 32
|
||||
VLLM_XPU_ENABLE_XPU_GRAPH: bool = False
|
||||
VLLM_LORA_ENABLE_DUAL_STREAM: bool = False
|
||||
@@ -1687,9 +1687,9 @@ environment_variables: dict[str, Callable[[], Any]] = {
|
||||
),
|
||||
# If set to 1, enable CUDA graph memory estimation during memory profiling.
|
||||
# This profiles CUDA graph memory usage to provide more accurate KV cache
|
||||
# memory allocation. Disabled by default to preserve existing behavior.
|
||||
# memory allocation. Enabled by default as of v0.21.0
|
||||
"VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS": lambda: bool(
|
||||
int(os.getenv("VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS", "0"))
|
||||
int(os.getenv("VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS", "1"))
|
||||
),
|
||||
# NIXL EP environment variables
|
||||
"VLLM_NIXL_EP_MAX_NUM_RANKS": lambda: int(
|
||||
|
||||
@@ -454,14 +454,13 @@ class Worker(WorkerBase):
|
||||
1.0,
|
||||
)
|
||||
logger.info(
|
||||
"CUDA graph memory profiling is enabled "
|
||||
"(VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=1). "
|
||||
"This will become the default in v0.21. "
|
||||
"The current --gpu-memory-utilization=%.4f is equivalent "
|
||||
"to --gpu-memory-utilization=%.4f without CUDA graph "
|
||||
"memory profiling. To maintain the same effective KV "
|
||||
"cache size as before, increase "
|
||||
"--gpu-memory-utilization to %.4f.",
|
||||
"CUDA graph memory profiling is enabled (default since "
|
||||
"v0.21.0). The current --gpu-memory-utilization=%.4f is "
|
||||
"equivalent to --gpu-memory-utilization=%.4f without "
|
||||
"CUDA graph memory profiling. To maintain the same "
|
||||
"effective KV cache size as before, increase "
|
||||
"--gpu-memory-utilization to %.4f. To disable, set "
|
||||
"VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0.",
|
||||
current_util,
|
||||
equiv_util,
|
||||
suggested_util,
|
||||
@@ -471,14 +470,14 @@ class Worker(WorkerBase):
|
||||
round(current_util + cg_util_delta, 4),
|
||||
1.0,
|
||||
)
|
||||
logger.info(
|
||||
"In v0.21, CUDA graph memory profiling will be enabled "
|
||||
"by default (VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=1), "
|
||||
"which more accurately accounts for CUDA graph memory "
|
||||
"during KV cache allocation. To try it now, set "
|
||||
"VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=1 and increase "
|
||||
"--gpu-memory-utilization from %.4f to %.4f to maintain "
|
||||
"the same effective KV cache size.",
|
||||
logger.warning(
|
||||
"CUDA graph memory profiling is disabled "
|
||||
"(VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0). "
|
||||
"Without it, CUDA graph memory is not accounted for "
|
||||
"during KV cache allocation, which may require lowering "
|
||||
"--gpu-memory-utilization to avoid OOM. Consider "
|
||||
"re-enabling it (the default as of v0.21.0) and increasing "
|
||||
"--gpu-memory-utilization from %.4f to %.4f.",
|
||||
current_util,
|
||||
suggested_util,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user