已合并
fix(machine): Stop raising stitch_function_max_num with unroll in non-memory-driven mode #5434
songyangyang18创建于 8月13日
fix(machine): Stop raising stitch_function_max_num with unroll in non-memory-driven mode #5434
已合并
songyangyang18创建于 8月13日
songyangyang18成员
8月13日

Summary

  • 未配置 max_workspace_kb(非内存驱动)时,stitchNumMax 直接使用 stitch_function_max_num 配置值,不再与 maxUnrollTimes 取 max。
  • 补全 !4979 回退后 encode 侧遗漏:runtime 已按 root 个数计量,但 encode 仍会把配置抬到 ≥UnrollN,导致小 stitch_function_max_num 实际不生效。
  • 已配置 max_workspace_kb(内存驱动)时行为不变,仍走 EffectiveStitchNumMax。

问题

!4395 引入 EffectiveStitchNumMax = max(配置, maxUnrollTimes);!4979 回退了 runtime 的 StitchUnits 计量与文档(改为按 root 个数、与 unroll 无关),但未改 encode。
结果例如:unroll_list=[128] 且 stitch_function_max_num=1 时,实际 stitch 深度仍被抬到 128。

修改

LoadRuntimeWorkspaceConfig:

  • maxWorkspaceBytes == 0 → ConfiguredStitchFunctionMaxNum()
  • 否则 → EffectiveStitchNumMax(maxUnrollTimes)(MD 路径保持)
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 songyangyang18 的贡献)
Ssongyangyang18成员
8月13日 创建了 pull request,commit 558e6198
atomgit-bot
atomgit-bot
8月13日 评论:

变更摘要

本 PR 修复了 LoadRuntimeWorkspaceConfig 中 stitchNumMax 的计算逻辑:在非内存驱动模式下不再使用 EffectiveStitchNumMax(maxUnrollTimes) 并根据 unroll 次数抬高 stitch_function_max_num,而是改为根据 maxWorkspaceBytes 是否为 0 来区分计算方式,从而在非内存驱动模式下回退到 ConfiguredStitchFunctionMaxNum() 配置值。

主要改动

  • 调整 stitchNumMax 的计算顺序:将 cfg.stitchNumMax 的赋值移动到 cfg.maxWorkspaceBytes = GetMaxWorkspaceBytes() 之后,使其能够依据 maxWorkspaceBytes 进行条件判断。
  • 新增非内存驱动模式分支:当 cfg.maxWorkspaceBytes == 0 时,stitchNumMax 改用 ConfiguredStitchFunctionMaxNum(),避免在非内存驱动模式下因 unroll 次数抬高 stitch 函数最大数量。
  • 保留内存驱动模式原逻辑:当 cfg.maxWorkspaceBytes != 0 时,仍使用 EffectiveStitchNumMax(maxUnrollTimes) 计算 stitchNumMax,原有行为不变。
likedislike
不准确?
atomgit-bot
atomgit-bot
8月13日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
8月13日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
8月13日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/pypto ✅ jason_yuan_ye, gaoxingwang (2/2) ✅ jason_yuan_ye (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

songyangyang18, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
此处折叠了84条消息 查看更多
CANN-robot
CANN-robot成员
8月18日 评论:

流水线任务触发成功
任务链接 [cb43ed57b318443188ce3f5ff9b76429][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
UT_Test_Py3_ninja_simulation ✅ SUCCESS
UT_Test_Py3_ninja ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_1 ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_2 ✅ SUCCESS
UT_Test_Cpp_make_gnu_part_3 ✅ SUCCESS
UT_Test_Cpp_make_clang_part1 ✅ SUCCESS
UT_Test_Cpp_make_clang_part2 ✅ SUCCESS
UT_Test_Cpp_make_clang_part3 ✅ SUCCESS
UT_Test_kirinx90 ✅ SUCCESS
UT_Test_kirin9030 ✅ SUCCESS
UT_Test_report ✅ SUCCESS >>>>>
PreSmoke_A900 ✅ SUCCESS >>>>>

[2026-08-18 16:45:41]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
8月18日 评论:

流水线任务触发成功
任务链接 [ae975d6e21214188b5fc852bc3574c50][流水线指导]

任务名称状态日志下载链接
get_pr_file ✅ SUCCESS
static-check ✅ SUCCESS
compile ✅ SUCCESS

[2026-08-18 16:46:23]    CI执行结束

likedislike
CANN-robotCANN-robot成员
8月18日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月18日 添加了label:ci-pipeline-passed
CANN-robotCANN-robot成员
8月18日 合入了pull request