[PoC] Transformers contract: run every input case (text, image, text + image)
PoC for discussion, do not merge yet. Input modalities are cases of the contract, not variants: every case runs by default, in one run (each input alone and all combined: text, image, text_image), with one output per case; variants stay run settings (dtype, attn_implementation). A case known to be broken in the framework under test is a fleet known_failures entry with skip_outputs (needs https://github.com/huggingface/transformers-mic/pull/264 to be recordable).
This contract used to feed text only, although the fixture ships the vision tower. Now default (and every variant) runs three cases, with predicted_tokens / predicted_text / answer_logits per case (cases.<case>.*). The model loading is unchanged (AutoModelForCausalLM loads Gemma3ForConditionalGeneration), and the training step still uses the text case.
Verified with MIC's runner on CUDA (A10G) for default / eager / bfloat16: recorded, then checked, all pass. The text case reproduces the currently published cuda baselines exactly (same tokens, logit diff 0.0, same training loss): the change only adds the image cases.
Not included: the cpu-arm64 and cpu-x86_64-bf16 baselines (old shape) need re-recording on those platforms; the fleet pin would be bumped after merging.
Related PoC pieces:
- MIC change (record with
skip_outputs): https://github.com/huggingface/transformers-mic/pull/264 - Transformers contract: https://huggingface.co/huggingface-mic/gemma3-mic/discussions/5
- vLLM contract: https://huggingface.co/huggingface-mic/gemma3-vllm-mic/discussions/1
- Fleet entry: https://huggingface.co/datasets/huggingface-mic/vllm-fleet/discussions/1
Alternative shape for comparison (input cases as variant-like runs, one run per case, every case for every variant): https://huggingface.co/huggingface-mic/gemma3-mic/discussions/6
Closing this PoC: input cases are implemented in transformers-mic (https://github.com/huggingface/transformers-mic/pull/277); a new PR will follow once that lands.