From 7d74ad4e8e0a8b0b72f7c3327413dc9301015978 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 19 Aug 2026 02:46:40 +0000 Subject: [PATCH] [fix] baseline docker build from ex_engine.python.xllm_ops import _get error --- qwen3_6_scripts/paged_attn.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/qwen3_6_scripts/paged_attn.py b/qwen3_6_scripts/paged_attn.py index 3b50e939..afc52568 100644 --- a/qwen3_6_scripts/paged_attn.py +++ b/qwen3_6_scripts/paged_attn.py @@ -2294,8 +2294,18 @@ class PagedAttention: # Use xllm_cache.block_copy kernel — single launch for all layers. if src_to_dists.numel() == 0: return - from ex_engine.python.xllm_ops import _get as _xllm_get - _xllm_block_copy = _xllm_get("xllm_cache").block_copy + + import importlib.util as _ilu + import os as _os + # paged_attn.py lives at VLLM_ROOT/attention/ops/paged_attn.py + # xllm_cache.so lives at VLLM_ROOT/xllm_cache.so + _vllm_root = _os.path.dirname(_os.path.dirname(_os.path.dirname( + _os.path.abspath(__file__)))) + _so = _os.path.join(_vllm_root, "xllm_cache.so") + _spec = _ilu.spec_from_file_location("xllm_cache", _so) + _mod = _ilu.module_from_spec(_spec) + _spec.loader.exec_module(_mod) + _xllm_block_copy = _mod.block_copy device = src_to_dists.device n = src_to_dists.size(0) @@ -2319,3 +2329,4 @@ class PagedAttention: _xllm_block_copy(key_ptrs, val_ptrs, src_indices, dst_indices, cum_sum, numel_per_block, cache_dtype) + \ No newline at end of file