diff --git a/tests/cuda/prefill_qwen36_test.cpp b/tests/cuda/prefill_qwen36_test.cpp index 008322c..4ee0a34 100644 --- a/tests/cuda/prefill_qwen36_test.cpp +++ b/tests/cuda/prefill_qwen36_test.cpp @@ -15,7 +15,7 @@ // harness could not tell the readings apart. Geometry refusals: Prefill::init with top-10 on this 16-expert file, // and with a GDN geometry the kernels are not built for. // -// Exit 0 pass, 1 fail, 77 skip (no CUDA device). +// Exit 0 pass, 1 fail, 77 skip (no CUDA device, or /SKIP: the fixture script found no numpy / gguf-py). #include "strata/artifact/gguf_reader.hpp" #include "strata/core/expert_source.hpp" #include "strata/core/layout.hpp" @@ -335,6 +335,12 @@ int main(int argc, char** argv) { if (std::strcmp(argv[i], "--chunk") == 0 && i + 1 < argc) chunk_override = std::atoll(argv[++i]); else if (std::strcmp(argv[i], "--no-force") == 0) force = false; } + if (std::ifstream skip(dir + "/SKIP"); skip) { + std::string why; + std::getline(skip, why); + std::printf("prefill_qwen36_test: the fixtures were not generated (%s/SKIP: %s): skip\n", dir.c_str(), why.c_str()); + return 77; + } int ndev = 0; if (cudaGetDeviceCount(&ndev) != cudaSuccess || ndev < 1) { std::printf("prefill_qwen36_test: no CUDA device (skip)\n"); diff --git a/tests/python/qwen36_prefill_fixture.py b/tests/python/qwen36_prefill_fixture.py index 50af20b..2dacb4a 100644 --- a/tests/python/qwen36_prefill_fixture.py +++ b/tests/python/qwen36_prefill_fixture.py @@ -19,7 +19,8 @@ engine's arithmetic (FP16 activations, int8 MMQ), not the weights. For each case: /.gguf, the oracle's dumps for 40 tokens in //o (the faithful reading) and //o_q8 (--act-quant q8: the activations rounded as ggml does before a quantized matmul), and the negative controls //neg_: the oracle with one reading flipped to its rival (gdn_gate=sigmoid, -head_pairing=interleaved, router_norm=False; attn_gate=False on full4). Exit 3 when numpy or gguf-py is missing. +head_pairing=interleaved, router_norm=False; attn_gate=False on full4). Without numpy or gguf-py it writes +/SKIP with the reason and exits 0, and the test exits 77 on seeing it (a skip, not a failure). """ from __future__ import annotations @@ -40,7 +41,16 @@ try: from gguf import GGUFWriter, GGMLQuantizationType as Q, quants except ImportError as e: # a trimmed third_party or no numpy: a skip, not a failure print(f"qwen36_prefill_fixture: {e}", file=sys.stderr) - sys.exit(3) + out = None + for i, a in enumerate(sys.argv[1:], 1): + if a == "--out" and i < len(sys.argv) - 1: + out = sys.argv[i + 1] + elif a.startswith("--out="): + out = a[len("--out="):] + if out: + pathlib.Path(out).mkdir(parents=True, exist_ok=True) + (pathlib.Path(out) / "SKIP").write_text(f"{e}\n") + sys.exit(0) # 40 tokens: the ASCII codes of this text (the fixture's vocabulary is the 128 byte tokens) TEXT = "the quick brown fox jumps over the lazy "