Skip to content

Add int32 support for CPU Trilu#29476

Open
the0cp wants to merge 1 commit into
microsoft:mainfrom
the0cp:trilu-int32
Open

Add int32 support for CPU Trilu#29476
the0cp wants to merge 1 commit into
microsoft:mainfrom
the0cp:trilu-int32

Conversation

@the0cp

@the0cp the0cp commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Add INT32 input support for the CPU implementation of ONNX Trilu.

The ONNX Trilu schema allows tensor(int32), and CUDA EP already supports it, but CPU EP currently does not register an INT32 kernel and fails during session creation with NOT_IMPLEMENTED.

  • adds int32_t to the CPU ONNX Trilu(14) kernel registration
  • dispatches by tensor element type instead of element size
  • adds INT32 upper/lower tests
  • updates the CPU operator kernel documentation

Motivation and Context

The CPU Trilu implementation previously dispatched based on element size. That works only as long as each supported element size maps to a single supported logical type. Adding INT32 would otherwise make it share the float path because both are 4-byte types.

The old size-based dispatch is ambiguous for types with the same element size, such as float/int32 and double/int64. This PR switches dispatch to the actual ONNX tensor element type so each registered type maps to the matching TriluImpl<T> specialization.

Fixes #21400.

@the0cp

the0cp commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @skottmckay, sorry for the gentle ping, would you be the right person to review this?

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.

Trilu op still not work with INT32 input

1 participant