Skip to content

[Bug Fix] Fix vllm fused_add_rms_norm 6-arg crash on non-AITER path - #1

Open
xiaohong42 wants to merge 1 commit into
mainfrom
fix/vllm-fused-add-rms-norm-4arg
Open

[Bug Fix] Fix vllm fused_add_rms_norm 6-arg crash on non-AITER path#1
xiaohong42 wants to merge 1 commit into
mainfrom
fix/vllm-fused-add-rms-norm-4arg

Conversation

@xiaohong42

@xiaohong42 xiaohong42 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Motivation

When running SGLang on ROCm with SGLANG_USE_AITER=0, the vllm fallback path for fused_add_rms_norm crashes with:

TypeError: fused_add_rms_norm() takes 4 positional arguments but 6 were given

This is because the current code calls fused_add_rms_norm with 6 arguments (matching aiter's rmsnorm2d_fwd_with_add signature), but vllm's fused_add_rms_norm uses a 4-arg in-place API: fused_add_rms_norm(input, residual, weight, eps).

Modifications

  • RMSNorm.forward_hip: Changed fused_add_rms_norm from 6-arg call to vllm's 4-arg in-place API. Removed unnecessary torch.empty_like allocations for out and residual_out.
  • GemmaRMSNorm.forward_hip: Same fix as above.
  • Added 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_like allocations, which should be neutral or slightly beneficial.

Checklist

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
xiaohong42 force-pushed the fix/vllm-fused-add-rms-norm-4arg branch from f1baee3 to c03954a Compare July 22, 2026 07:06
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.

1 participant