Surfaced while fixing #2374 (train-family), and confirmed by that agent to be a distinct pre-existing defect, not a regression from the fix.
apr finetune --task classify <model>.apr used to pass the model file's parent directory to from_pretrained, so it silently trained whatever sibling SafeTensors happened to sit next to the named .apr. That was finding 3 of #2374 and is fixed in #2436 — the named file is now actually loaded.
With the file genuinely loaded, the real load path fails:
$ apr finetune qwen2.5-coder-0.5b-instruct.apr --task classify
error: Shape mismatch for 'lm_head.weight': expected 136134656 elements, got 0
That is tied word embeddings: the .apr stores lm_head.weight as a 0-byte placeholder because it is tied to embed_tokens, and Transformer::from_apr does not untie it.
The sibling-directory load was masking this — the wrong model loaded successfully, so nobody saw the right one fail.
This is closely related to #2309 (apr run: inference fails on tied-embedding .apr models, lm_head 0-byte placeholder not tied to embed_tokens) — plausibly the same root cause in a second consumer. Worth checking whether one fix covers both.
Filed separately so #2374 can close on its own coverage.
Audit epic: #2373
Surfaced while fixing #2374 (train-family), and confirmed by that agent to be a distinct pre-existing defect, not a regression from the fix.
apr finetune --task classify <model>.aprused to pass the model file's parent directory tofrom_pretrained, so it silently trained whatever sibling SafeTensors happened to sit next to the named.apr. That was finding 3 of #2374 and is fixed in #2436 — the named file is now actually loaded.With the file genuinely loaded, the real load path fails:
That is tied word embeddings: the
.aprstoreslm_head.weightas a 0-byte placeholder because it is tied toembed_tokens, andTransformer::from_aprdoes not untie it.The sibling-directory load was masking this — the wrong model loaded successfully, so nobody saw the right one fail.
This is closely related to #2309 (
apr run: inference fails on tied-embedding .apr models, lm_head 0-byte placeholder not tied to embed_tokens) — plausibly the same root cause in a second consumer. Worth checking whether one fix covers both.Filed separately so #2374 can close on its own coverage.
Audit epic: #2373