arch(probe): add build-time CoreX API discovery — stop guessing interfaces

probe_corex_api.py runs during docker build BEFORE qwen3_5.py deployment:
1. Lists ALL .py files in base image's vllm/model_executor/models/
2. For each corex_gdn/corex_moe/corex_fa2: import → inspect signatures
3. If import fails: AST parse the .py file directly for class/method defs
4. Checks native qwen3_5.py for corex references before we overwrite it
5. Checks .so files exist (libcorex_gdn.so etc)
6. Dumps everything to /workspace/corex_probe_result.json

Next deploy's build log will show EXACTLY what the corex API looks like.
Then we write real dispatch code against real signatures, not guesses.
This commit is contained in:
Claude
2026-08-08 11:16:58 +00:00
parent ee09550263
commit dbfe20fd1c
2 changed files with 214 additions and 0 deletions

View File

@@ -66,6 +66,14 @@ else
echo "[patch_ops] WARNING: transformers/models not found"
fi
# 1b. CoreX API probe — MUST run BEFORE deploying our qwen3_5.py
# Discovers corex_gdn.py, corex_moe.py, corex_fa2.py interfaces from base image.
# Also inspects native qwen3_5.py before we overwrite it.
# Results go to /workspace/corex_probe_result.json + build log.
echo "[patch_ops] Running CoreX API probe..."
python3 ./probe_corex_api.py 2>&1
echo "[patch_ops] CoreX probe done (see above for results)"
# 2. Model module — qwen3_5.py with CoreX dispatch (CCCL env_dispatch pattern).
# Our version tries to import corex_gdn/corex_moe from the base image.
# If they exist → uses fused CUDA kernels (10x faster).