Add TGATHER indices and mask - #1080
Open
frank-deng wants to merge 1 commit into
Open
Conversation
frank-deng
force-pushed
the
tgather2
branch
6 times, most recently
from
August 4, 2026 01:14
f55aae7 to
4e14e8a
Compare
Zhendong404
requested changes
Aug 4, 2026
| for row in range(0, valid_rows, 1): | ||
| remained = valid_cols | ||
| for col in range(0, valid_cols, lanes): | ||
| indices_reg = pto.vlds(indices[row, col:]) |
Collaborator
There was a problem hiding this comment.
这里按照dst.valid_shape迭代indices,如果dst.valid_shape > indices.valid_shape会在运行时出错,需要加一个约束或断言dst.valid_shape必须小于等于indices.valid_shape
|
|
||
|
|
||
| def _init_ub_buffer(dst: pto.Tile): | ||
| dtype = dst.dtype |
Collaborator
There was a problem hiding this comment.
这里的清零我感觉有性能优化空间,后面真正的tgather写的位置其实都不需要清零。如果C++ TileLib也是这么实现的那就保持现状吧。
| } | ||
|
|
||
| // CHECK: TGATHER | ||
| // CHECK: TGATHER |
Collaborator
There was a problem hiding this comment.
这里的check太简单了,没有检查是否有tmp参数
| context_attrs=context_attrs or {}, | ||
| **tile_specs, | ||
| ).mlir_text() | ||
| return result |
Comment on lines
+7033
to
+7039
| Type offsetElementType = elementType; | ||
| if (auto ptrType = dyn_cast<pto::PtrType>(op.getDestination().getType())) | ||
| offsetElementType = ptrType.getElementType(); | ||
| else if (auto memrefType = dyn_cast<BaseMemRefType>(op.getDestination().getType())) | ||
| offsetElementType = memrefType.getElementType(); | ||
| auto offsetBytes = | ||
| convertElementOffsetToBytes(op, adaptor.getOffset(), elementType); | ||
| convertElementOffsetToBytes(op, adaptor.getOffset(), offsetElementType); |
Collaborator
There was a problem hiding this comment.
这个bugfix应该拆成独立的commit并加上lit用例看护
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.