Skip to content

Document that padding_free is currently disabled in DPO - #6972

Open
behroozazarkhalili wants to merge 1 commit into
mainfrom
docs/2469-padding-free-disabled
Open

Document that padding_free is currently disabled in DPO#6972
behroozazarkhalili wants to merge 1 commit into
mainfrom
docs/2469-padding-free-disabled

Conversation

@behroozazarkhalili

@behroozazarkhalili behroozazarkhalili commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

What

Documents that padding_free currently does nothing in DPO, at the three places a user would look:

  • the DPOConfig.padding_free docstring
  • the same field's help text, which is what the CLI prints
  • the DPO tab of the padding-free section in docs/source/reducing_memory_usage.md

Why

padding_free shipped for DPO in #2520 and was disabled by the DPO refactor in #3906. dpo_trainer.py:717-724 warns and falls back to standard padding. Nothing outside that runtime warning says so, so the documented behavior and the actual behavior disagree.

@albertvillanova described the same gap on #2469 on 2026-08-10: "a documented public config field is dead for every DPO user."

Measured on this branch against trl-internal-testing/tiny-Qwen3ForCausalLM:

requested=True   config.padding_free=True   trainer.padding_free=False
requested=False  config.padding_free=False  trainer.padding_free=False

The False arm is the control. The first row shows what the runtime warning does not cover. The trainer overrides its own copy of the value, so DPOConfig.padding_free still reads True after construction. Anything reading the config rather than the trainer, including a serialized run config, records a feature that did not run.

Scope

Documentation only. The fallback, the warning message, and the field default are unchanged, and the probe above prints the same two lines before and after the edit. SFT padding-free works and is untouched.

This describes a temporary state. @qgallouedec closed #5141 on 2026-08-27 saying he would redo padding-free DPO from a fresh branch, so the DPO tab and its example stay in place with a warning above them rather than being removed. That leaves the restoration PR one hunk to delete.

Verification

  • ruff check and ruff format --check at the pinned v0.13.3 pass. A deliberately broken copy fails both, so the gate is live.
  • doc-builder at the pinned rev 0ab9ea0 with --max_len 119 passes. It rejected my first wrapping and origin/main passes the same runner, so the failure was mine; the wrapping in this PR is the tool's own output.
  • None of the 188 currently open PRs modifies these lines.

Refs #2469


Note

Low Risk
Documentation-only updates to config help and the memory-usage guide; training behavior is unchanged.

Overview
Aligns DPO padding_free documentation with current trainer behavior after #3906: the option still exists on [DPOConfig], but setting padding_free=True only triggers a warning and standard padding is used.

Adds matching notes in the DPOConfig.padding_free class docstring and CLI help text, plus a WARNING on the DPO tab in reducing_memory_usage.md (with a link to #2469). The DPO example snippet is kept for when the feature returns. No runtime or default changes—SFT padding-free docs are unchanged.

Reviewed by Cursor Bugbot for commit c8123a2. Bugbot is set up for automated code reviews on this repo. Configure here.

DPOConfig documents padding_free as a working memory optimization and
reducing_memory_usage.md shows DPO users how to switch it on. Neither
says the flag has done nothing since the DPO refactor in #3906, which
added a fallback at dpo_trainer.py:717-724 that warns and forces the
value to False.

The config also keeps reporting the requested value. The trainer copies
args.padding_free into an instance attribute and overrides the copy, not
the config, so training_args.padding_free stays True for the whole run
and any serialized run config records a feature that never ran.

Documentation only. The fallback, the warning message, and the field
default are unchanged.

Refs #2469
@bot-ci-comment

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant