Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce default value of VLLM_GRAPH_RESERVED_MEM to 0.1 #292

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions README_GAUDI.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ mark 90% of free device memory at that point as usable. Next, KV cache
gets allocated, model is warmed up, and HPU Graphs are captured.
Environment variable `VLLM_GRAPH_RESERVED_MEM` defines the ratio of
memory reserved for HPU Graphs capture. With its default value
(`VLLM_GRAPH_RESERVED_MEM=0.4`), 40% of usable memory will be reserved
(`VLLM_GRAPH_RESERVED_MEM=0.1`), 10% of usable memory will be reserved
for graph capture (later referred to as \"usable graph memory\"), and
the remaining 60% will be utilized for KV cache. Environment variable
the remaining 90% will be utilized for KV cache. Environment variable
`VLLM_GRAPH_PROMPT_RATIO` determines the ratio of usable graph memory
reserved for prefill and decode graphs. By default
(`VLLM_GRAPH_PROMPT_RATIO=0.5`), both stages have equal memory
Expand Down Expand Up @@ -445,7 +445,7 @@ Environment variables
- `VLLM_SKIP_WARMUP`: if `true`, warmup will be skipped, `false` by
default
- `VLLM_GRAPH_RESERVED_MEM`: percentage of memory dedicated for
HPUGraph capture, `0.4` by default
HPUGraph capture, `0.1` by default
- `VLLM_GRAPH_PROMPT_RATIO`: percentage of reserved graph memory
dedicated for prompt graphs, `0.5` by default
- `VLLM_GRAPH_PROMPT_STRATEGY`: strategy determining order of prompt
Expand Down
4 changes: 2 additions & 2 deletions docs/source/getting_started/gaudi-installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Before KV cache gets allocated, model weights are loaded onto the device, and a
Only after that, ``gpu_memory_utilization`` flag is utilized - at its default value, will mark 90% of free device memory at that point as usable.
Next, KV cache gets allocated, model is warmed up, and HPU Graphs are captured.
Environment variable ``VLLM_GRAPH_RESERVED_MEM`` defines the ratio of memory reserved for HPU Graphs capture.
With its default value (``VLLM_GRAPH_RESERVED_MEM=0.4``), 40% of usable memory will be reserved for graph capture (later referred to as "usable graph memory"), and the remaining 60% will be utilized for KV cache.
With its default value (``VLLM_GRAPH_RESERVED_MEM=0.1``), 10% of usable memory will be reserved for graph capture (later referred to as "usable graph memory"), and the remaining 90% will be utilized for KV cache.
Environment variable ``VLLM_GRAPH_PROMPT_RATIO`` determines the ratio of usable graph memory reserved for prefill and decode graphs. By default (``VLLM_GRAPH_PROMPT_RATIO=0.5``), both stages have equal memory constraints.
Lower value corresponds to less usable graph memory reserved for prefill stage, e.g. ``VLLM_GRAPH_PROMPT_RATIO=0.2`` will reserve 20% of usable graph memory for prefill graphs, and 80% of usable graph memory for decode graphs.

Expand Down Expand Up @@ -322,7 +322,7 @@ Environment variables
**Performance tuning knobs:**

- ``VLLM_SKIP_WARMUP``: if ``true``, warmup will be skipped, ``false`` by default
- ``VLLM_GRAPH_RESERVED_MEM``: percentage of memory dedicated for HPUGraph capture, ``0.4`` by default
- ``VLLM_GRAPH_RESERVED_MEM``: percentage of memory dedicated for HPUGraph capture, ``0.1`` by default
- ``VLLM_GRAPH_PROMPT_RATIO``: percentage of reserved graph memory dedicated for prompt graphs, ``0.5`` by default
- ``VLLM_GRAPH_PROMPT_STRATEGY``: strategy determining order of prompt graph capture, ``min_tokens`` or ``max_bs``, ``min_tokens`` by default
- ``VLLM_GRAPH_DECODE_STRATEGY``: strategy determining order of decode graph capture, ``min_tokens`` or ``max_bs``, ``max_bs`` by default
Expand Down
2 changes: 1 addition & 1 deletion vllm/worker/habana_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def determine_num_available_blocks(self) -> Tuple[int, int]:

cache_block_size = self.get_cache_block_size_bytes()
graph_reserved_mem = (float(
os.environ.get('VLLM_GRAPH_RESERVED_MEM', '0.4'))
os.environ.get('VLLM_GRAPH_RESERVED_MEM', '0.1'))
if not self.model_config.enforce_eager else 0)
graph_headroom = 1 - graph_reserved_mem
available_hpu_memory = free_hpu_memory * \
Expand Down
Loading