Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2072,7 +2072,8 @@ def _setup_vlm(self, model_id):
add_fused_lm_head(chunked_model)

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 01c5830. Configure here.

input_ids = torch.randint(0, vocab_size, (B, S), device=torch_device)
labels = input_ids.clone()
labels[:, :4] = -100
Expand Down
Loading