Skip to content

fix(deploy): drop None tp_plan before HF from_pretrained - #771

Merged
oyilmaz-nvidia merged 1 commit into
mainfrom
pruprakash/fix_deploy_hf_tp_plan_none
Oct 13, 2026
Merged

oyilmaz-nvidia merged 1 commit into
mainfrom
pruprakash/fix_deploy_hf_tp_plan_none

Conversation

@pruprakash

Copy link
Copy Markdown
Contributor

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 with TypeError: LlamaForCausalLM.__init__() got an unexpected keyword argument 'tp_plan'. The scripts always pass tp_plan=args.tp_plan, which is None outside torchrun, and HuggingFaceLLMDeploy._load forwarded it to AutoModelForCausalLM.from_pretrained. transformers <=5.8.1 popped tp_plan inside from_pretrained. 5.15 no longer does (TP moved to distributed_config), so the kwarg now reaches the model constructor.

Changes

  • nemo_deploy/llm/hf_deployable.py: _load drops tp_plan from hf_kwargs when it is None. A value that is set is still forwarded.
  • tests/unit_tests/deploy/test_hf_deployable.py: two tests check that tp_plan=None is not passed to from_pretrained and that tp_plan="auto" still is.

Verification

All runs used nvcr.io/nvidian/nemo:26.10.rc4, which ships transformers 5.15.0.

  • Red-green: test_initialization_omits_tp_plan_when_none FAILS with the fix reverted and PASSES with it. The whole test_hf_deployable.py file passes (38 passed). ruff check and ruff format --check (0.9.9) are clean.
  • e2e on Llama-3.2-1B with 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

  • Out of scope: --tp_plan auto under torchrun still fails on transformers >=5.15. It needs a migration to distributed_config, which should be handled separately.

Reference

  • NVBug 6875716

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>
@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@pruprakash

Copy link
Copy Markdown
Contributor Author

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@pruprakash

Copy link
Copy Markdown
Contributor Author

/ok to test 3550515

@oyilmaz-nvidia
oyilmaz-nvidia merged commit fa1cbb7 into main Oct 13, 2026
36 checks passed
@oyilmaz-nvidia
oyilmaz-nvidia deleted the pruprakash/fix_deploy_hf_tp_plan_none branch October 13, 2026 16:02
@qiaochuz-nv

Copy link
Copy Markdown

Retrospective QA-fix tracking issue: #775

This branch was successfully deployed

2 active deployments
nemo-ci — 35505154 Deployed Oct 12, 2026 by copy-pr-bot[bot] via cicd-e2e-tests-inframework #3099
test — 35505154 Deployed Oct 8, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #3099
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants