You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG][calibration] Over-long left-padded rows keep their padding and drop real tokens; a heavily padded row becomes all padding (regression of #4008) #4238
Severity: medium Version: 7.11.0 @ 9dad249. The repo test tests/test_prepare_dataset.py::test_prepare_dataset_trims_left_padded_rows_from_the_left_edge fails at HEAD.
Summary
utils/calibration.py:472-490 cuts rows longer than max_position_embeddings purely by truncation_side (default right), as row_ids[:max_positions], ignoring the attention mask.
A left-padded row keeps its leading pads and loses real tokens from the end.
Strip padding (by mask) before applying the position budget, then truncate the real tokens by truncation_side. Never emit an all-pad row.
Related: #4008 (closed; introduced the truncation_side logic), #4194.
Found during an AI-assisted review (Claude Code) of 9dad249; repros were run on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Activity
fix(calibration): strip padding before the position budget (ModelClou…
perf(calibration): strip pre-padded rows before sorting and batching (M…