Skip to content

[XPU] Use fused_input_norm kernel in FusedInputNorm - #52945

Merged
jikunshang merged 5 commits into
vllm-project:mainfrom
zufangzhu:feat/xpu-fused-input-norm
Sep 7, 2026
Merged

jikunshang merged 5 commits into
vllm-project:mainfrom
zufangzhu:feat/xpu-fused-input-norm

Conversation

@zufangzhu

Copy link
Copy Markdown
Contributor

On XPU, dispatch FusedInputNorm.forward to the fused_input_norm custom kernel (torch.ops._C.fused_input_norm) when the input is uint8 and the affine weight/bias are fp32. The eager path materializes an fp32 intermediate and casts back, adding device-side compute that cancels the bandwidth saving of transferring uint8 pixel_values on XPU. The fused kernel reads uint8 directly and writes the visual dtype in a single pass, and is numerically identical to the broadcasted multiply-add fallback that is kept for all other cases.

Requires the fused_input_norm op from vllm-xpu-kernels.

On XPU, dispatch FusedInputNorm.forward to the fused_input_norm custom
kernel (torch.ops._C.fused_input_norm) when the input is uint8 and the
affine weight/bias are fp32. The eager path materializes an fp32
intermediate and casts back, adding device-side compute that cancels
the bandwidth saving of transferring uint8 pixel_values on XPU. The
fused kernel reads uint8 directly and writes the visual dtype in a
single pass, and is numerically identical to the broadcasted
multiply-add fallback that is kept for all other cases.

Requires the fused_input_norm op from vllm-xpu-kernels.

Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>

@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.

@mergify mergify Bot added the intel-gpu Related to Intel GPU label Aug 19, 2026
Comment thread vllm/model_executor/models/vision.py Outdated
dtype=visual_dtype,
device=grid_thw.device,
)
torch.ops._C.fused_input_norm(out, grid_thw, self.weight, self.bias)

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.

I feel we should register in torch.ops.vllm._xpu_fused_input_norm

zufangzhu and others added 4 commits August 28, 2026 07:45
Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
@jikunshang

Copy link
Copy Markdown
Member

/ci run

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87476 for commit 3ebaaf062dc2.

@jikunshang
jikunshang merged commit ed29dfa into vllm-project:main Sep 7, 2026
93 checks passed
ItsRoy69 pushed a commit to ItsRoy69/vllm that referenced this pull request Sep 10, 2026
Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
Signed-off-by: Jyotirmoy Roy <jyotirmoyroy649@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

intel-gpu Related to Intel GPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants