diff --git a/CMakeLists.txt b/CMakeLists.txt index 52f9e81bb..6a4d92252 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,6 +322,11 @@ add_python_test(logits_kld_self ${CMAKE_SOURCE_DIR}/tools/logits_kld.py --self-t # baseline records a test as never-run, which for a passing test is the wrong outcome -- so it is registered and the line # is removed, which is the shrink the baseline's own comment asks for. add_python_test(moe_expert_chunks_accum_test ${CMAKE_SOURCE_DIR}/tests/moe_expert_chunks_accum_test.py) +# engine#2018: the last baseline entry. The file recorded it as "needs the benchmark harness", but the test stubs +# llama-bench (stdlib only: hashlib/importlib.util/json/pathlib/platform/sys) and passes on a plain interpreter, so it is a +# test with no runner rather than a test that cannot run here. Registered, and the baseline is now empty: from here the +# sweep is zero-tolerance instead of a record of known gaps. +add_python_test(hyperloom_benchmark_test ${CMAKE_SOURCE_DIR}/tests/hyperloom_benchmark_test.py) # engine#1820: the other half of ci_targets_check -- a standalone shell test that nothing references cannot fail. # `need` is every tests/*.sh, `have` is every file that mentions its basename somewhere that can run it, and # tools/ci/unreferenced_tests.txt carries the deliberate exclusions WITH their reasons, so the list can shrink. diff --git a/tests/hyperloom_benchmark_test.py b/tests/hyperloom_benchmark_test.py index d477ab535..d1dca7482 100644 --- a/tests/hyperloom_benchmark_test.py +++ b/tests/hyperloom_benchmark_test.py @@ -202,8 +202,22 @@ def main(): # below stands in for a box that exposes nothing. box = bench.box_conditions() assert box["tctl_c"] is None or 20.0 < box["tctl_c"] < 120.0, box - assert box["gtt_used_gib"] is not None and box["gtt_total_gib"] is not None, box - assert 0.0 <= box["gtt_used_gib"] <= box["gtt_total_gib"], box + # The GTT counters exist only where amdgpu does. On such a box every one must come back a number; CI's build job + # runs in a GPU-less container (engine#2018: this is why the test had no ctest row), where they must be null. + if (bench.GPU_SYSFS / "mem_info_gtt_used").exists(): + assert box["gtt_used_gib"] is not None and box["gtt_total_gib"] is not None, box + assert 0.0 <= box["gtt_used_gib"] <= box["gtt_total_gib"], box + else: + assert box["gtt_used_gib"] is None and box["gtt_total_gib"] is None, box + # ...and the GPU-less branch runs everywhere, not only in CI: a root with no counters is a null, never a zero. + real_sysfs = bench.GPU_SYSFS + try: + with tempfile.TemporaryDirectory() as tmp: + bench.GPU_SYSFS = pathlib.Path(tmp) + nogpu = bench.box_conditions() + assert nogpu["gtt_used_gib"] is None and nogpu["gtt_total_gib"] is None, nogpu + finally: + bench.GPU_SYSFS = real_sysfs assert box["mem_available_gib"] is not None and box["mem_available_gib"] > 0, box # The hwmon channel is found by label, not by a hardcoded index: the k10temp Tctl has come back as # hwmon2 and as hwmon4 across six reboots in three days. A root with no Tctl label yields null. diff --git a/tools/ci/unreferenced_py_tests.txt b/tools/ci/unreferenced_py_tests.txt index e27a98d88..742700096 100644 --- a/tools/ci/unreferenced_py_tests.txt +++ b/tools/ci/unreferenced_py_tests.txt @@ -24,8 +24,8 @@ # A SET baseline, not an allow-list: `tools/ci/tests_referenced_check.py` FAILS when a name appears here that is not in # the tree's current set, and REPORTS a line whose file is registered now, so this can only shrink. # -# The number is 1 (was 2: moe_expert_chunks_accum_test.py is portable and passing, so it is registered rather than -# baselined -- engine#2018), and getting it right took a correction worth recording: the first version of the rule scanned +# The number is 0. Both original entries were portable tests with no runner, not tests that cannot run here, so both are +# registered (moe_expert_chunks_accum_test.py, then hyperloom_benchmark_test.py -- engine#2018), and getting it right took a correction worth recording: the first version of the rule scanned # `RUNNERS`, which contains one FILE (CMakeLists.txt) and two directories, and tested `is_dir()` on all three -- so every # `add_python_test(...)` registration in CMakeLists.txt was invisible and 35 of 42 tests looked unregistered. The arm # "a cleared baseline entry is reported" caught it: registering a test in CMakeLists.txt did not clear its line. The true @@ -33,4 +33,3 @@ # # Each line is a real test whose runner was never added; the fix per file is one `add_python_test(...)`. # -tests/hyperloom_benchmark_test.py