Skip to content

Load adapter with TP#45155

Merged
michaelbenayoun merged 10 commits intohuggingface:mainfrom
michaelbenayoun:load_adapter_tp_integration
Apr 9, 2026
Merged

Load adapter with TP#45155
michaelbenayoun merged 10 commits intohuggingface:mainfrom
michaelbenayoun:load_adapter_tp_integration

Conversation

@michaelbenayoun
Copy link
Copy Markdown
Member

@michaelbenayoun michaelbenayoun commented Mar 31, 2026

What does this PR do?

Add support for loading adapters with PreTrainedModel.load_adapter when using TP.

See: huggingface/peft#3096

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@michaelbenayoun michaelbenayoun changed the title feat: adapter loading with TP Load adapter with TP Apr 7, 2026
Comment thread src/transformers/integrations/peft.py Outdated
elif checkpoint_files is not None:
merged_state_dict = {}
for ckpt_file in checkpoint_files:
from ..modeling_utils import load_state_dict
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont import here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@michaelbenayoun michaelbenayoun added this pull request to the merge queue Apr 9, 2026
Merged via the queue into huggingface:main with commit c585eea Apr 9, 2026
28 checks passed
@michaelbenayoun michaelbenayoun deleted the load_adapter_tp_integration branch April 9, 2026 22:35
sirzechs66 pushed a commit to sirzechs66/transformers that referenced this pull request Apr 18, 2026
* feat: adapter loading with TP

* wip: load_adapter support TP

* style: ruff

* feat: check if state dict is tensors

* refactor: move local import to the top the function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants