add mov op#453
Open
kangjiaming1 wants to merge 13 commits into
Open
Conversation
Zhendong404
requested changes
May 29, 2026
| # Calculate burst parameters | ||
| # For bias: len_burst = ceil(N * sizeof(dtype) / 32) | ||
| # For simplicity, use single burst for aligned cases | ||
| pto.bias_load(src.as_ptr(), dst.as_ptr(), n) |
Collaborator
There was a problem hiding this comment.
请参考这个表使用新接口名:
_LEGACY_CUBE_ALIAS_CANONICAL = {
"cube_load": "mte_gm_l1",
"cube_store": "mte_l1_ub",
"cube_load_frac": "mte_gm_l1_frac",
"bias_load": "mte_l1_bt",
"left_load": "mte_l1_l0a",
"right_load": "mte_l1_l0b",
"left_load_mx": "mte_l1_l0a_mx",
"right_load_mx": "mte_l1_l0b_mx",
"acc_store": "mte_l0c_l1",
"acc_store_gm": "mte_l0c_gm",
"acc_store_ub": "mte_l0c_ub",
}|
|
||
| @pto.ckernel( | ||
| target="a5", | ||
| op="pto.tmov2left", |
Collaborator
There was a problem hiding this comment.
没有pto.tmov2left这个OP, 只有tmov, 你需要根据输入输出tile的location给这个tempalte加上constraint, 来实现dst是left tile时,让当前版本生效
| self._render_cube_fb_load(expr, env, indent=indent, into=into) | ||
| return _RenderedValue(name="__void_call__", type=SemanticMetaType(kind="void")) | ||
|
|
||
| if expr.name in {"left_load", "right_load", "left_load_mx", "right_load_mx"}: |
Collaborator
There was a problem hiding this comment.
这些都是旧OP命名,新命名已经全量支持了,不用改这里
| # FP4 types: lowercase names match Python variable names in types.py | ||
| # (used for getattr lookup); actual ScalarType.name is uppercase for MLIR | ||
| "f4e1m2x2", | ||
| "f4e2m1x2", |
Collaborator
There was a problem hiding this comment.
低精度类型在VPTO后端还没支持,先不用实现,提个issue记录下
| %bt_n_burst = arith.constant 1 : i64 | ||
| %bt_src_gap = arith.constant 0 : i64 | ||
| %bt_dst_gap = arith.constant 0 : i64 | ||
| pto.mte_l1_bt %l1_bias, %bias_addr, %bt_len_burst nburst(%bt_n_burst, %bt_src_gap, %bt_dst_gap) |
Collaborator
There was a problem hiding this comment.
这个是无效测例,你直接用了微指令实现了tmov的功能,没有测试到expand-tileop这条路径,也就是说你写的template根本不会在这里展开
added 2 commits
June 1, 2026 15:19
ac357cd to
a72fd6e
Compare
Zhendong404
requested changes
Jun 2, 2026
| %fb_n_burst = arith.constant 2 : i64 | ||
| %fb_src_gap = arith.constant 0 : i64 | ||
| %fb_dst_gap = arith.constant 0 : i64 | ||
| pto.mte_l1_fb %l1_scale, %scale_addr, %fb_len_burst nburst(%fb_n_burst, %fb_src_gap, %fb_dst_gap) |
| pto.wait_flag["PIPE_M", "PIPE_FIX", "EVENT_ID1"] | ||
|
|
||
| // TSTORE: Acc -> GM | ||
| pto.mte_l0c_gm %l0c, %c_gm, %c16_i64, %c16_i64, %c16_i64, %c16_i64, %c0_i64, %c0_i64, |
Collaborator
There was a problem hiding this comment.
这里还是store的tmatmul的结果,bias_tile没有被输出校验,其他case也需要排查
| The tmov.fp operation performs fixpipe quantization. | ||
| """ | ||
| # The tmov.fp op takes src (Acc), fp (scaling), and dst (Mat) | ||
| pto.tmov_fp(src.as_ptr(), scale.as_ptr(), dst.as_ptr()) |
added 4 commits
June 3, 2026 19:18
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.
add mov op