fix(vpto): preserve MXFP4 load offsets and scale strides - #1055
Open
erhsh wants to merge 1 commit into
Open
Conversation
- preserve packed FP4 kStart during L1-to-L0 expansion - support explicit source and destination strides for MX scale loads - expose optional stride controls through PTODSL - add DSL and VPTO expansion regression tests
erhsh
marked this pull request as ready for review
July 30, 2026 06:21
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.
概要
kStart问题背景
packed-FP4 的 L1 到 L0 展开逻辑此前会同时换算
kStep和kStart。因此,用户指定的start_col = 4最终会被错误生成为原始指令中的kStart = 2,导致相邻 K 子块的数据范围发生重叠。MX scale wrapper 指令此前只能根据逻辑 tile shape 推导源端和目标端 stride,无法表达某些合法布局。例如,需要
src_stride = 8、dst_stride = 4的布局会被静默生成为4/4。这两类问题都可能正常编译,但在运行时读取错误的数据或 scale 元数据,进而产生静默数值错误。
修改内容
kStart的原始语义,仅对 packed-FP4 的kStep进行宽度换算mte_l1_l0a_mx和mte_l1_l0b_mx增加可选的src_stride、dst_stride参数未提供 stride 覆盖参数的现有调用行为保持不变。
影响范围
本次修改仅修正 packed-FP4 load 控制参数,并增强 MX scale load 对不同内存布局的表达能力。默认参数和已有调用接口保持兼容,不会改变未使用新参数的代码生成结果。
验证情况
python ptodsl/tests/test_jit_compile.py通过kStart已验证生成为48/4git diff --check通过相关工作
#1047 处理的是 MX scale 目标地址编码问题,与本 PR 修复的 load 控制参数问题相互独立。本分支不包含 #1047 的修改。
fix: #1060