Repository navigation
Move older-style testers of 123 popular models onto static small-config defaults - #50972
Conversation
|
run-slow: albert, bart, beit, big_bird, bigbird_pegasus, blenderbot, blip, canary, canine, chinese_clip, clap, clip, clipseg, codegen, cohere, cohere2 |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: albert, bart, beit, big_bird, bigbird_pegasus, blenderbot, blip, canary, canine, chinese_clip, clap, clip, clipseg, codegen, cohere, cohere2 |
CI (Nvidia + AMD)Nvidia · ✅ No new failures 🎉👏 · ⚙️ Workflow · 📊 Dashboard Failures (3 pre-existing)Pre-existing failures (still failing) — 3 total: Same error (3): - big_bird: - codegen: - cohere2: AMD · ✅ No new failures 🎉👏 · ⚙️ Workflow · 📊 Dashboard Failures (5 pre-existing)Pre-existing failures (still failing) — 5 total: Same error (5): - big_bird: - codegen: - cohere2: |
Follow-up to #50916 and #50944. Those made every tester on the shared bases static; this moves 177 older-style testers (plain classes whose sizes are
__init__keyword defaults) ontoModelTesterConfigMixin, for 123 widely used models (t5, bart, clip, vit, whisper, wav2vec2, siglip, llava, qwen2_vl, qwen2_5_vl, deepseek_v3, modernbert, …). The parity test intests/utils/test_model_tester_defaults.pynow covers them.The pattern (as bert/gpt_neox/opt in #50916)
small_config_overrides, withdefaults = {};__init__(self, parent, **kwargs)sets the merged values. Explanatory comments stay next to their key.__init__computed (seq_lengthfrom patches, token ids fromvocab_size, sizes read from a sub-tester's ortext_config's defaults) move toget_small_config_defaults(), assigned orsetdefaultto keep the old precedence. Sub-testers and other objects stay in__init__; composites keep explicittext_kwargs/vision_kwargsparameters.setUpbuilds the tester setsmodel_tester_class.Wav2Vec2RobustModelTester,GPTBigCodeMHAModelTester,LongT5TGlobalModelTester, …), so the parity check holds without arguments. Three that only vary one-off arguments (HubertRobust, BeitBackbone, SeamlessM4Tv2 text input) keep building it with those arguments and don't setmodel_tester_class.is_training=Falsenow default to it. Parameters that were accepted but never stored (is_decoder) are dropped.text_kwargs/vision_kwargsits only caller passed.Copied fromsources (check_copies --fix_and_overwrite).Left unchanged:
GraniteMoeHybridModelTester(inherits Bamba's tester, which isn't migrated yet) andPerceiverModelTester(itssubsamplingattribute holds tensors, which the parity check can't compare).Proof
prepare_config_and_inputs_for_common()/prepare_config_and_inputs()) was snapshotted on96227f0fd5and on this branch: 177/179 identical and on the mixin with no static/runtime mismatch; the 2 others are the unchanged testers above.tests/utils/test_model_tester_defaults.py: 12 passed. Its parity check now builds 355 TestCases' testers, with no mismatch.-k "config or common_attributes or test_model"excluding tensor/expert-parallel tests: all pass, except failures that are identical on main (test_backbone_selectionImportError for detr, dpt, rt_detr, rt_detr_v2) and padding-free flakes that also fail on main (ernie, electra).utils/check_copies.py,ruff checkandruff format --checkpass;git diff --checkis clean.🤖 Generated with Claude Code