Skip to content

fix(validate): detect per-query .pt scores via the run config - #407

Merged
luciaquirke merged 1 commit into
mainfrom
fix-pt-per-query-scores
Aug 6, 2026
Merged

fix(validate): detect per-query .pt scores via the run config#407
luciaquirke merged 1 commit into
mainfrom
fix-pt-per-query-scores

Conversation

@luciaquirke

Copy link
Copy Markdown
Collaborator

Standalone validate with retrained_dir fails on per-query MAGIC scores: load_attribution_scores returns multi_query=False for every .pt file, so a [docs, queries] matrix from query_method: none hits the evaluate_retrained expects per-doc (1D) scores assertion.

Shape alone can't distinguish per-query [docs, queries] from per-token [docs, seq_len], so this reads the config.yaml that run_magic writes next to scores.pt: the tensor is per-query iff the run used query_method: none (and not per_token). Falls back to the per-token interpretation when no config is present.

Longer-term the cleaner path is routing per-query MAGIC scores through the unified score-directory writer, but this unblocks validating existing runs' scores.pt artifacts.

A 2-D scores.pt is [docs, seq_len] for per-token runs but [docs, queries]
for query_method: none, and load_attribution_scores always chose the
per-token reading, so evaluate_retrained rejected per-query MAGIC scores
with 'expects per-doc (1D) scores'. Disambiguate with the config.yaml
written next to scores.pt.
@luciaquirke
luciaquirke force-pushed the fix-pt-per-query-scores branch from 3949f63 to a36d3b8 Compare August 6, 2026 04:52
@luciaquirke
luciaquirke merged commit 94a1b8a into main Aug 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant