Repository navigation
[rl] vLLM watermark as a VLLMEngine.Config field, default 0.1 - #5951
Merged
Merged
Conversation
This was referenced Nov 8, 2026
felipemello1
marked this pull request as ready for review
November 8, 2026 23:55
felipemello1
requested review from
acisseJZhong,
fegin,
shuhuayu,
tianyu-l and
wwwjn
as code owners
November 8, 2026 23:55
tianyu-l
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary (human-written)
If kv cache reaches 100%, any new request will case preemption, non stop. This crashes the generator. Watermark at 0.1 doesn't allow new requests to be added until kv cache < 90%.
Agent details
NOTE: measured on H100 only; needs retesting on Blackwell. The one Blackwell run we know of (last NOTE) is KV-full, and the effect of 0.1 there is unknown.
TLDR:
VLLMEngine.Config.watermarkexposes vLLM's KV admission reserve and defaults it to 0.1 (vLLM's default is 0.0). On one H100 9B engine that preempts a lot, 0.1 cuts preemptions 783 -> 11 and wall time 8.6%.Problem
watermarkonly throughextra_engine_args, and no recipe sets it.Solution
VLLMEngine.Config.watermark: float = 0.1, passed toEngineArgsbyVLLMEngineand bygenerate.py.extra_engine_args={"watermark": ...}raisesValueErrorand names the field, like the other keys TorchTitan sets.Results
You may ask:
extra_engine_args? A default needs a field.NOTE: this changes engine admission for every RL recipe and for
generate.py.NOTE: 0.1 was not run on the unpressured or the multi-turn shape; only 0.03 was, with no change.
NOTE: with
session_kv_holderon, the holder's free-block floor includes the watermark (session_kv_holder.py:84), so it releases held sessions earlier. No recipe turns the holder on.NOTE: anything that sets
watermarkthroughextra_engine_argsmust move to the field, or it raises. No recipe in this repo does.NOTE: Blackwell: a GB300 Qwen3.5-35B-A3B math run sat at 99% KV for hours (~355 running and ~150 waiting per engine, watermark 0.0). Its preemption count is unknown: vLLM's stat line resets the counter before printing it, so
Preemptions:never shows. So 0.1 may help there (fewer preemptions) or cost (fewer running; the CPU model says 6-9%). Not measured.Test plan
test_engine_config_reaches_engine_args: a 0.03 watermark and an extra engine argument both reachEngineArgs.test_extra_engine_args_rejects_torchtitan_owned_keys[watermark].