Repository navigation
Studio: auto-detect completion masking markers, stop silent full-sequence training #7054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d880487
Auto-detect completion masking markers with template table fallback
danielhanchen daf6ccb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6e9d215
Restrict masking fallback to marker detection failures
danielhanchen 97171ef
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ad8f6ae
Fail the run when applying completion masking raises
danielhanchen 6c5b8c0
Import completion masking from its submodule
danielhanchen 8fd232b
Completion masking: gpt-oss renames and MLX raw/alpaca parity
danielhanchen c7f7a2c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c1ef9be
Define raw_text_mode outside the MLX feature-detect block
danielhanchen 0b188bd
Gate MLX masking on the formatter's resolved format
danielhanchen ffae8d1
Unwrap the mlx-lm TokenizerWrapper before marker checks
danielhanchen 3ab4dd1
Tighten masking comments
danielhanchen ce21ff8
gpt-oss: auto-detect markers first like every other template
danielhanchen 4e48f2c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a7c7404
Tighten comments
danielhanchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When auto-detection chooses markers for a model but
train_on_responses_onlyraises while applying them (for example because truncation or a template mismatch leaves every row fully masked), this catch leavesmasking_appliedfalse and training continues on full sequences. That produces a successful run with prompts included in the loss even though the user requested Train on completions; surface the error instead of downgrading the training objective. The MLX worker uses the same catch pattern.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in ad8f6ae: removed the callsite catches in both the CUDA trainer and the MLX worker. The helper falls back internally on detection failures and returns applied=False on a double miss, so any exception reaching the callsites is a real failure applying the masking and now fails the run instead of silently training on full sequences.