fix(bridge): ix_moe_bridge链接加--unresolved-symbols + probe脚本
ix_moe_bridge.so编译成功但加载时undefined symbol: silu_and_mul 原因:libixformer.so的符号在link time不可用 修复:-Wl,--unresolved-symbols=ignore-in-shared-libs (和ix_unified_bridge.sh用的同一个方案) 运行时符号解析:ix_unified.py已有RTLD_GLOBAL preload逻辑 新增probe_all_so.py:在真机上探测12个.so的全部导出方法
This commit is contained in:
@@ -85,7 +85,7 @@ def main():
|
||||
logger.warning("This is expected if building outside the base image")
|
||||
|
||||
# Build flags
|
||||
extra_ldflags = []
|
||||
extra_ldflags = ["-Wl,--unresolved-symbols=ignore-in-shared-libs"]
|
||||
for d in lib_dirs:
|
||||
extra_ldflags.extend([f"-L{d}", "-Wl,-rpath," + d])
|
||||
extra_ldflags.append("-lixformer")
|
||||
|
||||
52
probe_all_so.py
Normal file
52
probe_all_so.py
Normal file
@@ -0,0 +1,52 @@
|
||||
"""在真机上运行:python3 probe_all_so.py
|
||||
输出每个.so的全部导出Python方法"""
|
||||
import importlib.util, os, sys
|
||||
|
||||
SO_DIR = None
|
||||
for d in [
|
||||
"/usr/local/corex/lib64/python3/dist-packages/vllm",
|
||||
"/usr/local/corex/lib/python3/dist-packages/vllm",
|
||||
]:
|
||||
if os.path.isfile(os.path.join(d, "corex_gdn_causal_conv.so")):
|
||||
SO_DIR = d
|
||||
break
|
||||
|
||||
if not SO_DIR:
|
||||
# try prebuilt
|
||||
SO_DIR = os.path.join(os.path.dirname(__file__),
|
||||
"qwen3_6_scripts/prebuilt/corex-3.2.3-ivcore10")
|
||||
|
||||
ALL = [
|
||||
"corex_gdn_causal_conv",
|
||||
"corex_gdn_packed_decode",
|
||||
"corex_gdn_beta_decay",
|
||||
"corex_gdn_qk_map",
|
||||
"corex_gdn_gated_norm",
|
||||
"corex_attn_head_rms_norm",
|
||||
"corex_paged_kv_gather",
|
||||
"corex_fused_paged_prefill",
|
||||
"corex_block_major_kv_transfer",
|
||||
"corex_moe_direct_routed",
|
||||
"corex_moe_exact_reduce",
|
||||
"corex_moe_weight_gather",
|
||||
]
|
||||
|
||||
for name in ALL:
|
||||
so = os.path.join(SO_DIR, f"{name}.so")
|
||||
if not os.path.isfile(so):
|
||||
print(f"✗ {name}: NOT FOUND at {so}")
|
||||
continue
|
||||
try:
|
||||
spec = importlib.util.spec_from_file_location(name, so)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mod)
|
||||
funcs = [x for x in dir(mod) if not x.startswith('_')]
|
||||
print(f"✓ {name}: {funcs}")
|
||||
# Try to get docstrings/signatures
|
||||
for f in funcs:
|
||||
obj = getattr(mod, f)
|
||||
doc = getattr(obj, '__doc__', '')
|
||||
if doc:
|
||||
print(f" {f}: {doc.strip()[:200]}")
|
||||
except Exception as e:
|
||||
print(f"✗ {name}: {e}")
|
||||
Reference in New Issue
Block a user