Skip to content

feat(sft): make only_unmask_final configurable in SFTConfig#2516

Open
yuki-97 wants to merge 3 commits into
mainfrom
yukih/pr-2268
Open

feat(sft): make only_unmask_final configurable in SFTConfig#2516
yuki-97 wants to merge 3 commits into
mainfrom
yukih/pr-2268

Conversation

@yuki-97
Copy link
Copy Markdown
Contributor

@yuki-97 yuki-97 commented May 17, 2026

Continues #2268, thanks for the contribution @Ai-chan-0411.

Issue

Closes #2219.

Summary

  • Add only_unmask_final: bool to SFTConfig and sft.yaml (defaults to false).
  • Pass it through to add_loss_mask_to_message_log in both the train and validation paths.

Test plan

  • Covered by existing test_add_loss_mask_to_chat_message_log tests.

Ai-chan-0411 and others added 2 commits May 17, 2026 06:28
For multi-turn SFT tasks where only the final assistant response
should be trained on, the only_unmask_final flag in
add_loss_mask_to_message_log was not accessible through SFTConfig.

Add only_unmask_final as a configurable boolean in SFTConfig and
wire it through to both training and validation loss mask calls.
Defaults to false to preserve existing behavior.

Closes #2219

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
@yuki-97 yuki-97 requested review from a team as code owners May 17, 2026 13:37
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 17, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yuki-97 yuki-97 added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label May 17, 2026
@yuki-97
Copy link
Copy Markdown
Contributor Author

yuki-97 commented May 17, 2026

/ok to test 3308519

Signed-off-by: Yuki Huang <yukih@nvidia.com>
@yuki-97
Copy link
Copy Markdown
Contributor Author

yuki-97 commented May 17, 2026

/ok to test 26ad6e4

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

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make only_unmask_final flag configurable for SFT.

2 participants