[fix] baseline4 copy_blocks 崩溃和 ex_engine import 路径两个接线没接对

This commit is contained in:
root
2026-08-17 13:19:26 +00:00
parent 1af45de371
commit 9c46f5a04e
2 changed files with 12 additions and 4 deletions

View File

@@ -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)

View File

@@ -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: