Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five input-handling gaps remained in
prepare_calibration_datasetafter #4193/#4238. The root cause is that calibration input classification only understoodlist/tuple/.ndimvalues (sodatasets.arrow_dataset.Columnlooked like a single row), and the concat path packed rows verbatim after the minimum-length filter instead of stripping masked positions. Separately, the concat tail padding dereferencedpad_token_id=None, an all-zero additive/extended mask was normalized as "drop everything", and the looper size warning measured mapping columns rather than calibration rows.What Changed
_is_batched_column: treat any non-strSequencewhose first element is a sequence as a column, which coversdatasets.arrow_dataset.Column; single-row dicts andtextcolumns are unchanged.calibration_concat_size: strip attention-mask-0 positions from every row before packing, so pad ids fromtokenizer(texts, padding=True)never enter a concatenated window.eos_token_id, then0, whenpad_token_idis None; the mask still marks the tail as padding._normalize_attention_mask: an all-zero floating-point or rank>=3 mask means "no padding" and keeps every token; only positions explicitly masked (e.g. negative additive bias) are dropped. The item-level removal warning now says empty/all-padding/too-short instead of the misleadinginput_ids with length <= N.LoopProcessorsize warning: count calibration rows for columnar mappings viacalibration_input_row_countinstead of counting columns.tests/test_calibration_input_gaps_4311.py(one per defect); updated the onetests/test_prepare_dataset.pyexpectation that encoded the old "pack masked positions" behavior.Tests
The 2 failures are pre-existing and environmental, reproduced on a pristine
origin/mainarchive:tests/test_calibration_data_device.py::test_stage_capture_balanced_mode_empty_filter_fallbackand::test_balanced_mode_fallback_when_input_device_not_in_forward_devicesboth raiseRuntimeError: No CUDA GPUs are available(CPU-only container).Model Support / Module Plan
N/A — no new model types or registry entries.
Fixes #4311