conformance: use real DistilBERT-QA checkpoint for batched_run test - #33
Merged
Conversation
The old test paired distilbert-base-uncased's 30522-token tokenizer with a tiny-random model whose 1124-row embedding can't accommodate the ids the tokenizer produces — Emily.Backend silently returned uninitialised rows (occasionally NaN) because MLX's gather does not bounds-check, producing the intermittent `:nan` score seen once on M4. Nx.BinaryBackend would have raised. Swap to distilbert-base-uncased-distilled-squad for both model and tokenizer (matching vocab, ~250 MB); tag `:distilbert_full` and exclude from the default `--only conformance` run. Assertions tightened to check the returned span text against the expected entity. Underlying backend behaviour (silent OOB gather vs. opt-in compile- time bounds-check debug flag) tracked in #32.
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.
Summary
Nx.Serving.batched_runconformance test paireddistilbert-base-uncased's 30522-token tokenizer with the tiny-randomDistilBertForQuestionAnsweringmodel (1124-row embedding), so the tokenizer emitted token ids past the embedding bound.Emily.Backend.gathersilently returned uninitialised memory (occasionally NaN) because MLX's gather does not bounds-check — the intermittent:nanscore seen once on M4.Nx.BinaryBackendwould have raised immediately.distilbert-base-uncased-distilled-squadfor both model and tokenizer (matching vocab, ~250 MB checkpoint). Tag the test:distilbert_fulland exclude it from the default--only conformancerun, mirroring:qwen3_full/:vit_full/:whisper_full.Test plan
mix precommitclean on the branch (364 tests, 0 failures;:distilbert_fullcorrectly excluded from the default run)mix test --only distilbert_full test/emily/conformance/distilbert_test.exspasses locally on M4 (250 MB checkpoint downloaded on first run):distilbert_fullstays opt-in, no CI regression expected