Repository navigation
Align the chunked-loss config access between SFT and Distillation - #6744
Merged
Merged
Conversation
|
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. |
qgallouedec
force-pushed
the
align-chunked-ce-config-access
branch
from
August 18, 2026 16:24
fd4a9ec to
fb1e276
Compare
qgallouedec
force-pushed
the
align-chunked-ce-config-access
branch
from
August 18, 2026 17:08
4ccfdc5 to
834ec80
Compare
qgallouedec
force-pushed
the
align-chunked-ce-config-access
branch
from
August 19, 2026 19:55
834ec80 to
f4fe9e5
Compare
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.
Both trainers resolve the same per-model logit post-processing (
logit_scale/output_multiplier/final_logit_softcapping) for their chunked loss, but reached it two different ways.DistillationTrainerusesconfig.get_text_config(); SFT branched on anis_vlmflag._patch_chunked_ce_lm_headnow readsmodel.config.get_text_config(), so the resolution block is word-for-word identical to the one indistillation_trainer.py.is_vlmstays — it still gates two transformers < 5.0.0 fallbacks (VLMs setbase_model_prefix = "", and take config-level MoE aux-loss parameters) — but its docstring no longer claims a config-reading role it no longer has.TestPatchChunkedCELMHead+TestChunkedCrossEntropyLoss: 79 passed.Note
Low Risk
Narrow refactor of config resolution for chunked NLL training; behavior should improve consistency for VLMs without touching auth or data paths.
Overview
SFT chunked-loss patching now resolves logit post-processing (
logit_scale/output_multiplier,final_logit_softcapping, and MoEoutput_router_logits) viamodel.config.get_text_config()instead of choosing between top-levelmodel.configandmodel.config.text_configwhenis_vlmis true. That matchesDistillationTrainer’s chunked-loss path so both trainers read the same config surface for VLMs and text-only models.The
is_vlmargument is unchanged for behavior: it still only drives transformers < 5.0.0 fallbacks (VLM backbone viaself.modeland config-level MoE aux-loss fields). Its docstring no longer describes config selection, since that is handled uniformly byget_text_config(). Inline comments were updated to document thelogit_scale/output_multiplierfallback semantics in line with distillation.Reviewed by Cursor Bugbot for commit f4fe9e5. Bugbot is set up for automated code reviews on this repo. Configure here.