Repository navigation
Expose literal tester overrides and merged small-config defaults - #50462
Conversation
|
run-slow: mistral_large4 |
|
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. |
|
I took a look at the PR, a few points:
|
zucchini-nlp
left a comment
There was a problem hiding this comment.
nothing new, just want to make sure it's not lost in slack thread :)
|
run-slow: mistral_large4 |
zucchini-nlp
left a comment
There was a problem hiding this comment.
left a few questions and i think good to get a core maintainer review as well
| "seq_length": 32, | ||
| "pad_token_id": 1, | ||
| "feat_seq_length": 128, | ||
| "num_mel_bins": 80, | ||
| "audio_token_id": 0, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Pre-existing value, kept as is so this refactor stays behavior-neutral; worth a separate fix.
There was a problem hiding this comment.
yeah for sure, cc @eustlb for viz - > might hide real bugs in some models where BOS is used
There was a problem hiding this comment.
best to ping on slack, this will get burried
| # Shared text-model defaults for CausalLMModelTester and MultiModalModelTester. | ||
| _TEXT_MODEL_TESTER_DEFAULTS = { | ||
| "batch_size": 13, | ||
| "seq_length": 7, | ||
| "is_training": True, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Agreed, good follow-up.
There was a problem hiding this comment.
Oh similar idea, let's make an issue or some tracker internally pls!
Cyrilvallez
left a comment
There was a problem hiding this comment.
Just a few comments (notably about the whole mro check) but overall happy!
vasqu
left a comment
There was a problem hiding this comment.
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
| "mamba_expand": 2, | ||
| "mamba_chunk_size": 16, | ||
| "tie_word_embeddings": False, | ||
| } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Yep had the same thought several time as well, strongly agree with @vasqu here would be nice
| # Shared text-model defaults for CausalLMModelTester and MultiModalModelTester. | ||
| _TEXT_MODEL_TESTER_DEFAULTS = { | ||
| "batch_size": 13, | ||
| "seq_length": 7, | ||
| "is_training": True, |
There was a problem hiding this comment.
Oh similar idea, let's make an issue or some tracker internally pls!
|
@vasqu @zucchini-nlp I added #50807 as a follow-up |
Cyrilvallez
left a comment
There was a problem hiding this comment.
Looks good to me! Let's wait for @vasqu to double check as well just in case, but happy!
vasqu
left a comment
There was a problem hiding this comment.
Yup just some thoughts but nothing blocking, thanks 🫡
There was a problem hiding this comment.
Do we want this only for mistral here or should we have a dedicated PR updating all model tests?
There was a problem hiding this comment.
I was thinking pushing this PR with just Mistral and then do batches in follow-up PRs so we reduce risks
| "seq_length": 32, | ||
| "pad_token_id": 1, | ||
| "feat_seq_length": 128, | ||
| "num_mel_bins": 80, | ||
| "audio_token_id": 0, |
There was a problem hiding this comment.
best to ping on slack, this will get burried
|
@tarekziade there seems to be some legit failure re main |
… docstring example
Testers that still set values in __init__ are listed in TESTERS_NOT_YET_STATIC (110 today); the test fails if a new tester diverges or a listed one is fixed but not removed.
eb6a7c9 to
dd08f01
Compare
|
[For maintainers] Suggested jobs to run (before merge) run-slow: apertus1p5, hy_v4_vl, mistral_large4, omniasr |
Model testers declare their small-model values in a literal
small_config_overridesdict.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.setdefaultchains withdefaultsdicts intests/model_tester_config.py. Mistral Large 4 is migrated as a first example. Testers that still usesetdefaultkeep 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 withast, 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 indefaults/small_config_overrides. Values a tester still sets in its own__init__don't show up. Comparing it against the tester eachsetUp()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.StaticRuntimeParityTestenforces this: the 110 are listed inTESTERS_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.