Skip to content

Fix supports_{tp/pp}_plan#44696

Open
hmellor wants to merge 1 commit intohuggingface:mainfrom
hmellor:fix-tp-pp-plan
Open

Fix supports_{tp/pp}_plan#44696
hmellor wants to merge 1 commit intohuggingface:mainfrom
hmellor:fix-tp-pp-plan

Conversation

@hmellor
Copy link
Member

@hmellor hmellor commented Mar 14, 2026

In configs, base_model_pp_plan and base_model_tp_plan default to None

In models, _pp_plan and _tp_plan look like they default to None based on the class variables, but will actually always be a dict because of post_init.

This means that supports_pp_plan and supports_tp_plan always return True.

This PR:

  • Fixes the supports methods
  • Adds some input validation to pp_plan's setter (same as tp_plan's)
  • Fixes the type hint for PreTrainedModel._pp_plan because it's always a tuple[str, str] not an Enum

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@HuggingFaceDocBuilderDev

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.

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.

2 participants