Skip to content

tester: follow parent and sibling testers, math and loops; drop stale values - #258

Merged
tarekziade merged 2 commits into
mainfrom
tmic-reader-followup
Nov 19, 2026
Merged

tarekziade merged 2 commits into
mainfrom
tmic-reader-followup

Conversation

@tarekziade

Copy link
Copy Markdown
Collaborator

Follow-up to #254/#255 for the older-style testers that huggingface/transformers#50972 and #50976 move onto ModelTesterConfigMixin. Their static values use forms the reader skipped:

  • Parent testers outside the shared bases, in the same file or imported from another test module (Cohere2ModelTester(CohereModelTester), pocket_tts.PocketTTSModelTester), with small_config_overrides / defaults inherited from the nearest declaring tester and the testers' own get_small_config_defaults() overrides chained the way super() runs them. X.defaults / X.small_config_overrides resolve for any such tester (defaults = {**Parent.defaults, **Parent.small_config_overrides}).
  • A sibling tester's values: BlipTextModelTester.get_small_config_defaults(**text_kwargs), evaluated with the caller's kwargs, and an override's own parameters (text_kwargs=None).
  • math.ceil/floor/…, +=, dict.pop, plain class attributes (cls.base), ** keyword arguments, and constant arithmetic in a dict (32 * 4).
  • Stale values: when a statement can't be followed, the values it would have assigned are dropped instead of keeping what was there before (NeoMME's layer_types read as the literal None instead of its computed list).

Nothing is imported or run; module-level helpers, staticmethods and get_config() stay unfollowed.

Results (static read vs Tester.get_small_config_defaults() at runtime)

  • On the transformers branch of #50976 (both batches), every ModelTesterConfigMixin class in tests/models: 500/510 exact with this PR vs 449/510 on main, no wrong values (1 on main), no regressions. The migrated testers alone: 330/338 vs 283/338.
  • On transformers main today: unchanged, 164/165 (hunyuan_vl's runtime device), so fixture builds only change as those PRs land.
  • The 8 still-missing values need code the reader doesn't run: make_divisible/_layer_types helpers, a staticmethod (cohere_asr), get_config().to_dict() on throwaway sub-testers (owlvit/owlv2), len() of a module constant (openai_privacy_filter).

test_model_tester_forms_from_transformers_50972 covers each form; it fails on main.

🤖 Generated with Claude Code

@tarekziade
tarekziade merged commit bef2743 into main Nov 19, 2026
3 checks passed
@tarekziade tarekziade mentioned this pull request Nov 20, 2026
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