[AscendNPU-IR] Support the gather operator in Dev mode, and add test cases for the gather and not operators.#745
Open
lzp1021 wants to merge 6 commits intotile-ai:npuirfrom
Open
[AscendNPU-IR] Support the gather operator in Dev mode, and add test cases for the gather and not operators.#745lzp1021 wants to merge 6 commits intotile-ai:npuirfrom
lzp1021 wants to merge 6 commits intotile-ai:npuirfrom
Conversation
…cases for the gather and not operators.
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
CeleNewYear
requested changes
Apr 1, 2026
| Value dst = GenSubviewFromRegion(npuirop.dst, npuirop.dst_range); | ||
| Value indices = GenSubviewFromRegion(npuirop.indices, npuirop.indices_range); | ||
| Value src = GenExtractSliceFromRegion(npuirop.src, npuirop.src_range); | ||
| Value dst = GenExtractSliceFromRegion(npuirop.dst, npuirop.dst_range); |
Collaborator
There was a problem hiding this comment.
Not the right way. We don't use GenExtractSliceFromRegion for dst, but insert slice
| src, indices, dst); | ||
| auto gatherOp = builder.create<mlir::hivm::VGatherOp>( | ||
| builder.getUnknownLoc(), result_tensors, src, indices, dst); | ||
| SetVarValue(npuirop.dst, gatherOp->getResult(0)); |
Collaborator
There was a problem hiding this comment.
There is a if to find out if we need insert or not
…cases for the gather and not operators.
CeleNewYear
requested changes
Apr 2, 2026
Comment on lines
+38
to
+39
| A_VEC[:block_M, :block_N], | ||
| C_VEC[:block_M, :block_N], |
Collaborator
There was a problem hiding this comment.
- now don't use npuir_gather
- This is not a full test 1) dynamic shape tile; 2) don't use all the shape (here :blockM = blockM)
…cases for the gather and not operators.
CeleNewYear
reviewed
Apr 2, 2026
| C_VEC = T.alloc_shared([block_M, block_N], dtype) | ||
| T.copy(A[bx : bx + block_M, by : by + block_N], A_VEC) | ||
| T.copy(B[bx : bx + block_M, by : by + block_N], B_VEC) | ||
| T.gather(A_VEC, C_VEC, B_VEC) |
Collaborator
There was a problem hiding this comment.
Will not test slice support of gather
…cases for the gather and not operators.
…cases for the gather and not operators.
…cases for the gather and not operators.
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.
Support the gather operator in Dev mode, and add test cases for the gather and not operators.