Pull Request已成功合入, 合并人@CANN-robot
(感谢 songyangyang18 的贡献)变更摘要
本 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,原有行为不变。


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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


流水线任务触发成功
任务链接 [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执行结束


流水线任务触发成功
任务链接 [ae975d6e21214188b5fc852bc3574c50][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| get_pr_file | ✅ SUCCESS | ||
| static-check | ✅ SUCCESS | ||
| compile | ✅ SUCCESS |
[2026-08-18 16:46:23] CI执行结束


Summary
max_workspace_kb(非内存驱动)时,stitchNumMax直接使用stitch_function_max_num配置值,不再与maxUnrollTimes取 max。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 路径保持)