[PoC B] Input cases as variant-like runs (one run per case, every case for every variant)

#6
by hf-transformers-bot HF Staff - opened
Hugging Face MIC org

PoC for discussion, do not merge. This is an alternative to https://huggingface.co/huggingface-mic/gemma3-mic/discussions/5, to compare the two shapes.

The goal is the same: this contract used to feed text only, although the fixture ships the vision tower. Now it covers each input alone and both combined: text, image, text_image.

Shape B, this PR: input cases work like variants, but every case runs.

  • integration.json declares "cases": {"text": {}, "image": {}, "text_image": {}} next to variants.
  • The MIC runner would run every case for every variant (cases are independent of variants), one run each, passing the case to the same single usage.md block through an env var, as it passes the variant through MIC_MODEL_KWARGS:
    case = "text_image"  # the input case: "text", "image" or "text_image"
    case = os.environ.get("MIC_CASE", case)  # doc-builder: hide
    
    The docs show one natural usage (here text + image).
  • Outputs keep their current flat names (predicted_tokens, answer_logits, training.*), and each (variant, case) gets its own baseline file: gemma3-mic[.<variant>].<case>.json.
  • The training step uses the case's inputs, so the image cases also train through the vision tower.
  • A case known to be broken would be a known_failures entry scoped to cases ("cases": [...]), like the existing variants / platforms scoping: the case reports xfail and the others pass. No change to how recording works.

Shape A, discussions/5: all cases inside one run per variant, nested per-case outputs (cases.<case>.*), and broken cases skipped via skip_outputs (needs https://github.com/huggingface/transformers-mic/pull/264).

MIC does not know cases yet. Shape B needs, modelled on variants:

  • read cases (absent means one implicit case, so existing contracts are unchanged);
  • loop over the cases for each variant, setting MIC_CASE;
  • add the case to the baseline file name and the result record;
  • cases scoping in known_failures;
  • publish readiness per (variant, case).

For this PoC, each of the 9 baselines (3 variants x 3 cases, cuda, A10G) was recorded and then checked with MIC's own runner, setting MIC_CASE by hand. The text case reproduces the currently published cuda baselines exactly (tokens, text, logits, training loss).

Not included: cpu-arm64 / cpu-x86_64-bf16 baselines (old shape).

Hugging Face MIC org

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.

hf-transformers-bot changed pull request status to closed

Sign up or log in to comment