Skip to content

[Model Runner V2] Reserve CUDA graph memory - #53306

Open
njhill wants to merge 8 commits into
vllm-project:mainfrom
njhill:fix/v2-runner-cudagraph-memory-profiling
Open

[Model Runner V2] Reserve CUDA graph memory#53306
njhill wants to merge 8 commits into
vllm-project:mainfrom
njhill:fix/v2-runner-cudagraph-memory-profiling

Conversation

@njhill

@njhill njhill commented Aug 21, 2026

Copy link
Copy Markdown
Member

Profile cuda graph memory usage at startup so that it can be factored into the kv cache auto-sizing, as MRV1 already does.

Note we are hoping to replace this with #50779 soon but it will unblock the change to make MRV2 default for all models in the meantime.

This includes the commits from #49233 by @anhtra3889 plus some fixes / additional rework.

Fixes: #49224

anht3889 and others added 7 commits July 21, 2026 04:33
Model Runner V2 became the default for dense models in 0.25.1, but its
profile_cudagraph_memory() was a placeholder returning 0. Worker.
determine_available_memory() subtracts this estimate before sizing the
KV cache, so with V2 no headroom was reserved for CUDA graph capture:
the KV cache claimed the whole gpu_memory_utilization budget and
capture_model() OOMed at startup (e.g. Llama-3.1-70B FP8, TP=8 on L40S).

Implement profile_cudagraph_memory() for the V2 runner, reusing its own
initialize_kv_cache()/capture_model(): bootstrap a minimal KV cache,
capture graphs into a throwaway pool (so their memory is reclaimed and
does not pollute the persistent global pool), measure the free-memory
delta, then release the profiling state while keeping model weights.

Fixes vllm-project#49224

Signed-off-by: Anh Tran <anh.tran.3889@gmail.com>
Signed-off-by: Nick Hill <nickhill123@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@njhill

njhill commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

/ci run all

@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 21, 2026
@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #85073 for commit 36a1131bab0e.

@vllm-project vllm-project deleted a comment from mergify Bot Aug 21, 2026
@njhill

njhill commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

/ci run all

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #85113 for commit c72b87c3d36e.

@github-project-automation github-project-automation Bot moved this to Ready in NVIDIA Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mrv2 Model Runner V2 specific nvidia ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Ready

4 participants