[WebGPU EP] Support int64 for Tile and Concat - #31049
Merged
Hariharan Seshadri (hariharans29) merged 21 commits intoAug 4, 2026
Merged
[WebGPU EP] Support int64 for Tile and Concat#31049Hariharan Seshadri (hariharans29) merged 21 commits into
Hariharan Seshadri (hariharans29) merged 21 commits into
Conversation
- Replace ONNX_OPERATOR macro registrations with CreateTileVersionedKernelInfo/ CreateTileKernelInfo factory functions gated by enable_int64 (mirrors Reshape, Expand, Sub, etc.) - Update TileProgram to carry an is_int64_ flag; when true, GenerateShaderCode copies the raw vec2<u32> storage via IndicesToOffset + SetByOffset(use_storage_type) to preserve all 64 bits instead of sign-extending from i32 - Register Tile kernels via RegisterKernels() with the enable_int64 flag - Include tile.h in webgpu_execution_provider.cc; remove old BuildKernelCreateInfo entries for Tile from the static table - Add TileInt64TypeWebGpu test using values with non-zero high 32 bits
For segmented get_*_by_offset, Boolx4 now unpacks the u32 storage word into vec4<bool> using the same bit-mask pattern as GetByOffsetImpl, instead of returning the raw u32 as the declared vec4<bool> return type. For segmented set_*_by_offset, Boolx4 now packs vec4<bool> into u32 using dot(vec4<u32>(0x1,...), vec4<u32>(value)), matching SetByOffsetImpl, instead of assigning a vec4<bool> directly to a u32 storage slot.
…64-support-tile-op WebGPU: fix segmented int64/uint64 accessor typing and add segmented storage setter path
Mirror the Int64 case: when use_storage_type=true, write the value directly (caller provides vec2<u32>); when false (default), zero-extend u32 to vec2<u32> as before. Fixes latent WGSL type error if a caller ever does a storage-typed round-trip on a Uint64 variable.
…64-support-tile-op-again WebGPU: Fix Uint64 non-segmented SetByOffsetImpl to honor use_storage_type
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…64-support-tile-op-another-one WebGPU Tile int64: prevent CPU EP fallback in test, fix GetByOffset doc comment
…64-support-tile-op-yet-again WebGPU EP: Add int64 support for Tile operator
Adds int64 to the WebGPU `Concat` type constraint so int64 Concat nodes stop falling back to the CPU EP. Concat registration is migrated from static macro registration to the `enable_int64` factory-registration pattern already used by Reshape/Expand/Add, and int64 WebGPU test coverage is added.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Author
40 tasks
Member
|
Thanks - will review this once the Tile changes are merged in here. |
Co-authored-by: huningxin <ningxin.hu@intel.com>
Updates the WebGPU Concat kernel to copy int64/uint64 elements using the raw vec2<u32> storage word instead of the truncating i32 value type, preserving the full 64-bit value. The Concat shader gains an is_int64 branch that converts the output indices to an offset and uses the storage-type GetByOffset/SetByOffset accessors (use_storage_type=true). The int64 test now concatenates values outside the int32 range (2^32, 2^33+1, a large negative, INT64_MAX) to prove the value is preserved rather than truncated.
Contributor
Author
Tile changes have been merged here and the latest commit makes int64 Concat lossless via raw vec2 copy (similar to Tile). PTAL, thanks. |
Hariharan Seshadri (hariharans29)
enabled auto-merge (squash)
July 30, 2026 08:34
Hariharan Seshadri (hariharans29)
previously approved these changes
Jul 30, 2026
auto-merge was automatically disabled
July 31, 2026 05:17
Head branch was pushed to by a user without write access
Contributor
Author
|
Fixed clang-format trailing comment alignment. Hariharan Seshadri (@hariharans29) Please take another look, thanks a lot! |
The segmented get/set-by-offset accessor codegen built sub-expressions with MakeStringWithClassicLocale(), which uses the heavier std::ostringstream, inside functions that otherwise use the lightweight FastOStringStream (via the SS/SS_APPEND macros).
Contributor
Author
|
Updated the PR to address the comments. Hariharan Seshadri (@hariharans29) Edward Chen (@edgchen1) Please take another look, thanks a lot! |
Edward Chen (edgchen1)
approved these changes
Aug 3, 2026
Hariharan Seshadri (hariharans29)
merged commit Aug 4, 2026
f6d5554
into
microsoft:main
86 checks passed
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.
Description
Motivation and Context
The WebGPU Tile and Concat kernels were registered with WebGpuSupportedNumberTypes() (float/fp16/int32/uint32 only), causing int64 tensors to fall back to CPU. Beyond the missing type constraint, the WGSL getter for Int64 variables returns only the low 32 bits (i32(buf[offset].x)), and the default setter sign-extends from that i32 — silently corrupting any value with non-zero high bits. Since Tile and Concat are pure data-movement with no arithmetic on element values, int64 is safe to support by treating each element as an opaque vec2 copy.