Repository navigation
fix(deploy): drop None tp_plan before HF from_pretrained - #771
Merged
Merged
Conversation
HuggingFaceLLMDeploy._load forwarded tp_plan=None into AutoModelForCausalLM.from_pretrained. transformers 5.15 no longer consumes tp_plan there, so it reaches the model constructor and every single-process in-framework HF deploy fails with "unexpected keyword argument 'tp_plan'". Only forward tp_plan when it is set. Adds unit tests covering both branches (red-green verified). Signed-off-by: Pruthviraj Prakash <pruprakash@nvidia.com>
Contributor
Author
|
/review |
svcnvidia-nemo-ci
approved these changes
Oct 8, 2026
svcnvidia-nemo-ci
left a comment
Contributor
There was a problem hiding this comment.
No verified findings in this light review.
The loading guard removes only tp_plan=None, preserving non-None plans and other loading arguments. The added regression tests cover omission and forwarding of "auto".
Both changed files and directly affected Triton/Ray loading paths were inspected. Tests were not executed in this read-only review.
Review generated by codex
Contributor
Author
|
/ok to test 3550515 |
oyilmaz-nvidia
approved these changes
Oct 13, 2026
|
Retrospective QA-fix tracking issue: #775 |
This branch was successfully deployed
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.
Summary
In-framework HF deploys (
deploy_inframework_hf_triton.py,automodel/deploy_triton.py, and the Ray HF path) crash at model load in single-process mode on transformers 5.15 withTypeError: LlamaForCausalLM.__init__() got an unexpected keyword argument 'tp_plan'. The scripts always passtp_plan=args.tp_plan, which isNoneoutside torchrun, andHuggingFaceLLMDeploy._loadforwarded it toAutoModelForCausalLM.from_pretrained. transformers <=5.8.1 poppedtp_planinsidefrom_pretrained. 5.15 no longer does (TP moved todistributed_config), so the kwarg now reaches the model constructor.Changes
nemo_deploy/llm/hf_deployable.py:_loaddropstp_planfromhf_kwargswhen it isNone. A value that is set is still forwarded.tests/unit_tests/deploy/test_hf_deployable.py: two tests check thattp_plan=Noneis not passed tofrom_pretrainedand thattp_plan="auto"still is.Verification
All runs used
nvcr.io/nvidian/nemo:26.10.rc4, which ships transformers 5.15.0.test_initialization_omits_tp_plan_when_noneFAILS with the fix reverted and PASSES with it. The wholetest_hf_deployable.pyfile passes (38 passed).ruff checkandruff format --check(0.9.9) are clean.deploy_inframework_hf_triton.py, single process: without the fix it hits the TypeError above. With the fix, Triton reports ready and a query returns " Paris. It is the most visited city...".Notes
--tp_plan autounder torchrun still fails on transformers >=5.15. It needs a migration todistributed_config, which should be handled separately.Reference