Introduce native kernels for NestedTensor elementwise ops (Add/Mul) #2483
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.

UT Failure Analysis
#2412
The current RuntimeError of test_nested_tensor_dense_elementwise_embedding_dim_128_xpu_float16 stems from an upstream dispatcher check that explicitly rejects the required Nested Tensor + Dense Tensor mixed-type signature, preventing our kernel from being called.
Resolution
This PR implements the high-performance op_dense_esuhm XPU kernel, enabling core elementwise binary operations (such as add and mul} for the Nested Tensor broadcasting case on XPU devices. The kernel correctly handles the [B, *, D] op [B, 1, D] geometry.
Next Step
This PR provides the necessary compute infrastructure, and its merger is a critical prerequisite for the subsequent PR pytorch/pytorch#169928 that will fix the dispatcher logic to enable full functionality.