[XPU] Use fused_input_norm kernel in FusedInputNorm - #52945
Merged
jikunshang merged 5 commits intoSep 7, 2026
Merged
Conversation
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>
jikunshang
reviewed
Aug 28, 2026
| dtype=visual_dtype, | ||
| device=grid_thw.device, | ||
| ) | ||
| torch.ops._C.fused_input_norm(out, grid_thw, self.weight, self.bias) |
Member
There was a problem hiding this comment.
I feel we should register in torch.ops.vllm._xpu_fused_input_norm
jikunshang
approved these changes
Sep 7, 2026
Member
|
/ci run |
|
✅ Triggered Buildkite CI #87476 for commit |
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>
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.
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.