Skip to content

[Model] Decouple nemotron_nas from llama - #69726

Open
vyomakesh0728 wants to merge 6 commits into
vllm-project:mainfrom
vyomakesh0728:decouple-llama
Open

vyomakesh0728 wants to merge 6 commits into
vllm-project:mainfrom
vyomakesh0728:decouple-llama

Conversation

@vyomakesh0728

@vyomakesh0728 vyomakesh0728 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Decouple vllm/model_executor/models/nemotron_nas.py from llama.py by inlining DeciLMMLP and DeciLMAttention. Part of #67937.

Claims

  • Removes all vllm.model_executor.models.llama imports from nemotron_nas.py. Parameter names and weight loading are unchanged.
  • DeciLMMLP matches LlamaMLP (keeps bias and maybe_fused_act_quant). It drops reduce_results/disable_tp, which nemotron_nas never passed.
  • DeciLMAttention matches LlamaAttention plus the previous _init_rotary_emb override (mistral_yarn/rope_llama4 → is_neox_style=False), and keeps layer_types sliding-window support. It drops the Eagle3 draft target_layer_count offset, the EncoderOnlyAttention branch and the attn_type parameter, none of which DeciLM can reach.
  • No open PR duplicates this (gh pr list --state open for nemotron_nas, DeciLM). The open PR [Model] Support EAGLE-3 aux hidden states for EXAONE 4 and DeciLM #68289 only adds EAGLE-3 aux hidden states.

Validation

Run on 2x RTX 4090 (CUDA 13.2, PyTorch 2.14.0+cu132, Python 3.14.10) against base 850fd21d75, before the domyn_edge.py changes were split out:

.venv/bin/python -m pytest tests/models/test_registry.py -k "DeciLM or DomynEdge" -v
# 2 passed, 472 deselected in 3.71s
.venv/bin/python -m pytest tests/models/test_initialization.py -k "DeciLMForCausalLM or DomynEdgeForCausalLM" -v
# 2 passed, 447 deselected, 2 warnings in 41.30s
  • nvidia/Llama-3_3-Nemotron-Super-49B-v1 (4 layers, seeded random weights, enforce_eager=True, greedy, 16 tokens): prompt logprobs, greedy tokens and output logprobs are bitwise identical to main.
  • tests/models/test_pp_equivalence.py::_check_equivalent(VllmRunner, "DeciLMForCausalLM", 2): bitwise equivalent at PP=1 vs PP=2.
  • DeciLMMLP(bias=False/True) matches LlamaMLP bit-exactly on CUDA bfloat16.

Since then, the only code change is removing the unused attn_type parameter. Attention already defaults to AttentionType.DECODER, so behaviour is unchanged. Pre-commit passes.

AI assistance was used during the creation of this PR.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@vyomakesh0728 vyomakesh0728 changed the title [Model] Decouple nemotron_nas and domyn_edge from llama [Model] Decouple nemotron_nas and domyn_edge from llama Nov 24, 2026
@mergify mergify Bot added the llama Related to Llama models label Nov 24, 2026
@vyomakesh0728
vyomakesh0728 force-pushed the decouple-llama branch 3 times, most recently from 3dd44eb to 6236cf2 Compare November 25, 2026 11:38
@vyomakesh0728 vyomakesh0728 changed the title [Model] Decouple nemotron_nas and domyn_edge from llama [Model] Decouple nemotron_nas from llama Nov 25, 2026

@hmellor hmellor left a comment

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.

LGTM. Faithful inline of LlamaMLP/LlamaAttention; the dropped branches are unreachable for DeciLM. I pushed a small commit removing the unused attn_type parameter and updated the description to drop the reverted domyn_edge changes.

This review was AI-assisted.

@hmellor
hmellor enabled auto-merge (squash) November 25, 2026 13:35
@hmellor

hmellor commented Nov 25, 2026

Copy link
Copy Markdown
Member

/ci run

@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 25, 2026
@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #105734 for commit 6a1d0c58b51c.

vyomakesh0728 and others added 3 commits November 25, 2026 20:03
Inline DeciLMMLP and DeciLMAttention in nemotron_nas.py to remove
imports from llama.py, and inline DomynEdgeMLP and DomynEdgeModel
(preserving hf_to_vllm_mapper and load_weights) in domyn_edge.py to
remove imports from qwen3.py.

Co-authored-by: Antigravity <noreply@google.com>
Signed-off-by: vyomakesh0728 <dvyomkesh.vishwakarma@gmail.com>
Restore vllm/model_executor/models/domyn_edge.py to base commit so this PR only decouples nemotron_nas.py from llama.py, leaving qwen3.py untouched.

Co-authored-by: Antigravity <noreply@google.com>
Signed-off-by: vyomakesh0728 <dvyomkesh.vishwakarma@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
auto-merge was automatically disabled November 25, 2026 14:33

Head branch was pushed to by a user without write access

@hmellor

hmellor commented Nov 25, 2026

Copy link
Copy Markdown
Member

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #105753 for commit 43137ccb42cc.

ℹ️ This PR is 1 commit behind upstream main. Merged upstream main into this branch as 43137ccb42cc before starting CI. Pull the branch before pushing more changes.

@vyomakesh0728

Copy link
Copy Markdown
Contributor Author

cc @hmellor could you enable auto-merge please

@hmellor

hmellor commented Nov 25, 2026

Copy link
Copy Markdown
Member

Please stop merging from main. Every time you do I have to manually trigger CI. If there's only one job failing it's likely flaky and we can just do /ci retry

@hmellor

hmellor commented Nov 25, 2026

Copy link
Copy Markdown
Member

/ci run

@hmellor
hmellor enabled auto-merge (squash) November 25, 2026 18:04
@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #105781 for commit 1f5a724c1952.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llama Related to Llama models ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants