From 9c46f5a04e95ac2347949bb149939a4cd12af70c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 17 Aug 2026 13:19:26 +0000 Subject: [PATCH] =?UTF-8?q?[fix]=20baseline4=20copy=5Fblocks=20=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=E5=92=8C=20ex=5Fengine=20import=20=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E6=8E=A5=E7=BA=BF=E6=B2=A1=E6=8E=A5=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qwen3_6_scripts/paged_attn.py | 3 +-- qwen3_6_scripts/patch_ops.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/qwen3_6_scripts/paged_attn.py b/qwen3_6_scripts/paged_attn.py index c3f8492c..c27c615d 100644 --- a/qwen3_6_scripts/paged_attn.py +++ b/qwen3_6_scripts/paged_attn.py @@ -2282,5 +2282,4 @@ class PagedAttention: ) -> None: key_caches = [kv_cache[0] for kv_cache in kv_caches] value_caches = [kv_cache[1] for kv_cache in kv_caches] - import ixformer.functions as ixf_F - ixf_F.vllm_copy_cache(key_caches, value_caches, src_to_dists) + ops.copy_blocks(key_caches, value_caches, src_to_dists) \ No newline at end of file diff --git a/qwen3_6_scripts/patch_ops.sh b/qwen3_6_scripts/patch_ops.sh index c454726e..1ce727fe 100755 --- a/qwen3_6_scripts/patch_ops.sh +++ b/qwen3_6_scripts/patch_ops.sh @@ -247,10 +247,19 @@ INIT_EOF import logging _logger = logging.getLogger("ix_startup_patch") def apply(): + import sys, os + # Ensure ex_engine is importable from both locations + for p in ["/workspace/qwen3_6_scripts/ex_engine/..", + "/workspace/qwen3_6_scripts", + "/workspace/ex_engine/..", + "/workspace"]: + rp = os.path.realpath(p) + if os.path.isdir(rp) and rp not in sys.path: + sys.path.insert(0, rp) n = 0 # 1. ix_full_bridge patches (rms_norm, silu_and_mul, linear) try: - from vllm.ex_engine.python.patch_vllm_ops import apply_all_patches + from ex_engine.python.patch_vllm_ops import apply_all_patches k = apply_all_patches() n += k if k > 0: @@ -259,7 +268,7 @@ def apply(): _logger.warning("ix_startup_patch: bridge patches failed: %s", e) # 2. xllm kernel patches (topk_softmax, norm, activation, rope, cache) try: - from vllm.ex_engine.python.patch_vllm_hot_path import apply as apply_hot + from ex_engine.python.patch_vllm_hot_path import apply as apply_hot k = apply_hot(strict=False) n += k if k > 0: