Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions vllm/v1/worker/gpu_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@

logger = init_logger(__name__)

# empirically observed that the memory profiling may
# slightly underestimate the memory consumption.
# So leave a small buffer (=150MiB) to avoid OOM.
REDUNDANCY_BUFFER_MEMORY_BYTES = 150 * (1 << 20)
Comment thread
panpan0000 marked this conversation as resolved.

if TYPE_CHECKING:
from vllm.model_executor.model_loader.tensorizer import TensorizerConfig
from vllm.v1.worker.gpu_model_runner import GPUModelRunner
Expand Down Expand Up @@ -418,6 +423,7 @@ def determine_available_memory(self) -> int:
self.requested_memory
- profile_result.non_kv_cache_memory
- cudagraph_memory_estimate_applied
- REDUNDANCY_BUFFER_MEMORY_BYTES
)

unrequested_memory = self.init_snapshot.free_memory - self.requested_memory
Expand Down Expand Up @@ -614,11 +620,8 @@ def compile_or_warm_up_model(self) -> float:
# Users may want fine-grained control to specify kv cache
# memory size.

# empirically observed that the memory profiling may
# slightly underestimate the memory consumption.
# So leave a small buffer (=150MiB) to avoid OOM.
redundancy_buffer_memory = 150 * (1 << 20)

redundancy_buffer_memory = REDUNDANCY_BUFFER_MEMORY_BYTES

non_kv_cache_memory = (
self.model_runner.model_memory_usage
+ self.peak_activation_memory
Expand Down
Loading