Repository navigation
Conversation
…-op norm The prefill route added in 011a8ce calls RMSNormGated.forward_cuda directly for num_tokens > 64. That is only valid behind an opaque op boundary: when the output projection is traced (output_projection policy unset, the default), Dynamo reaches the FLA input guard's torch.accelerator.device_index, which is on its skip list, and engine startup fails during the profile run. Take the direct Triton norm only outside Dynamo tracing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ly7LM3m9fa6DRJPYQjnt95 Signed-off-by: Peuqui <43776522+Peuqui@users.noreply.github.com>
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.
Purpose
011a8ce (#1203) routes the gated RMSNorm of the Qwen GDN output projection to
RMSNormGated.forward_cudafor every prefill with more than 64 tokens. The comment there says this is meant for the path behind the opaque Qwen GDN op. When the projection is not behind an opaque boundary, Dynamo traces this branch while compiling, reaches the FLA input guard'storch.accelerator.device_index(...)in vllm/model_executor/layers/fla/ops/utils.py, which is on its skip list, and engine startup fails during the profile run (traceback abridged):Both opaque boundaries are off there by default:
VLLM_SM70_QWEN_GDN_OUTPUT_PROJECTION_OPis a diagnostic switch that defaults to 0, and the automatic full-forward wrapper is armed only for compiled MTP engines on Volta (auto_sm70_qwen_gdn_full_forward and _sm70_current_device_is_volta()). We hit it with Qwen3.8-Flash-Next-180B NVFP4 + MTP in PP4, where pipeline stage 0 runs on a Quadro RTX 8000: that worker failed with the traceback above on main 6f3557c.This PR takes the direct Triton norm only outside Dynamo tracing (
not torch.compiler.is_compiling() and num_tokens > 64). A traced projection keepsself.norm(...), as before 011a8ce; eager and opaque callers still take the direct route. The DFlash2 fused-norm condition is unchanged.is_compiling()is checked first, so tracing does not add a guard onnum_tokens.Not a duplicate: gh pr list --state all --search "device_index", "RMSNormGated", "is_compiling", "gdn norm", "Dynamo", "output projection" finds no PR touching this condition, and the open #1204 to #1211 do not change it.
AI assistance was used for this change. I reviewed every line and ran the tests and measurements below.
Test Plan
The new test builds a minimal GDN layer, runs the output projection eagerly for 128 tokens (expects one direct
forward_cudacall) and then undertorch.compile(fullgraph=True, backend="eager")(expects no direct call and the same result within 2e-3).Serving on our fork (main 6f3557c plus our fork's commits and this change): Qwen3.8-Flash-Next-180B NVFP4 + MTP in PP4 (2x Quadro RTX 8000 + 2x Tesla V100) and TP2xPP2, Qwen3.8-27B NVFP4 TP2, each one cold boot plus two boots alternating with our previous build; greedy and quality prompts compared by hand.
Path coverage
self.norm(...)as before 011a8ceRMSNormGated.forward_cuda, unchangedenable_sm70_dflash2_fused_gdn_normforward_cuda, unchangedTest Result
torch._dynamo.exc.Unsupported(the same error as the engine startup).🤖 Generated with Claude Code
https://claude.ai/code/session_01Ly7LM3m9fa6DRJPYQjnt95