[PoC B] Input cases as variant-like runs (one run per case, every case for every variant)
Browse files**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`:
```python
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).
- integration.json +6 -1
- integrations/transformers/expectations/cuda/gemma3-mic.bfloat16.image.json +76 -0
- integrations/transformers/expectations/cuda/gemma3-mic.bfloat16.text.json +82 -0
- integrations/transformers/expectations/cuda/gemma3-mic.bfloat16.text_image.json +76 -0
- integrations/transformers/expectations/cuda/gemma3-mic.eager.image.json +76 -0
- integrations/transformers/expectations/cuda/gemma3-mic.eager.text.json +82 -0
- integrations/transformers/expectations/cuda/gemma3-mic.eager.text_image.json +76 -0
- integrations/transformers/expectations/cuda/gemma3-mic.image.json +76 -0
- integrations/transformers/expectations/cuda/gemma3-mic.text.json +82 -0
- integrations/transformers/expectations/cuda/gemma3-mic.text_image.json +76 -0
- integrations/transformers/usage.md +16 -2
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"mic": "0.3",
|
| 3 |
"name": "Gemma3 causal LM",
|
| 4 |
-
"usage": "AutoProcessor + AutoModelForCausalLM, text
|
| 5 |
"architecture": "Gemma3ForConditionalGeneration",
|
| 6 |
"checkpoints": {
|
| 7 |
"google/gemma-3-4b-it": {
|
|
@@ -39,6 +39,11 @@
|
|
| 39 |
"dtype": "bfloat16"
|
| 40 |
}
|
| 41 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
"training": true,
|
| 43 |
"resources": {
|
| 44 |
"fixture": {
|
|
|
|
| 1 |
{
|
| 2 |
"mic": "0.3",
|
| 3 |
"name": "Gemma3 causal LM",
|
| 4 |
+
"usage": "AutoProcessor + AutoModelForCausalLM, one run per input case (text batched with padding, image, text + image), one training step",
|
| 5 |
"architecture": "Gemma3ForConditionalGeneration",
|
| 6 |
"checkpoints": {
|
| 7 |
"google/gemma-3-4b-it": {
|
|
|
|
| 39 |
"dtype": "bfloat16"
|
| 40 |
}
|
| 41 |
},
|
| 42 |
+
"cases": {
|
| 43 |
+
"text": {},
|
| 44 |
+
"image": {},
|
| 45 |
+
"text_image": {}
|
| 46 |
+
},
|
| 47 |
"training": true,
|
| 48 |
"resources": {
|
| 49 |
"fixture": {
|
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "bfloat16",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.43,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.bfloat16.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "sdpa",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "sdpa",
|
| 53 |
+
"vision_config": "sdpa"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u10d4\u10d1\u10e3\u10da\u10d8\u10d0"
|
| 58 |
+
],
|
| 59 |
+
"predicted_text": "\u10d4\u10d1\u10e3\u10da\u10d8\u10d0",
|
| 60 |
+
"answer_logits": [
|
| 61 |
+
[
|
| 62 |
+
0.70703125,
|
| 63 |
+
0.703125,
|
| 64 |
+
0.69921875
|
| 65 |
+
]
|
| 66 |
+
],
|
| 67 |
+
"training": {
|
| 68 |
+
"loss": 12.493996620178223,
|
| 69 |
+
"gradients": {
|
| 70 |
+
"model.multi_modal_projector.mm_input_projection_weight": true,
|
| 71 |
+
"model.language_model.embed_tokens.weight": true
|
| 72 |
+
},
|
| 73 |
+
"updated": true
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "bfloat16",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.12,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.bfloat16.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "sdpa",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "sdpa",
|
| 53 |
+
"vision_config": "sdpa"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u2581\u0987\u09a8\u09cd\u09a6\u09c1",
|
| 58 |
+
"\u0648\u0627\u062c"
|
| 59 |
+
],
|
| 60 |
+
"predicted_text": " \u0987\u09a8\u09cd\u09a6\u09c1\u0648\u0627\u062c",
|
| 61 |
+
"answer_logits": [
|
| 62 |
+
[
|
| 63 |
+
0.6796875,
|
| 64 |
+
0.66796875,
|
| 65 |
+
0.6640625
|
| 66 |
+
],
|
| 67 |
+
[
|
| 68 |
+
0.71875,
|
| 69 |
+
0.66015625,
|
| 70 |
+
0.65625
|
| 71 |
+
]
|
| 72 |
+
],
|
| 73 |
+
"training": {
|
| 74 |
+
"loss": 12.520472526550293,
|
| 75 |
+
"gradients": {
|
| 76 |
+
"model.language_model.embed_tokens.weight": true,
|
| 77 |
+
"model.language_model.layers.0.self_attn.q_proj.weight": true
|
| 78 |
+
},
|
| 79 |
+
"updated": true
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "bfloat16",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.71,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.bfloat16.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "sdpa",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "sdpa",
|
| 53 |
+
"vision_config": "sdpa"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u10d4\u10d1\u10e3\u10da\u10d8\u10d0"
|
| 58 |
+
],
|
| 59 |
+
"predicted_text": "\u10d4\u10d1\u10e3\u10da\u10d8\u10d0",
|
| 60 |
+
"answer_logits": [
|
| 61 |
+
[
|
| 62 |
+
0.84765625,
|
| 63 |
+
0.765625,
|
| 64 |
+
0.66796875
|
| 65 |
+
]
|
| 66 |
+
],
|
| 67 |
+
"training": {
|
| 68 |
+
"loss": 12.493707656860352,
|
| 69 |
+
"gradients": {
|
| 70 |
+
"model.multi_modal_projector.mm_input_projection_weight": true,
|
| 71 |
+
"model.language_model.embed_tokens.weight": true
|
| 72 |
+
},
|
| 73 |
+
"updated": true
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "eager",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.68,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.eager.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "eager",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "eager",
|
| 53 |
+
"vision_config": "eager"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u10d4\u10d1\u10e3\u10da\u10d8\u10d0"
|
| 58 |
+
],
|
| 59 |
+
"predicted_text": "\u10d4\u10d1\u10e3\u10da\u10d8\u10d0",
|
| 60 |
+
"answer_logits": [
|
| 61 |
+
[
|
| 62 |
+
0.70703125,
|
| 63 |
+
0.703125,
|
| 64 |
+
0.69921875
|
| 65 |
+
]
|
| 66 |
+
],
|
| 67 |
+
"training": {
|
| 68 |
+
"loss": 12.494494438171387,
|
| 69 |
+
"gradients": {
|
| 70 |
+
"model.multi_modal_projector.mm_input_projection_weight": true,
|
| 71 |
+
"model.language_model.embed_tokens.weight": true
|
| 72 |
+
},
|
| 73 |
+
"updated": true
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "eager",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.72,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.eager.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "eager",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "eager",
|
| 53 |
+
"vision_config": "eager"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u2581\u0987\u09a8\u09cd\u09a6\u09c1",
|
| 58 |
+
"\u0648\u0627\u062c"
|
| 59 |
+
],
|
| 60 |
+
"predicted_text": " \u0987\u09a8\u09cd\u09a6\u09c1\u0648\u0627\u062c",
|
| 61 |
+
"answer_logits": [
|
| 62 |
+
[
|
| 63 |
+
0.67578125,
|
| 64 |
+
0.66796875,
|
| 65 |
+
0.66796875
|
| 66 |
+
],
|
| 67 |
+
[
|
| 68 |
+
0.71875,
|
| 69 |
+
0.66015625,
|
| 70 |
+
0.66015625
|
| 71 |
+
]
|
| 72 |
+
],
|
| 73 |
+
"training": {
|
| 74 |
+
"loss": 12.525347709655762,
|
| 75 |
+
"gradients": {
|
| 76 |
+
"model.language_model.embed_tokens.weight": true,
|
| 77 |
+
"model.language_model.layers.0.self_attn.q_proj.weight": true
|
| 78 |
+
},
|
| 79 |
+
"updated": true
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "eager",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.91,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.eager.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "eager",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "eager",
|
| 53 |
+
"vision_config": "eager"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u10d4\u10d1\u10e3\u10da\u10d8\u10d0"
|
| 58 |
+
],
|
| 59 |
+
"predicted_text": "\u10d4\u10d1\u10e3\u10da\u10d8\u10d0",
|
| 60 |
+
"answer_logits": [
|
| 61 |
+
[
|
| 62 |
+
0.84375,
|
| 63 |
+
0.76171875,
|
| 64 |
+
0.671875
|
| 65 |
+
]
|
| 66 |
+
],
|
| 67 |
+
"training": {
|
| 68 |
+
"loss": 12.494178771972656,
|
| 69 |
+
"gradients": {
|
| 70 |
+
"model.multi_modal_projector.mm_input_projection_weight": true,
|
| 71 |
+
"model.language_model.embed_tokens.weight": true
|
| 72 |
+
},
|
| 73 |
+
"updated": true
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "default",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.57,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "sdpa",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "sdpa",
|
| 53 |
+
"vision_config": "sdpa"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u10d4\u10d1\u10e3\u10da\u10d8\u10d0"
|
| 58 |
+
],
|
| 59 |
+
"predicted_text": "\u10d4\u10d1\u10e3\u10da\u10d8\u10d0",
|
| 60 |
+
"answer_logits": [
|
| 61 |
+
[
|
| 62 |
+
0.70703125,
|
| 63 |
+
0.703125,
|
| 64 |
+
0.69921875
|
| 65 |
+
]
|
| 66 |
+
],
|
| 67 |
+
"training": {
|
| 68 |
+
"loss": 12.493996620178223,
|
| 69 |
+
"gradients": {
|
| 70 |
+
"model.multi_modal_projector.mm_input_projection_weight": true,
|
| 71 |
+
"model.language_model.embed_tokens.weight": true
|
| 72 |
+
},
|
| 73 |
+
"updated": true
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "default",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.7,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "sdpa",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "sdpa",
|
| 53 |
+
"vision_config": "sdpa"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u2581\u0987\u09a8\u09cd\u09a6\u09c1",
|
| 58 |
+
"\u0648\u0627\u062c"
|
| 59 |
+
],
|
| 60 |
+
"predicted_text": " \u0987\u09a8\u09cd\u09a6\u09c1\u0648\u0627\u062c",
|
| 61 |
+
"answer_logits": [
|
| 62 |
+
[
|
| 63 |
+
0.6796875,
|
| 64 |
+
0.66796875,
|
| 65 |
+
0.6640625
|
| 66 |
+
],
|
| 67 |
+
[
|
| 68 |
+
0.71875,
|
| 69 |
+
0.66015625,
|
| 70 |
+
0.65625
|
| 71 |
+
]
|
| 72 |
+
],
|
| 73 |
+
"training": {
|
| 74 |
+
"loss": 12.520472526550293,
|
| 75 |
+
"gradients": {
|
| 76 |
+
"model.language_model.embed_tokens.weight": true,
|
| 77 |
+
"model.language_model.layers.0.self_attn.q_proj.weight": true
|
| 78 |
+
},
|
| 79 |
+
"updated": true
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recorded_with": {
|
| 3 |
+
"contract": "huggingface-mic/gemma3-mic",
|
| 4 |
+
"contract_name": "mic-gemma3",
|
| 5 |
+
"contract_revision": "unpublished",
|
| 6 |
+
"framework": "transformers",
|
| 7 |
+
"variant": "default",
|
| 8 |
+
"target": "gemma3-mic",
|
| 9 |
+
"kind": "fixture",
|
| 10 |
+
"revision": "7987697a4ca53c8cb7217b7f82c891cf5e6ad09a",
|
| 11 |
+
"source_model": "google/gemma-3-4b-it",
|
| 12 |
+
"weights": "random",
|
| 13 |
+
"fixture_repo": "huggingface-mic/gemma3-mic",
|
| 14 |
+
"environment": {
|
| 15 |
+
"python": "3.11.18",
|
| 16 |
+
"transformers": "5.24.0.dev0",
|
| 17 |
+
"sentence-transformers": null,
|
| 18 |
+
"torch": "2.15.0",
|
| 19 |
+
"torchvision": "0.29.2",
|
| 20 |
+
"torchaudio": "2.11.1",
|
| 21 |
+
"tokenizers": "0.23.3",
|
| 22 |
+
"numpy": "2.3.5",
|
| 23 |
+
"pillow": "13.0.0",
|
| 24 |
+
"accelerate": "1.16.0",
|
| 25 |
+
"safetensors": "0.8.0",
|
| 26 |
+
"huggingface-hub": "2.4.0",
|
| 27 |
+
"sentencepiece": "0.2.3",
|
| 28 |
+
"protobuf": "7.36.2",
|
| 29 |
+
"librosa": "0.11.0",
|
| 30 |
+
"soundfile": "0.14.0",
|
| 31 |
+
"scipy": "1.17.1"
|
| 32 |
+
},
|
| 33 |
+
"seconds": 6.64,
|
| 34 |
+
"environment_differs": {
|
| 35 |
+
"pillow": "13.0.0 (pinned 12.3.0)",
|
| 36 |
+
"accelerate": "1.16.0 (pinned 1.15.0)",
|
| 37 |
+
"huggingface-hub": "2.4.0 (pinned 2.3.0)",
|
| 38 |
+
"sentencepiece": "0.2.3 (pinned 0.2.2)"
|
| 39 |
+
},
|
| 40 |
+
"platform": "cuda",
|
| 41 |
+
"baseline_repo": "huggingface-mic/gemma3-mic",
|
| 42 |
+
"baseline_revision": "unpublished",
|
| 43 |
+
"baseline_path": "integrations/transformers/expectations/cuda/gemma3-mic.json",
|
| 44 |
+
"template_date": "2026-01-01"
|
| 45 |
+
},
|
| 46 |
+
"outputs": {
|
| 47 |
+
"runtime": {
|
| 48 |
+
"device": "cuda",
|
| 49 |
+
"dtype": "bfloat16",
|
| 50 |
+
"attn_implementation": "sdpa",
|
| 51 |
+
"attn_implementations": {
|
| 52 |
+
"text_config": "sdpa",
|
| 53 |
+
"vision_config": "sdpa"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"predicted_tokens": [
|
| 57 |
+
"\u10d4\u10d1\u10e3\u10da\u10d8\u10d0"
|
| 58 |
+
],
|
| 59 |
+
"predicted_text": "\u10d4\u10d1\u10e3\u10da\u10d8\u10d0",
|
| 60 |
+
"answer_logits": [
|
| 61 |
+
[
|
| 62 |
+
0.84765625,
|
| 63 |
+
0.765625,
|
| 64 |
+
0.66796875
|
| 65 |
+
]
|
| 66 |
+
],
|
| 67 |
+
"training": {
|
| 68 |
+
"loss": 12.493707656860352,
|
| 69 |
+
"gradients": {
|
| 70 |
+
"model.multi_modal_projector.mm_input_projection_weight": true,
|
| 71 |
+
"model.language_model.embed_tokens.weight": true
|
| 72 |
+
},
|
| 73 |
+
"updated": true
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
|
@@ -4,8 +4,13 @@ This page is the Transformers contract of the Gemma3 MIC and also a usage exampl
|
|
| 4 |
|
| 5 |
## Next-token prediction
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
```py runnable:gemma3
|
|
|
|
| 8 |
import torch
|
|
|
|
| 9 |
from transformers import AutoProcessor, AutoModelForCausalLM, set_seed
|
| 10 |
import json # doc-builder: hide
|
| 11 |
import os # doc-builder: hide
|
|
@@ -13,6 +18,8 @@ import os # doc-builder: hide
|
|
| 13 |
model_id = "google/gemma-3-4b-it"
|
| 14 |
model_id = os.environ.get("MIC_MODEL", model_id) # doc-builder: hide
|
| 15 |
variant = json.loads(os.environ.get("MIC_MODEL_KWARGS", "{}")) # doc-builder: hide
|
|
|
|
|
|
|
| 16 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 17 |
set_seed(0) # seeds torch, NumPy, and Python: loading, dropout, and data augmentation draw random numbers
|
| 18 |
|
|
@@ -21,8 +28,15 @@ model = AutoModelForCausalLM.from_pretrained(model_id).to(device)
|
|
| 21 |
if variant: # doc-builder: hide
|
| 22 |
model = AutoModelForCausalLM.from_pretrained(model_id, **variant).to(device)
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
model.eval()
|
| 28 |
with torch.no_grad():
|
|
|
|
| 4 |
|
| 5 |
## Next-token prediction
|
| 6 |
|
| 7 |
+
The input case is `text`, `image` or `text_image` (each input alone, and both combined); the MIC runner runs every
|
| 8 |
+
case, for every variant.
|
| 9 |
+
|
| 10 |
```py runnable:gemma3
|
| 11 |
+
import numpy as np
|
| 12 |
import torch
|
| 13 |
+
from PIL import Image
|
| 14 |
from transformers import AutoProcessor, AutoModelForCausalLM, set_seed
|
| 15 |
import json # doc-builder: hide
|
| 16 |
import os # doc-builder: hide
|
|
|
|
| 18 |
model_id = "google/gemma-3-4b-it"
|
| 19 |
model_id = os.environ.get("MIC_MODEL", model_id) # doc-builder: hide
|
| 20 |
variant = json.loads(os.environ.get("MIC_MODEL_KWARGS", "{}")) # doc-builder: hide
|
| 21 |
+
case = "text_image" # the input case: "text", "image" or "text_image"
|
| 22 |
+
case = os.environ.get("MIC_CASE", case) # doc-builder: hide
|
| 23 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 24 |
set_seed(0) # seeds torch, NumPy, and Python: loading, dropout, and data augmentation draw random numbers
|
| 25 |
|
|
|
|
| 28 |
if variant: # doc-builder: hide
|
| 29 |
model = AutoModelForCausalLM.from_pretrained(model_id, **variant).to(device)
|
| 30 |
|
| 31 |
+
if case == "text":
|
| 32 |
+
prompts = ["The sky is", "Water is"]
|
| 33 |
+
inputs = processor(text=prompts, return_tensors="pt", padding=True)
|
| 34 |
+
else:
|
| 35 |
+
image = Image.fromarray(np.random.RandomState(0).randint(0, 255, (56, 56, 3), dtype=np.uint8))
|
| 36 |
+
content = [{"type": "image"}] + ([{"type": "text", "text": "Describe this image."}] if case == "text_image" else [])
|
| 37 |
+
prompt = processor.apply_chat_template([{"role": "user", "content": content}], tokenize=False, add_generation_prompt=True)
|
| 38 |
+
inputs = processor(text=[prompt], images=[image], return_tensors="pt")
|
| 39 |
+
inputs = inputs.to(device, dtype=model.dtype) # casts only floating tensors (pixel_values)
|
| 40 |
|
| 41 |
model.eval()
|
| 42 |
with torch.no_grad():
|