Closed
[Bug-Report|缺陷反馈]: fillpad layout不一致导致精度问题 #3387
bynshardAdd on Sep 18Closed at Sep 22
Sep 18 Associated pull request
Jie Yin
Sep 19 Comments:
Sep 19 Comments:
已关联PR


Sep 19 Assign bynshard as responsible person
Sep 19 Added label: Operations
Sep 20 Associated pull request
Sep 20 Associated pull request
Sep 20 Associated pull request
Sep 22 changed custom state from 进行中 to 已完成
Sep 22 Close issue
Sep 22 Added label: resolved
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
在 Ascend950DT 上运行 PyPTO 混合算子用例时,FillPad 对共享 UB 缓冲区中的列分块处理错误,导致有效数据被清零,并可能越过目标缓冲区边界。
该用例中,concat 结果的形状为 [16,128],vector tile 配置为 [16,80],因此 FillPad 被拆分为前 80 列和后 48 列两个分块。两个分块保留父缓冲区的物理行步长 128。
原 TFillPad 封装直接使用 layout 中的静态宽度 128 构造 PTO Tile。底层 TFILLPAD_EXPAND 会将输入有效列之外的区域补到该静态宽度,而不是限制在当前分块的 80/48 列范围内。因此:
Environment / 环境信息 (Mandatory / 必填)
昇腾硬件:Ascend950DT
CANN:9.2.0
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
pypto.set_vec_tile_shapes(16, 80)
c1、input_a_view_2d 的形状均为 [16, 64]
cat_s2 = pypto.concat([c1, input_a_view_2d], dim=-1)
v3_view = pypto.view(
cat_s2, [16, 128], [0, 0],
valid_shape=[bs_valid, 128],
)
v3 = pypto.fillpad(v3_view, "constant", 0.0)
weight_s2 = pypto.full([128, 64], 0.5, dtype=pypto.DT_FP32)
c2 = pypto.matmul(v3, weight_s2, out_dtype=pypto.DT_FP32)
Describe the expected behavior / 预期结果 (Mandatory / 必填)
精度正确
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
实现运行结果:
case_idx: 148
case_name: mix_1c2v_VCV_Serial_Parallel_float32_h64_nondiv_148
result: FAILED
output_1: PASS
output_2: FAILED
output_3: FAILED
pipemix_result: PASS
原始 CCE 中的关键调用:
// 两个分块均使用 LocalLayout2Dim<16, 128>
// 后48列:地址偏移80个float,目标shape为[16,48]
TFillPadpto::PadValueCustom((float)0.f)(ubTensor_65, ubTensor_66);
// 前80列:目标shape为[16,80]
TFillPadpto::PadValueCustom((float)0.f)(ubTensor_67, ubTensor_68);
Special notes for this issue/备注 (Optional / 选填)