Skip to content

fix slice return type on coord_tensor - #707

Merged
coderfeli merged 7 commits into
ROCm:mainfrom
tingqli:fixslice-coordt
Jun 22, 2026
Merged

coderfeli merged 7 commits into
ROCm:mainfrom
tingqli:fixslice-coordt

Conversation

@tingqli

@tingqli tingqli commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Motivation

Slicing on Coordinate Tensor should change the base of the return type as well, but original implementation didn't change the base, this PR fix it.

Technical Details

Test Plan

Test Result

Submission Checklist

Copilot AI review requested due to automatic review settings June 19, 2026 09:31

Copilot AI 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.

Pull request overview

This PR fixes fly.slice return-type inference for !fly.coord_tensor so that slicing a coordinate tensor with a linear LayoutAttr also updates the tensor’s base (not just its layout), aligning the inferred type with the actual slice offset semantics.

Changes:

  • Update SliceOp::inferReturnTypes to add the computed slice offset into CoordTensorType’s base when slicing a linear LayoutAttr.
  • Keep existing behavior for composed layouts (where the slice offset is represented in the composed layout’s offset).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/Dialect/Fly/IR/FlyOps.cpp

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread tests/unit/test_coord_tensor.py Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@coderfeli
coderfeli merged commit 0d07b39 into ROCm:main Jun 22, 2026
9 checks passed
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.

4 participants