Repository navigation
[KMCompiler][Ascend] 新增 TritonToLinalgGeneric 硬件无关共享库 - #93
Open
zhongsanming wants to merge 8 commits into
Open
zhongsanming wants to merge 8 commits into
zhongsanming wants to merge 8 commits into
Conversation
zhongsanming
commented
Nov 26, 2026
Contributor
- 将 Ascend 后端中硬件无关的 Triton→Linalg 实现抽取到 FLIR 共享库 TritonToLinalgGeneric。
- 包含:通用 elementwise/structural Op 转换、ProgramId/NumPrograms、ArgMin/ArgMax、UseAnalysis、HoistBroadcast、DevicePrintOffsetRewrite、DebugUtils。
- UseAnalysis 通过 hook 接口支持后端专属 Op/属性(operand use、meta user、indirect 边界、后处理),不依赖 Ascend/HIVM。
- 新增 TRITON_TO_LINALG_GENERIC_SKIP_OPS 选项,允许后端跳过 GenericOpConverter,避免与自有同名 pattern 冲突。
- 纯新增/重构,无行为变更;由对应 FlagTree PR 接入。
Introduce TritonToLinalgGeneric with the first self-contained set of hardware-independent patterns (precise-div, dense constant, clampf, join/split/cat, mulhiui, precise-sqrt) for the Ascend lowering to consume.
Move make-range, splat, reshape, expand-dims, broadcast, transpose and bitcast patterns into TritonToLinalgGeneric, with generic utilities and a backend-installable debug-NOP hook.
Add the generic program-id/num-programs lowering and argmin/argmax converters to TritonToLinalgGeneric, together with the generic ReduceWithIndex helpers in GenericUtils.
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.