Align the chunked-loss config access between SFT and Distillation - #6744
Open
qgallouedec wants to merge 3 commits into
Open
Align the chunked-loss config access between SFT and Distillation#6744qgallouedec wants to merge 3 commits into
qgallouedec wants to merge 3 commits into
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
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 config-resolution change in chunked CE training path; behavior should match transformers’ canonical
get_text_config()and existing distillation logic, with tests reported passing.Overview
_patch_chunked_ce_lm_headnow resolveslogit_scale,output_multiplier,final_logit_softcapping, and MoEoutput_router_logitsviamodel.config.get_text_config(), matchingDistillationTrainerinstead of branching onis_vlm(text_configvs top-levelconfig).The
is_vlmargument is unchanged for transformers < 5.0.0 (backbone viamodel.model, config-level MoE aux-loss fields); its docstring no longer describes config selection. Inline comments were updated to documentget_text_config()and thelogit_scale/output_multiplierfallback behavior.Reviewed by Cursor Bugbot for commit 834ec80. Bugbot is set up for automated code reviews on this repo. Configure here.