Skip to content

Expose literal tester overrides and merged small-config defaults - #50462

Merged
tarekziade merged 9 commits into
mainfrom
tarek-mic-test
Nov 17, 2026
Merged

tarekziade merged 9 commits into
mainfrom
tarek-mic-test

Conversation

@tarekziade

@tarekziade tarekziade commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Model testers declare their small-model values in a literal small_config_overrides dict. Tester.get_small_config_defaults(**kwargs) returns the merged values, derived ones included, without building a tester. Precedence: caller kwargs > model overrides > base defaults > shared text defaults.

The tester bases (causal, multimodal, VLM, ALM) replace their kwargs.setdefault chains with defaults dicts in tests/model_tester_config.py. Mistral Large 4 is migrated as a first example. Testers that still use setdefault keep working.

Why static

tmic needs a model's small config before it builds anything. Getting it from a live tester means importing the test module and all its test dependencies, running tester code (some get_config() methods take arguments, multimodal testers build nested configs), and running against whatever Transformers version is installed. A dict literal can be read with ast, like ruff does: no imports, no code execution, no version coupling. Quantization and kernel constraints are a separate follow-up.

Proof

Gist: every tester built by setUp() on the merge-base and on this branch. 147 testers, 9,928 config fields: 0 differences. A deliberately injected change shows up as 131 differences. The gist lists what the check doesn't cover.

Coverage

get_small_config_defaults() only sees values declared in defaults / small_config_overrides. Values a tester still sets in its own __init__ don't show up. Comparing it against the tester each setUp() builds: 38 of the 148 testers on these bases match today (37 that set nothing in __init__, plus Mistral Large 4). The other 110 all have their own __init__ and need migrating before tmic can rely on them. StaticRuntimeParityTest enforces this: the 110 are listed in TESTERS_NOT_YET_STATIC, a new tester that diverges fails, and a listed tester that gets fixed must be removed from the list. Migrating them is a follow-up.

@tarekziade

Copy link
Copy Markdown
Collaborator Author

run-slow: mistral_large4

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@tarekziade tarekziade changed the title Add static tiny-config defaults to multimodal testers Add static tiny-config hook to multimodal and causal testers Nov 9, 2026
@ydshieh

ydshieh commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

I took a look at the PR, a few points:

  • It's unclear to me why tmic needs to be static. It creates tiny models and verifies the created contract and baseline, which already requires transformers (and torch) at runtime. Not a blocker for the PR, but I think it's important to expand on this part (in PR description), with a more concrete description of the issues tmic is trying to avoid, and how this makes it work better.
  • Regarding the new dict, I'm completely fine with it, especially since other team members like the new style. But without the point above addressed, to me it's mainly a format/style change.
  • Question: why is only _CAUSAL_LM_TESTER_DEFAULTS added, and not the same for the other generic testers (VLMModelTester / ALMModelTester / MultiModalModelTester)? VLMModelTester alone still has 22 inline kwargs.setdefault calls.
  • Question: why is test_small_config_save_load added to Mistral Large 4 in this PR?

@zucchini-nlp zucchini-nlp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing new, just want to make sure it's not lost in slack thread :)

Comment thread tests/causal_lm_tester.py Resolved
Comment thread tests/causal_lm_tester.py Resolved
@tarekziade tarekziade changed the title Add static tiny-config hook to multimodal and causal testers Expose literal tester overrides and merged small-config defaults Nov 10, 2026
@tarekziade

Copy link
Copy Markdown
Collaborator Author

run-slow: mistral_large4

@github-actions

Copy link
Copy Markdown
Contributor

CI (Nvidia + AMD)

Nvidia · ✅ No new failures 🎉👏 · ⚙️ Workflow · 📊 Dashboard

AMD · ✅ No new failures 🎉👏 · ⚙️ Workflow · 📊 Dashboard

@zucchini-nlp zucchini-nlp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few questions and i think good to get a core maintainer review as well

Comment thread tests/alm_tester.py
Comment on lines +50 to +54
"seq_length": 32,
"pad_token_id": 1,
"feat_seq_length": 128,
"num_mel_bins": 80,
"audio_token_id": 0,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird and just seeing it, bos token is also 1 and we cant have two special tokens map to one ID 🙃

maybe ping Eustasche so he can fix it later, not sure if changing it now will cause more issues

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-existing value, kept as is so this refactor stays behavior-neutral; worth a separate fix.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for sure, cc @eustlb for viz - > might hide real bugs in some models where BOS is used

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

best to ping on slack, this will get burried

Comment thread tests/model_tester_config.py Resolved
Comment on lines +33 to +37
# Shared text-model defaults for CausalLMModelTester and MultiModalModelTester.
_TEXT_MODEL_TESTER_DEFAULTS = {
"batch_size": 13,
"seq_length": 7,
"is_training": True,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think some time later we can have a single text defaults merged with CausalDefaults, since the text backbone is a universal thing so why not share

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, good follow-up.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh similar idea, let's make an issue or some tracker internally pls!

Comment thread tests/vlm_tester.py Resolved

@Cyrilvallez Cyrilvallez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments (notably about the whole mro check) but overall happy!

Comment thread tests/model_tester_config.py Resolved
Comment thread tests/model_tester_config.py Resolved

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just chiming in leaving some thoughts for follow ups, dont have anything to add on top to what the others said. Sorry for the delays

Comment thread tests/causal_lm_tester.py
"mamba_expand": 2,
"mamba_chunk_size": 16,
"tie_word_embeddings": False,
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not on you but I feel like this has been ignored for quite a while, this list could grow much more these days making things optional (like including moe directly within one list and then filter post hoc)

not for this pr just an idea

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep had the same thought several time as well, strongly agree with @vasqu here would be nice

Comment on lines +33 to +37
# Shared text-model defaults for CausalLMModelTester and MultiModalModelTester.
_TEXT_MODEL_TESTER_DEFAULTS = {
"batch_size": 13,
"seq_length": 7,
"is_training": True,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh similar idea, let's make an issue or some tracker internally pls!

@tarekziade

Copy link
Copy Markdown
Collaborator Author

@vasqu @zucchini-nlp I added #50807 as a follow-up

@Cyrilvallez Cyrilvallez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Let's wait for @vasqu to double check as well just in case, but happy!

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup just some thoughts but nothing blocking, thanks 🫡

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this only for mistral here or should we have a dedicated PR updating all model tests?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking pushing this PR with just Mistral and then do batches in follow-up PRs so we reduce risks

Comment thread tests/alm_tester.py
Comment on lines +50 to +54
"seq_length": 32,
"pad_token_id": 1,
"feat_seq_length": 128,
"num_mel_bins": 80,
"audio_token_id": 0,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

best to ping on slack, this will get burried

@tarekziade
tarekziade added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@vasqu
vasqu added this pull request to the merge queue Nov 17, 2026
@vasqu
vasqu removed this pull request from the merge queue due to a manual request Nov 17, 2026
@vasqu

vasqu commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

@tarekziade there seems to be some legit failure re main

@tarekziade
tarekziade enabled auto-merge November 17, 2026 16:22
@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: apertus1p5, hy_v4_vl, mistral_large4, omniasr

@tarekziade
tarekziade added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 056b25a Nov 17, 2026
123 of 124 checks passed
@tarekziade
tarekziade deleted the tarek-mic-test branch November 17, 2026 16:47
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.

6 participants