diff --git a/README.md b/README.md index 86ff2d7..6f70d20 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,13 @@ benchmark 目录,注册 `--level`/`--mode` 的 `conftest.py` 就没被加载 只校验节点的文件那一半;`::test_` 交给 pytest,函数不存在时它自己会清楚地报 `not found: ...`。 +还校验**解释器**——`python -c "import triton, flag_gems"`。triton 通常来自 PYTHONPATH +指向的编译器构建产物、flag_gems 来自源码检出,所以一个能摸到全部正确路径的 shell +仍然可能是错的那个 Python。不查的话,失败以每格一次 `pytest exit 4`(conftest 的 +ImportError)出现,多轮 campaign 会在有人读日志之前把每一格都烧掉——这不是假想, +2026-09-10 的噪声标定实验就这么废了 12 格加 160 次负载 run。报错里带上 +`$(command -v python)`,因为要看的就是"用的到底是哪个解释器"。 + ### 口径核对:出报告前的拒绝 `batch_summary.py --ab` / `--ab-rounds` 在解析任何 latency 之前,先读参与对比的每个 diff --git a/run_pytest.sh b/run_pytest.sh index 43d7c02..dc74f51 100644 --- a/run_pytest.sh +++ b/run_pytest.sh @@ -114,6 +114,12 @@ preflight "FlagGems directory exists: $FLAGGEMS_DIR" test -d "$FLAGGEMS_DIR" # The node's file half; the ::test_ half is left to pytest, which reports a # missing function clearly ("not found: ...") while a missing FILE does not. preflight "benchmark file exists: ${TEST_FILE%%::*}" test -f "${TEST_FILE%%::*}" +# The interpreter, not just the paths. triton and flag_gems normally come from a +# PYTHONPATH pointing at a compiler build and a source checkout, so a shell that +# merely reaches the right files can still be the wrong Python. Without this the +# failure surfaces per cell as `pytest exit 4` from a conftest ImportError, and a +# multi-round campaign burns every cell before anyone reads a log. +preflight "interpreter imports triton + flag_gems ($(command -v python))" sh -c 'python -c "import triton, flag_gems" 2>/dev/null' if [[ -n "$SHAPE_FILE" ]]; then preflight "shape file exists: $SHAPE_FILE" test -f "$SHAPE_FILE" fi