[Bug Fix] Fix vllm fused_add_rms_norm 6-arg crash on non-AITER path - #1
Open
xiaohong42 wants to merge 1 commit into
Open
[Bug Fix] Fix vllm fused_add_rms_norm 6-arg crash on non-AITER path#1xiaohong42 wants to merge 1 commit into
xiaohong42 wants to merge 1 commit into
Conversation
vllm's fused_add_rms_norm uses a 4-arg in-place API: fused_add_rms_norm(input, residual, weight, eps) where input becomes the normalized output and residual becomes input+residual. The previous code used a 6-arg call that matched aiter's signature, which crashed on the vllm path (SGLANG_USE_AITER=0) with: "takes 4 positional arguments but 6 were given" This fix applies to both RMSNorm and GemmaRMSNorm classes. Co-authored-by: Cursor <cursoragent@cursor.com>
xiaohong42
force-pushed
the
fix/vllm-fused-add-rms-norm-4arg
branch
from
July 22, 2026 07:06
f1baee3 to
c03954a
Compare
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.
Motivation
When running SGLang on ROCm with
SGLANG_USE_AITER=0, the vllm fallback path forfused_add_rms_normcrashes with:This is because the current code calls
fused_add_rms_normwith 6 arguments (matching aiter'srmsnorm2d_fwd_with_addsignature), but vllm'sfused_add_rms_normuses a 4-arg in-place API:fused_add_rms_norm(input, residual, weight, eps).Modifications
RMSNorm.forward_hip: Changedfused_add_rms_normfrom 6-arg call to vllm's 4-arg in-place API. Removed unnecessarytorch.empty_likeallocations foroutandresidual_out.GemmaRMSNorm.forward_hip: Same fix as above.residual = residual.contiguous()before the in-place call to ensure the tensor is contiguous.Accuracy Tests
N/A - This is a bug fix that makes the vllm fallback path callable. The aiter path (
SGLANG_USE_AITER=1) is unaffected.Speed Tests and Profiling
N/A - No performance-sensitive logic changed. The fix removes two
torch.empty_likeallocations, which should be neutral or slightly beneficial.Checklist