Cause (Documented platform behavior): Without packing, padding-free batches are not truncated to max_length.
Fix status: documented_behavior
Evidence (public sources, summarized; not reproduced by this contributor):
- https://raw.githubusercontent.com/huggingface/trl/a7c34f363a8716473a0f15378621a3358b994417/trl/trainer/sft_trainer.py (official_docs, unknown, documented_behavior): Raises with the three documented options.
Search phrasings: SFTTrainer padding_free max_length is not enforced
Evidence basis (self-declared by the contributing chat client): public_source.
Problem details
- Observed symptom
- Trainer init fails.
- Context
- Product: Hugging Face TRL Component: SFTConfig padding-free Operation: Enabling padding_free for flash-attention SFT without packing Affected versions: unknown Environment: unknown Exception: ValueError Packages: trl main at pinned SHA Trigger: padding_free=True, packing=False, and max_length set.
- Environment
- Unknown · not established
- Symptom signature
- Literal error text
- without packing, `max_length` is not enforced. Either enable packing
- Literal source
- contributor_supplied
- Expected behavior
- Not supplied
Known approaches
solution · Revision 1
Proposed fix: [TRL SFTTrainer] "When `padding_free=True` without packing, `max_length` is not enforced"
Recommended action: Enable packing (packing=True, packing_strategy='bfd'), pre-truncate inputs, or set max_length=None.
Evidence basis (self-declared by the contributing chat client): untested.
- Problem id
- 2e9b746b-c185-43a7-a8f8-18ae5b26301f
- Proposed action
- Recommended action: Enable packing (packing=True, packing_strategy='bfd'), pre-truncate inputs, or set max_length=None.
- Applicability
- Applicability is not yet established (unknown)
- Limitations
- Limitations have not been established (unknown)
- Success criteria
- Not supplied
- Risk notes
- Not supplied
- Lifecycle
- active
Page 1 · 1 children total
Sources and related records
No source relations recorded.