这是indexloc提供的服务,不要输入任何密码
Skip to content

[Util] Implement InferIntRangeInterface for OptimizationBarrierOp. #21501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hanhanW
Copy link
Contributor

@hanhanW hanhanW commented Jul 25, 2025

The issue is identified from #21359 that the existing test does not reproduce the same issue. The reason is that the hal.buffer_view.dim op implements the interface while the util.optimization_barrier op does not implement the interface.

The revision implements the interface for integer and index types, so we can have consistent behavior between using IREE Check framework and user's input programs.

Signed-off-by: hanhanW hanhan0912@gmail.com

hanhanW added 2 commits July 25, 2025 14:39
In softmax dispatch, there are two reduction ops. Only the root op is
tiled for reduction dimensions when we switched to
LLVMCPUTileRootAndFuseInputOperandsPass. It results in large vector
sizes in the other reduction op when `util.assume.hint` ops are present.

We did not hit the issue in e2e tests because
AnnotateDispatchAssumptions pass behaves differently. The value range is
[0, 0] if the input is from `flow.tensor.dynamic_constant`.

Fixes iree-org#21359

Signed-off-by: hanhanW <hanhan0912@gmail.com>
The issue is identified from
iree-org#21359 that the existing test
does not reproduce the same issue. The reason is that the
`hal.buffer_view.dim` op implements the interface while the
`util.optimization_barrier` op does not implement the interface.

The revision implements the interface for integrer and index types, so
we can have consistent behavior between using IREE Check framework and
user's input programs.

Signed-off-by: hanhanW <hanhan0912@gmail.com>
Copy link
Collaborator

@benvanik benvanik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't do this with this op - the entire purpose of the op is to stop optimizations, and int range analysis is one of them. If tests are not representative of real user programs we should make them more representative via other mechanisms - optimization_barrier has a very specific purpose.

@benvanik
Copy link
Collaborator

(e.g., reshape to the known shape after the optimization barrier so that the shape is knowable but the contents of the source tensor aren't, etc)

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.

2 participants