Skip to content

[Flow] Support dispatch tracing when encodings are present - #20447

Merged
Max191 merged 5 commits into
iree-org:mainfrom
Max191-agents:trace-encoded-tensors
Apr 3, 2025
Merged

Max191 merged 5 commits into
iree-org:mainfrom
Max191-agents:trace-encoded-tensors

Conversation

@Max191

@Max191 Max191 commented Apr 2, 2025

Copy link
Copy Markdown
Contributor

Enables dispatch tracing when the dispatch op has encoded operands or results. New flow.tensor.encode ops are inserted to bring the tensor back to the row-major layout before adding the tracing ops because the flow.tensor.trace op cannot handle encoded tensors. The tensor is not printed in the encoded layout with this revision, but it still adds helpful debug information, and prevents compilation failures when adding dispatch tracing.

@hanhanW hanhanW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see what you're trying to do, and I agree that it helps debugging. I did some investigation and I feel the direction should be #20450

Assigning to me now and I'll revisit later. This is fine to go for now.

(I considered the other approach, which moves the injection to Stream, then we lose the needs of flow.tensor.trace. We might still need the op because it allows users to inject tracing ops when they want.)

@Max191

Max191 commented Apr 3, 2025

Copy link
Copy Markdown
Contributor Author

I see what you're trying to do, and I agree that it helps debugging. I did some investigation and I feel the direction should be #20450

Cool, thanks for taking such a detailed look! I started out trying to get the encoded tensors to print, but I gave up around the specialization phase because the op was missing some interface implementations and I didn't know what to do. Would definitely be much better to be able to print the full encoded tensor.

@Max191
Max191 requested a review from hanhanW April 3, 2025 16:22
Max191 added 2 commits April 3, 2025 12:57
Signed-off-by: Max Dawkins <[email protected]>
Signed-off-by: Max Dawkins <[email protected]>
@Max191
Max191 requested a review from hanhanW April 3, 2025 18:01

@hanhanW hanhanW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@Max191
Max191 enabled auto-merge (squash) April 3, 2025 18:33
@Max191
Max191 merged commit b8fda86 into iree-org:main Apr 3, 2025
bangtianliu pushed a commit to bangtianliu/iree that referenced this pull request Apr 8, 2025
…20447)

Enables dispatch tracing when the dispatch op has encoded operands or
results. New `flow.tensor.encode` ops are inserted to bring the tensor
back to the row-major layout before adding the tracing ops because the
`flow.tensor.trace` op cannot handle encoded tensors. The tensor is not
printed in the encoded layout with this revision, but it still adds
helpful debug information, and prevents compilation failures when adding
dispatch tracing.

---------

Signed-off-by: Max Dawkins <[email protected]>
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
Enables dispatch tracing when the dispatch op has encoded operands or
results. New `flow.tensor.encode` ops are inserted to bring the tensor
back to the row-major layout before adding the tracing ops because the
`flow.tensor.trace` op cannot handle encoded tensors. The tensor is not
printed in the encoded layout with this revision, but it still adds
helpful debug information, and prevents compilation failures when adding
dispatch tracing.

---------

Signed-off-by: Max Dawkins <[email protected]>
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