Repository navigation
1.2.0: harden the eval scenario, fix the fp32 dtype, publish both 60-case measurements - #2
Merged
Merged
Conversation
…ranularity guard Cases accept optional accept/category/difficulty; the built-in scorer honours accept aliases while custom scorers keep the (pred, expected) contract. ComparisonResult reports points_per_case, tolerance_reachable and a granularity_warning when --max-drop-points is smaller than one case, plus regressed/recovered case ids per precision. results/int8_collapse.json is regenerated for the new report schema.
20 easy / 20 medium / 20 hard across add, sub, mul, div (30 distinct expected values) so a drop tolerance in whole points is actually reachable.
30 positive / 30 negative, 46 rows carry accept aliases so an answer that is semantically right but worded differently is not scored as a regression.
…ment script The Action now passes --response-cache through to the CLI with a whitelisted flag, and scripts/regen_real_model.py takes --set/--precisions/--out/ --min-accuracy/--max-cases so any eval set can be measured and its JSON records eval + points_per_case for the claims test.
transformers 5.x loads a checkpoint in its config's dtype, so
Qwen2.5-0.5B-Instruct and SmolLM2-135M-Instruct arrive as bfloat16. The fp32
arm was a bare 'return model', which meant the baseline of every published
comparison was really bf16 while the report said fp32, and dynamic int8 died
with 'RuntimeError: expected scalar type Float but found BFloat16'.
fp32 now casts to float32, int8 widens before quantize_dynamic, and every
report records the measured weight dtype ('torch.qint8' for a quantized arm)
so the label is auditable instead of assumed.
The 'no committed result' branch sat inside 'if out_path.exists()', so it could never run and a typo'd --out path quietly started a ten-minute CPU run.
20 cases means one case is 5.00 points, so the default --max-drop-points 2.0 was unreachable and the real policy was 'zero new errors' while the flag claimed a 2-point budget. The CLI now warns on stderr before loading any model, --strict-granularity turns that into exit 2, the markdown report gains per-category tallies and the regressed case ids, and JUnit gains one testcase per flipped case so a regression points at what actually broke.
… arm The published table labelled a bf16 run 'fp32' because to_dict only carried 'dtype' on candidates. The baseline is an arm too; give it the same audit fields so a mislabelled precision cannot be committed again.
--scorer auto picks the numeral scorer only when every expected answer is a numeral, and the harness default (exact match + declared aliases) otherwise. Running the numeral scorer over the sentiment set scored 0/60 at every precision and the gate printed PASS: a false green produced by the measuring tool itself. --max-new-tokens defaults to 32 (was 8) because 8 truncated every word problem that reasons before answering.
The arithmetic table now states what the model can actually do (33.3% at fp32, per tier) instead of implying competence, the sentiment table carries the same collapse from a 98.3% baseline, and both carry the dtype that was measured. Drops the stale 20-case results/real_model.json: the set it was generated from no longer exists, and its baseline ran bf16 under an fp32 label.
results/* is ignored by default so a local run cannot be committed by accident; the artefacts behind a published claim have to be named explicitly, and those two names replaced the deleted 20-case one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The eval scenario is no longer a 20-case arithmetic stub. At 20 cases one case is worth 5.00 points, so the shipped
--max-drop-points 2.0was unreachable and the gate silently enforced zero-new-errors. Both sets are now 60 cases (1.67 points/case), the harness computes granularity, and the CLI warns — or exits 2 with--strict-granularity.evals/sets/arith-tiered.jsonl— 60 arithmetic word problems, 20 easy / 20 medium / 20 hard, across add/sub/mul/div.evals/sets/classify.jsonl— 60 balanced sentiment cases with declared answer aliases, so a closed-label task is scored exactly.Casegainedaccept,category,difficulty; reports gained per-category tallies, regressed/recovered case ids, and one JUnit<testcase>per case.fp32was not fp32.transformersloads a checkpoint in its config dtype (Qwen2.5-0.5Bdeclares bf16), so the fp32 arm ran bf16 weights andquantize_dynamicthen raisedexpected scalar type Float but found BFloat16.--precision fp32now casts, int8 casts before quantizing, and every arm records the dtype it actually measured — including the baseline, which is how the mislabel got published.The measuring tool could manufacture a false green.
regen_real_model.pyscored the sentiment set with the numeral scorer: 0/60 at both precisions, and the gate printed PASS.--scorer autonow picks numeral-only-when-numeric, and--max-new-tokensdefaults to 32 (8 truncated every word problem that reasons).Published measurement, regenerable in ~2 min of CPU:
arith-tieredclassifybf16 matches fp32 case for case; int8 destroys both capabilities. The README says plainly that the arithmetic baseline is weak (and shows the per-tier split) rather than implying competence.
Action surface:
response-cacheis now an input and passes the entrypoint whitelist — the CLI flag existed but was unreachable from the Action.Verification
tests/test_claims_are_reproducible.pypins every README figure to the committed artifact.