Repository navigation
Add a tiny Inkling 2 model and run it in the VLM tests - #8498
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
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. |
One layer of each type, the experts stored in MXFP8 with ue8m0 scales, the router and attention residual inputs in float32, and the tokens, chat template and generation config of the reference, which now sets them.
#8484 fixed the image tiles. transformers < 5.24 loads the dequantized checkpoint in mixed dtypes, and dequantizing the MXFP8 experts drops their scales, which breaks DPO, KTO and GRPO on main too.
| MODEL_ID = "thinkingmachines/Inkling-2-Small-MXFP8" | ||
|
|
||
| processor = AutoProcessor.from_pretrained(MODEL_ID) | ||
| generation_config = GenerationConfig.from_pretrained(MODEL_ID) |
There was a problem hiding this comment.
Generator omits eos and pad tokens
Medium Severity
The generator loads the reference processor and never assigns eos_token or pad_token, even though this checkpoint's tokenizer does not define them. smoke_test pads a two-example batch, and trainers fall back to pad_token = eos_token, so both stay unset. Regenerating the Hub model therefore ships a tokenizer that cannot pad or end sequences.
Reviewed by Cursor Bugbot for commit 0c015a8. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ccb1a73. Configure here.
| reason="transformers < 5.24 loads the dequantized FP8 checkpoint in mixed dtypes " | ||
| "(huggingface/transformers#50595, huggingface/transformers#50975)", | ||
| strict=True, | ||
| ), |
There was a problem hiding this comment.
SFT image test missing mixed-dtype xfail
Medium Severity
The mixed-dtype xfail is applied to test_train_vlm but not to test_train_vlm_prompt_completion, which loads the same Inkling 2 checkpoint and trains on zen-image. On transformers < 5.24 that case fails for the same dequantized mixed-dtype reason, so the latest-transformers CI job errors instead of treating it as expected.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ccb1a73. Configure here.
The tiny model's completions all parse to an empty answer, so every one gets the same reward: the advantages are zero and GRPO trains nothing. The unscaled experts only break DPO and KTO.
# Conflicts: # tests/test_async_grpo_trainer.py # tests/test_chat_template_utils.py # tests/test_distillation_trainer.py # tests/test_dpo_trainer.py # tests/test_grpo_trainer.py # tests/test_kto_trainer.py # tests/test_rloo_trainer.py # tests/test_sft_trainer.py # tests/test_utils.py
…els, like Mistral Large 4
# Conflicts: # tests/conftest.py


Part of #8497.
Adds a tiny Inkling 2 (
trl-internal-testing/tiny-Inkling2ForConditionalGeneration) mirroringthinkingmachines/Inkling-2-Small-MXFP8: one layer of each type, MXFP8 experts, and the reference's dtypes, tokens, chat template and generation config. It runs in the VLM tests next to Gemma 4. On transformers main, SFT, RLOO and Distillation on images, tool calling and response parsing pass. Expected to fail:Note
Low Risk
Changes are limited to a new tiny-model generator script, test parametrization, and a Hub commit pin—no production training or inference paths are modified.
Overview
Adds a tiny Inkling 2 VLM (
trl-internal-testing/tiny-Inkling2ForConditionalGeneration) and wires it through the existing VLM test matrix, alongside the new generation script that builds and uploads the checkpoint.The new
inkling2_for_conditional_generation.pyscript shrinksthinkingmachines/Inkling-2-Small-MXFP8to two hybrid text layers plus a minimal vision tower, then exports weights in the reference layout: MoE experts in MXFP8 with per-block scales, attention-residual and router bias in float32, and the rest in bf16, including a trimmedhf_quant_config.json.Trainer and utility tests register the model with transformers ≥ 5.23 skips and xfail markers where behavior is known broken (MXFP8 dequantization, GRPO reward parsing, async GRPO tree packing, fused LM head).
testing_utils.pypins the Hub revision for reproducible CI.Reviewed by Cursor Bugbot for commit 899f396. Bugbot is set up for automated code reviews on this repo. Configure here.