Skip to content

[Flow]Relaxes the assertion to accept non-negative operands in saturatingMul ofAnnotateDispatches . - #24947

Open
liuyalong wants to merge 1 commit into
iree-org:mainfrom
liuyalong:users/yalong/saturating-mul-zero-extent
Open

liuyalong wants to merge 1 commit into
iree-org:mainfrom
liuyalong:users/yalong/saturating-mul-zero-extent

Conversation

@liuyalong

@liuyalong liuyalong commented Sep 20, 2026

Copy link
Copy Markdown

[Flow] saturatingMul in AnnotateDispatches asserts its operands are strictly positive (lhs > 0 && rhs > 0), which crashes the compiler on 0-extent dimensions (e.g. empty-set reductions with input shape 2x0x4). Multiplying by 0 is well-defined; nothing should crash just because a dimension is 0.

This relaxes the assertion to accept non-negative operands and short-circuits to 0.

This is a small, self-contained robustness fix. It is the first of a series of 0-extent assertion issues surfaced by the ONNX empty-set reduction cases; a follow-up will address the root cause within IREE (removing the 0-extent reduction before codegen).

Related to #24378

@github-actions

Copy link
Copy Markdown

Hello @liuyalong 👋

Thank you for submitting a Pull Request to IREE! It looks like this is your first one. We have one ask, and you can also find some general tips below.


Action required: acknowledge IREE project policies

IREE is a Linux Foundation project. All participants are expected to follow the LF Projects Code of Conduct.

All contributions to IREE must follow our IREE AI Tool Use Policy. In particular:

  • Contributors must fully understand, and vouch for, all submitted changes and the intent behind them.
  • Substantial use of LLM/generative AI tools must be noted in the PR description, e.g. via Assisted-by: tool-name or Co-authored-by: tool-name tool@email trailers.
  • Contributors must write PR descriptions themselves. There must always be a human in the loop: contributors must respond to reviews and questions by themselves.
    If a response includes LLM-assisted segments (e.g. reproducers, LLM agent analysis excerpts), the segment should be clearly marked as "assisted", same as for PR contents.
  • GitHub issues labeled as "Good first issue" are explicitly designated as learning opportunities for newcomers to the project. With exceptions for boilerplate edits, AI tool usage for resolutions to such issues is forbidden.

We kindly ask you to reply to this message and confirm that you understand and accept the cited policies, particularly the AI Tool Use Policy.


General guidance

Our general Contributing guide contains information and links to detailed guides on code quality, testing, commit summaries and our CI system.

A common point for new PRs: if a DCO signing check fails for you, check out the section on Developer Certificate of Origin.
In these cases, it should suffice to amend your commit signature(s) per the guide and force-push the PR branch.

If you have any questions, feel free to leave a comment here, or ask away on IREE Discord.

Thank you,
The IREE Community

@liuyalong liuyalong changed the title [Flow]Relaxes the assertion to accept non-negative operands in saturatingMul ofAnnotateDispatches . #24378 [Flow]Relaxes the assertion to accept non-negative operands in saturatingMul ofAnnotateDispatches . Sep 20, 2026
…e strictly

positive (`lhs > 0 && rhs > 0`), which crashes the compiler on 0-extent
dimensions (e.g. empty-set reductions with input shape `2x0x4`). Multiplying
by `0` is well-defined; nothing should crash just because a dimension is `0`.

This relaxes the assertion to accept non-negative operands and short-circuits
to `0`.

This is a small, self-contained robustness fix. It is the first of a series of
0-extent assertion issues surfaced by the ONNX empty-set reduction cases; a
follow-up will address the root cause within IREE (removing the 0-extent
reduction before codegen).

Related to iree-org#24378

Assisted-by: AI Tools
Signed-off-by: Yalong <liuyalong.email@foxmail.com>

This branch has not been deployed

No deployments
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.

1 participant