Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
33 changes: 33 additions & 0 deletions container/deps/vllm/install_vllm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,39 @@ if [ "$DEVICE" = "cpu" ]; then
python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38
uv pip install dist/*.whl
fi

# Apply vendored vLLM patches for this ref. Used to carry upstream fixes
# that are missing from the pinned release wheel (e.g. PR backports
# dropped between rc and final tags). Skipped when:
# - VLLM_VER is >= 0.21.0 (upstream fix expected to be merged by then)
# - no patches/<VLLM_REF>/ subdir exists, or it has no *.patch files
#
# rc/post/dev/+ suffixes are stripped before comparison (so v0.21.0rc0
# also trips the skip). Non-semver refs (commit SHA, branch name) fall
# through to the directory-existence check.
VLLM_VER_BASE=$(echo "$VLLM_VER" | sed -E 's/(rc|\.post|\.dev|\+).*//')
PATCH_DIR="/tmp/deps/vllm/patches/${VLLM_REF}"
if [[ "$VLLM_VER_BASE" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && \
printf '%s\n%s\n' "0.21.0" "$VLLM_VER_BASE" | sort -V | head -n1 | grep -qx "0.21.0"; then
echo "vLLM $VLLM_VER >= 0.21 — skipping vendored patches (assumed merged upstream)"
elif [ -d "$PATCH_DIR" ] && compgen -G "$PATCH_DIR/*.patch" > /dev/null; then
echo "\n=== Applying vendored vLLM patches from $PATCH_DIR ==="
# Run from / so cwd isn't ahead of the venv on sys.path. The build
# script is still inside the $INSTALLATION_DIR/vllm source clone here
# (from the earlier `cd vllm`), and that clone contains a `vllm/`
# package directory. Without the cd, `import vllm` resolves the
# source clone, vllm.__file__ points at /opt/vllm/vllm/__init__.py,
# and the patch lands on the build-only source tree — not on the
# installed wheel that the runtime actually imports. Same pattern as
# the post-install verification block above.
VLLM_SITE_PACKAGES=$(cd / && python3 -c "import vllm, os; print(os.path.dirname(os.path.dirname(vllm.__file__)))")
for p in "$PATCH_DIR"/*.patch; do
echo " $(basename "$p")"
patch -p1 -d "$VLLM_SITE_PACKAGES" < "$p"
done
Comment thread
furionw marked this conversation as resolved.
Resolved
echo "✓ vLLM patches applied"
fi

echo "✓ vLLM installation completed"

echo "\n=== Installing LMCache from source ==="
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From 22631f80a01a04b06398952e77d7890ab660ab10 Mon Sep 17 00:00:00 2001
Comment thread
dmitry-tokarev-nv marked this conversation as resolved.
Resolved
From: Isotr0py <mozf@mail2.sysu.edu.cn>
Date: Mon, 27 Apr 2026 15:27:06 +0800
Subject: [PATCH] [Bugfix] Remove invalid deepstack boundary check for Qwen3-VL
(#40932)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
---
vllm/model_executor/models/qwen3_omni_moe_thinker.py | 11 -----------
vllm/model_executor/models/qwen3_vl.py | 11 -----------
2 files changed, 22 deletions(-)

diff --git a/vllm/model_executor/models/qwen3_omni_moe_thinker.py b/vllm/model_executor/models/qwen3_omni_moe_thinker.py
index ff8962c82..44e656ab8 100755
--- a/vllm/model_executor/models/qwen3_omni_moe_thinker.py
+++ b/vllm/model_executor/models/qwen3_omni_moe_thinker.py
@@ -1778,11 +1778,6 @@ class Qwen3OmniMoeThinkerForConditionalGeneration(
return None # If vision tower is skipped
if getattr(self, "deepstack_input_embeds_num_tokens", 0) == 0:
return None
- if num_tokens > self.deepstack_input_embeds_num_tokens:
- raise ValueError(
- "Requested more deepstack tokens than available in buffer: "
- f"{num_tokens=} > {self.deepstack_input_embeds_num_tokens=}"
- )

# get deepstack_input_embeds from buffer, and clear the buffer
return IntermediateTensors(
@@ -1824,12 +1819,6 @@ class Qwen3OmniMoeThinkerForConditionalGeneration(

# clear deepstack_input_embeds in buffer
if num_tokens > 0:
- if num_tokens > self.deepstack_input_embeds_num_tokens:
- raise ValueError(
- "Requested to clear more deepstack tokens than available in "
- "buffer: "
- f"{num_tokens=} > {self.deepstack_input_embeds_num_tokens=}"
- )
for idx in range(self.deepstack_num_level):
self.deepstack_input_embeds[idx][:num_tokens].zero_()
self.deepstack_input_embeds_num_tokens = 0
diff --git a/vllm/model_executor/models/qwen3_vl.py b/vllm/model_executor/models/qwen3_vl.py
index 4a0de15f0..2575f634b 100644
--- a/vllm/model_executor/models/qwen3_vl.py
+++ b/vllm/model_executor/models/qwen3_vl.py
@@ -1716,11 +1716,6 @@ class Qwen3VLForConditionalGeneration(
return None # If vision tower is skipped
if getattr(self, "deepstack_input_embeds_num_tokens", 0) == 0:
return None
- if num_tokens > self.deepstack_input_embeds_num_tokens:
- raise ValueError(
- "Requested more deepstack tokens than available in buffer: "
- f"{num_tokens=} > {self.deepstack_input_embeds_num_tokens=}"
- )

# get deepstack_input_embeds from buffer, and clear the buffer
return IntermediateTensors(
@@ -1762,12 +1757,6 @@ class Qwen3VLForConditionalGeneration(

# clear deepstack_input_embeds in buffer
if num_tokens > 0:
- if num_tokens > self.deepstack_input_embeds_num_tokens:
- raise ValueError(
- "Requested to clear more deepstack tokens than available in "
- "buffer: "
- f"{num_tokens=} > {self.deepstack_input_embeds_num_tokens=}"
- )
for idx in range(self.deepstack_num_level):
self.deepstack_input_embeds[idx][:num_tokens].zero_()
self.deepstack_input_embeds_num_tokens = 0
--
2.43.0

Loading