Repository navigation
Draw the fused LM head VLM test labels within the head's output size - #8591
albertvillanova wants to merge 1 commit into
Conversation
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 01c5830. Configure here.
| B, S = 2, 16 | ||
| vocab_size = ref_model.config.text_config.vocab_size | ||
| # Inkling 2's head outputs unpadded_vocab_size < vocab_size logits (#8590) | ||
| vocab_size = ref_model.get_output_embeddings().out_features |
There was a problem hiding this comment.
Head size still includes Inkling's padded rows
Medium Severity
For Inkling 2, the head keeps its padded vocabulary rows and only the forward cuts the logits down to unpadded_vocab_size. That makes get_output_embeddings().out_features the same as text_config.vocab_size, so ids and labels can still fall in [unpadded_vocab_size, vocab_size). The reference loss would still hit the out-of-range label and crash with a CUDA error, so this change likely doesn't fix #8590.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 01c5830. Configure here.


Fix #8590
The VLM tests of
TestAddFusedLMHeadLossdrewinput_idsandlabelsin[0, text_config.vocab_size), but Inkling 2's head outputs onlyunpadded_vocab_sizelogits, so about 1 run in 10 crashed with a CUDA error on an out-of-range label. The ids are now drawn from the head's output size (get_output_embeddings().out_features), which equalsvocab_sizefor every other model.Note
Low Risk
Test-only change in
_setup_vlm; no production training or inference behavior is modified.Overview
Fixes flaky Inkling 2 failures in
TestAddFusedLMHeadLossVLM helpers by aligning syntheticinput_ids/labelswith the LM head's actual output width.In
_setup_vlm, random token ids were sampled up totext_config.vocab_size, but Inkling 2's head only emitsunpadded_vocab_sizelogits—labels could land outside that range and trigger intermittent CUDA errors during loss. The upper bound is nowget_output_embeddings().out_features, which matches fullvocab_sizefor the other VLM checkpoints in the suite.Reviewed by Cursor Bugbot for commit 01c5830. Bugbot is set up for automated code reviews on this repo. Configure here.