Skip to content
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

[DT][NFC] Internalize transposeNarrowN logic to LayoutAttrInterface Impl #19453

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hanhanW
Copy link
Contributor

@hanhanW hanhanW commented Dec 11, 2024

Whether applying transposition from narrow-N to narrow-M is backend
implementation details, and we do not need to expose it to the type
converter. The encoding itself has enough information, like indexing
maps, narrow dimensions, etc., to infer the shapes and encoding info.
Instead of updating the RankedTensorType and the attached encoding in
type converter, we can just cook the logic in getEncodingInfo methods.
From the encoding, we know that whether it is narrow-N case, and we can
update the MaterializeEncodingInfo correspondingly. The type converter
can infer the transposed tensor type from it. Thus, we can simplify the
logic in the type conversion.

The documentation of transposeNarrowN is moved to
[CPU|GPU]EncodingExternalModels.cpp because all the implementation
locates at the files.

@hanhanW hanhanW requested review from bjacob and lialan December 11, 2024 07:03
@hanhanW hanhanW marked this pull request as ready for review December 11, 2024 07:03
@hanhanW
Copy link
Contributor Author

hanhanW commented Dec 11, 2024

The PR depends on #19452. It is ready for review.

@bjacob please take a look at my documentation of transposeNarrowN. I moved them [CPU|GPU]EncodingExternalModels.cpp and borrow some words from you. Thanks!

@hanhanW hanhanW force-pushed the data-tiling-cleanups-narrow-n branch from 75e6979 to 00c3e8e Compare December 11, 2024 07:05
@hanhanW hanhanW changed the base branch from users/hanhanW/data-tiling-cleanups-3-upstream-diff to main December 13, 2024 04:45
Whether apply transposion from narrow-N to narrow-M is backend
implementation details, and we do not need to expose it to the type
converter. The encoding itself has enough information, like indexing
maps, narrow dimensions, etc., to infer the shapes and encoding info.
Instead of updating the RankedTensorTypes and the attached encoding in
type converter, we can just cook the logic in `getEncodingInfo` methods.
From the encoding, we know that whether it is narrow-N case, and we can
update the MaterializeEncodingInfo correspondingly. The type converter
can infer the transposed tensor type from it. Thus, we can simplify the
logic in the type conversion.

The documentation of `transposeNarrowN` is moved to
[CPU|GPU]EncodingExternalModels.cpp because all the implementaion
locates at the files.

Signed-off-by: hanhanW <[email protected]>
@hanhanW hanhanW force-pushed the data-tiling-cleanups-narrow-n branch from 00c3e8e to dd92fd3 Compare December 13, 2024 04:46
@hanhanW hanhanW requested review from Max191 and removed request for antiagainst and qedawkins December 13, 2024 04:46
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