prefill_qwen36 fixtures: a SKIP marker instead of a failure when numpy or gguf-py is missing

The fixture script writes <out>/SKIP with the reason and exits 0 on the
ImportError (as the other fixture scripts do); prefill_qwen36_test exits 77 on
seeing it.  4090: the simulated missing numpy gives SKIP and 77; the real
fixtures still pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
This commit is contained in:
Robert KarlandClaude Fable 5.1 committed 2026-10-11 13:23:05 -07:00
1 parent 77983af4a4
commit c4f599f448
2 files changed
+19 -3

No files matched your search

+7 -1
View File
@@ -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 <fixture dir>/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");
+12 -2
View File
@@ -19,7 +19,8 @@ engine's arithmetic (FP16 activations, int8 MMQ), not the weights.
For each case: <out>/<case>.gguf, the oracle's dumps for 40 tokens in <out>/<case>/o (the faithful reading) and
<out>/<case>/o_q8 (--act-quant q8: the activations rounded as ggml does before a quantized matmul), and the negative
controls <out>/<case>/neg_<name>: 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
<out>/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 "