已合并
feat(linearize): triton-linearize integrate with master #615
candyhong创建于 2025年10月24日
feat(linearize): triton-linearize integrate with master #615
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 candyhong 的贡献)ascend-robot
2025年10月24日 评论:
2025年10月24日 评论:
以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入
| Module List | Reviewers | Committers |
|---|---|---|
| repo-Ascend/triton-ascend | fengrui886, kang-ingu, shijingchang, zhucehw, kpxing | weizhan4, ccdedreams, wcleungaj, wangtao489, liuzhuheng |


此处折叠了86条消息 查看更多
2025年10月24日 添加了label:approved
wangzhanpeng5
2025年10月24日 评论:
2025年10月24日 评论:
/lgtm


2025年10月24日 添加了label:lgtm
ascend-robot
2025年10月24日 评论:
2025年10月24日 评论:
Review Guide
This Pull-Request Passes Review.
Committers who writed a comment of /approve are: zhang-chunli01.
Reviewers who writed a comment of /lgtm are: zhang-chunli01, wangzhanpeng5.


2025年10月24日 合入了pull request
相关的Issue
原因(目的、解决的问题等)
when there're division and modulo operator in addptr or mask expression, current triton-ascend will regard the correspondig load/store as unstructured , triton-to-unstructured pass will turn the unstructured dimensions to several levels of loops and perform scalar data movement . That is functional solution and the performence is not good . Triton-linerize pass will analyze addptr or mask expression with division/modulo operator and turn them into structured representation and the load/store could be executed as normal NDA instruction to guarantee the performence . TritonLinearize work as memory optimization solution described in the below diagram .

描述(做了什么,变更了什么)
linearize
rewrite AddPtr, rewriteMask, RewriteLoad - kaixin, done
UT - kaixin done, but just simpler one, need add more cases . - baiqing
rewriteStoreOp -kaixin done
rewriteAtomic -yihan
use I64 as index, instead of I32 -yiming
随路转置 -ziqi
rewrite Loop - Kaixin, done partially, while not added ? jiangzhen
error handling and PR to main stream -kaixin done partially, there're other cases
fallback indirect addptr - kaixin done
fallback ptr loop - kaixin done
fallback indirect mask - xuejie
fallback undivisble offset -kaixin, done
optimize mask generation to avoid selectOp -jiangzheng
handle dynamic stride
axis split : 16 -> 8 * 2, handle axis cat : 16 -> 10 + 6 ?
测试用例(新增、改动、可能影响的功能)
test_linearize.py
局限性
(2 + tl.arange(0,4) ) % 4
offset = s * block_size
(offset + tl.arange(0, block_size) ) // M * S1 + (offset + tl.arange(0, block_size) ) % M * S2