Repository navigation
fix(ml): drop resume_download, removed from from_pretrained in transformers v5 (#15054) - #15297
Merged
Merged
Conversation
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
Applied Black, isort, and autoflake to match code-quality checks. Triggered by workflow auto-fix-formatting.yml.
Closed
2 tasks
added 2 commits
August 29, 2026 20:16
…ormatter's further shrink (#15054)
4 tasks
This was referenced Aug 30, 2026
This was referenced Sep 12, 2026
mrveiss
added a commit
that referenced
this pull request
Sep 12, 2026
#16535) The 2200.0-unit budget at system_benchmarks_performance_test.py:385 was never re-derived after #15297 fixed #15054's CLIP-load TypeError -- the constructor now does the real work instead of exiting early, and seven real CI runs since (2026-08-30 through 2026-09-11) measured 2013.226 to 4348.363 units, all above the stale budget. Exactly the "baseline's premise had gone" failure mode perf_work_budget.py's own docstring already names this site as the worked example for. Re-derived at 4348.363 (worst of the seven) x ~1.9, this site's own stated policy for disk-bound work (model-file/HF-cache I/O, which a CPU-bound yardstick cannot track): budget 8300. perf_work_budget.py's worked-example docstring updated from its stale "~1500 units" figure to match the fuller measured range. This assertion was the recurring failure blocking .github/workflows/ marker-tests.yml's ten-consecutive-green bar for enabling its schedule (#13286) -- filed and fixed separately since the root cause (a stale perf baseline) is distinct from the cron-enablement decision itself.
This was referenced Sep 12, 2026
This was referenced Sep 12, 2026
This was referenced Sep 12, 2026
Merged
Merged
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.
Thinking Path
transformersis pinned at5.15.1(requirements-ci/ai-ml.txt:10-- the issue'sbody cited
5.15.0, but the requirements file at the base branch pins5.15.1).Before touching any call site, I read that exact version's own source
(
.venv-python-suite/lib/python3.14/site-packages/transformers/-- alreadyinstalled locally for an unrelated purpose, read-only, never imported/executed)
to establish what
resume_downloadactually does now rather than assume frommemory:
PreTrainedModel.from_pretrained(modeling_utils.py) never popsresume_download. It forwards unrecognized kwargs intoconfig_class.from_pretrained(..., return_unused_kwargs=True, **kwargs), andthe still-unused remainder becomes
model_kwargs, which reachescls(config, *model_args, **model_kwargs). A concrete model/processor class(
CLIPModel,Wav2Vec2Model,WhisperForConditionalGeneration, ...) has no**kwargscatch-all on__init__, so this is a liveTypeError--exactly the CI reproduction the issue cites:
CLIPModel.__init__() got an unexpected keyword argument 'resume_download'(run 32839088246).AutoConfig.from_pretrained/AutoTokenizer.from_pretrainedsurvive itinstead:
PretrainedConfig.__post_init__stores any leftover kwarg as a bareinstance attribute (
configuration_utils.py-- "Additional attributes withoutdefault values"), and
PreTrainedTokenizerBase.__init__just leaves it sittingin
init_kwargs, unused. Both silently swallow it -- latent debt, not acrash, on that path.
So the breakage is mixed by call shape, not uniform -- but the fix is the same
either way:
resume_downloadhas no replacement kwarg (resumption is automaticin v5), so it is dropped everywhere rather than substituted.
Call-site count: a repo-wide grep for
from_pretrained((git-tracked.py,prose-stripped to exclude a docstring mention in
hf_quantizer.py:97) finds22 real call sites, of which 18 carried
resume_download-- not theissue's 10. The issue's table missed
autobot-backend/multimodal_processor/processors/voice.pyentirely (4 sites)and only listed 1 of
vision.py's 5. The other 4 (a pyannotePipeline.from_pretrainedin
media/audio/diarization_service.py, and 3trust_remote_code-only calls inautobot-npu-worker/resources/windows-npu-worker/app/npu_worker.py, which pinstransformers>=4.36.0separately) never passedresume_downloadand are untouched.What Changed
resume_download=Truefrom all 18 call sites acrossai_hardware_accelerator.py,code_embedding_generator.py,llm_shared/optimization/layer_inference.py,llm_shared/optimization/model_inspector.py,multimodal_processor/processors/vision.py, andmultimodal_processor/processors/voice.py. No replacement kwarg -- v5resumption is automatic.
ai_hardware_accelerator.pyshrank by 2 lines from the deletion; lowered itsratchet ceiling from 1048 to 1046 in both
scripts/python_file_size_known_large.pyandrepo_tests/python_file_size_ratchet_baseline.py(the mirrored pair theratchet requires) -- a genuine shrink, not a raised ceiling.
degraded-but-ready processor" acceptance criterion is already satisfied by
existing code (
vision.py:351'sclip_model is None or blip_model is Nonegate from Implement real multimodal processing with NPU integration #466, and
processor.py'sget_stats()"model_availability"block from [Backend] Vision and audio model loading failures #675) -- verified by reading, not modified further.
repo_tests/transformers_resume_download_guard_test.py: a durable guardthat walks every git-tracked production
.pyfile, finds every.from_pretrained(...)call (paren-depth tracked so a multi-line call iscaptured whole, prose stripped first so a docstring mention is never counted),
and fails if any call span contains
resume_download.Verification
transformers5.15.1's own source(
modeling_utils.py,configuration_utils.py,tokenization_utils_base.py,processing_utils.py) to establish the TypeError-vs-silently-swallowed splitabove -- no
from_pretrainedcall was executed and no model was downloaded.grep -rn resume_download --include='*.py' .on the tree after the change: nomatches.
FROM_PRETRAINED_REACH_FLOOR = 15sits between thetree's real total (22) and a broken walk's 0 --
test_the_from_pretrained_sweep_reaches_the_repofails loudly if the sweep stops finding call sites instead of reporting a
false "no offenders" having checked nothing.
test_a_reintroduced_resume_download_is_caughtreproducesthe exact pre-fix
vision.pyCLIPModel.from_pretrained(...)call(
resume_download=Trueon the call's second line) and asserts the detectorflags it -- proving the guard isn't vacuously passing.
(
code_embedding_generator_test.py,layer_inference_test.py,model_inspector_test.py, and the new guard) and reported all green -- thehook's own gate, not a manual
pytestinvocation, per the no-run-pytestconstraint on this task.
Closes #15054
Model Used
Claude Sonnet 5