Compare commits
2 Commits
617e11044f
...
9f2d6fd2d2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f2d6fd2d2 | ||
|
|
57635b4ea6 |
@@ -27,11 +27,9 @@ build_dir = "$BUILD_DIR"
|
|||||||
try:
|
try:
|
||||||
from torch.utils.cpp_extension import load
|
from torch.utils.cpp_extension import load
|
||||||
|
|
||||||
# Find ixformer include/lib dirs for linking
|
|
||||||
extra_include = ["$SCRIPT_DIR/csrc/ilu"]
|
extra_include = ["$SCRIPT_DIR/csrc/ilu"]
|
||||||
extra_ldflags = []
|
extra_ldflags = []
|
||||||
|
|
||||||
# ixformer lib dirs — bridge needs these at runtime, not compile time
|
|
||||||
for p in ["/usr/local/corex/lib64/python3/dist-packages/ixformer",
|
for p in ["/usr/local/corex/lib64/python3/dist-packages/ixformer",
|
||||||
"/usr/local/corex/lib64"]:
|
"/usr/local/corex/lib64"]:
|
||||||
if os.path.isdir(p):
|
if os.path.isdir(p):
|
||||||
@@ -40,19 +38,39 @@ try:
|
|||||||
extra_ldflags.append(f"-L{p}")
|
extra_ldflags.append(f"-L{p}")
|
||||||
extra_ldflags.append(f"-Wl,-rpath,{p}")
|
extra_ldflags.append(f"-Wl,-rpath,{p}")
|
||||||
|
|
||||||
ext = load(
|
# Use load() for compilation only. It may fail on import because
|
||||||
name="ix_unified_bridge",
|
# ixformer::infer symbols need RTLD_GLOBAL preload at runtime.
|
||||||
sources=[src],
|
# That's OK — we just need the .so file to exist.
|
||||||
extra_include_paths=extra_include,
|
try:
|
||||||
extra_ldflags=extra_ldflags,
|
ext = load(
|
||||||
verbose=True,
|
name="ix_unified_bridge",
|
||||||
build_directory=build_dir,
|
sources=[src],
|
||||||
)
|
extra_include_paths=extra_include,
|
||||||
funcs = [x for x in dir(ext) if not x.startswith('_')]
|
extra_ldflags=extra_ldflags,
|
||||||
print(f"[build_bridge] SUCCESS via cpp_extension: {len(funcs)} functions")
|
verbose=True,
|
||||||
print(f"[build_bridge] functions: {funcs}")
|
build_directory=build_dir,
|
||||||
sys.exit(0)
|
)
|
||||||
|
funcs = [x for x in dir(ext) if not x.startswith('_')]
|
||||||
|
print(f"[build_bridge] SUCCESS via cpp_extension: {len(funcs)} functions: {funcs}")
|
||||||
|
sys.exit(0)
|
||||||
|
except ImportError as ie:
|
||||||
|
# Compilation succeeded but import failed (expected: ixformer symbols unresolved)
|
||||||
|
# Check if .so was actually produced
|
||||||
|
built = glob.glob(os.path.join(build_dir, "ix_unified_bridge*.so"))
|
||||||
|
if built:
|
||||||
|
print(f"[build_bridge] COMPILED OK: {built[0]}")
|
||||||
|
print(f"[build_bridge] Import deferred to runtime (ixformer preload needed): {ie}")
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
|
print(f"[build_bridge] No .so produced: {ie}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
# Check if .so exists from compilation before the exception
|
||||||
|
built = glob.glob(os.path.join(build_dir, "ix_unified_bridge*.so"))
|
||||||
|
if built:
|
||||||
|
print(f"[build_bridge] COMPILED OK (exception during import): {built[0]}")
|
||||||
|
sys.exit(0)
|
||||||
print(f"[build_bridge] cpp_extension failed: {e}")
|
print(f"[build_bridge] cpp_extension failed: {e}")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
PYEOF
|
PYEOF
|
||||||
|
|||||||
@@ -28,10 +28,9 @@
|
|||||||
# --max-seq-len-to-capture 32768 --enable-auto-tool-choice \
|
# --max-seq-len-to-capture 32768 --enable-auto-tool-choice \
|
||||||
# --tool-call-parser qwen3_coder --reasoning-parser qwen3
|
# --tool-call-parser qwen3_coder --reasoning-parser qwen3
|
||||||
|
|
||||||
# NOTE: intentionally NO set -e — individual patch failures must NOT abort
|
# NOTE: intentionally NO set -e or set -o pipefail — individual patch failures must NOT abort
|
||||||
# the entire build. Each step logs its own errors, and non-critical patches
|
# the entire build. Each step logs its own errors, and non-critical patches
|
||||||
# (xformers, diagnostics) may legitimately fail if the base image differs.
|
# (xformers, diagnostics) may legitimately fail if the base image differs.
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
# Always cd to script directory so relative paths (./qwen3_5.py, ./vendor_overrides, etc) work
|
# Always cd to script directory so relative paths (./qwen3_5.py, ./vendor_overrides, etc) work
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|||||||
Reference in New Issue
Block a user