Skip to content

fix(test): use SDPA for Nemotron-H HF reload#3060

Merged
yuhezhang-ai merged 2 commits into
mainfrom
yuhez/fix/nemotron-h-hf-attention
Jul 15, 2026
Merged

fix(test): use SDPA for Nemotron-H HF reload#3060
yuhezhang-ai merged 2 commits into
mainfrom
yuhez/fix/nemotron-h-hf-attention

Conversation

@yuhezhang-ai

@yuhezhang-ai yuhezhang-ai commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What

  • select sdpa when checkpoint robustness loads a Nemotron-H model through Hugging Face remote code
  • preserve flash_attention_2 for other remote-code models, including Nemotron-Flash
  • preserve any explicitly configured attention implementation
  • apply the selection to both source-load parity and post-checkpoint HF reloads
  • keep nonzero ranks in a long-timeout synchronization while rank 0 performs the slow HF reload

Why

AM-672 fails while the vanilla-HF reference model runs through Hugging Face's FlashAttention varlen/unpadding path. Nemotron-H triggers a CUDA vectorized_gather_kernel index-out-of-bounds assert there. The later tensor-representation error and NCCL failures are secondary symptoms of rank 0's asynchronous CUDA failure.

PyTorch SDPA avoids the incompatible HF varlen path while retaining optimized CUDA attention dispatch. The explicit reload synchronization also prevents other ranks from hitting the default 600-second process-group timeout while rank 0 is still loading the 120B HF reference.

Validation

The separate vLLM deploy result in that combined pipeline belongs to #3061 / AM-668 and does not affect this HF checkpoint-robustness fix.

Linear: AM-672

Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 13, 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.

@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 2ff349d

Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 96423b4

@yuhezhang-ai yuhezhang-ai marked this pull request as ready for review July 14, 2026 16:25
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

@akoumpa can you bless this PR?

@yuhezhang-ai yuhezhang-ai merged commit 79bfece into main Jul 15, 2026
83 checks passed
@yuhezhang-ai yuhezhang-ai deleted the yuhez/fix/nemotron-h-hf-attention branch July 15, 2026 14:03
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