| Files | Last commit | Last update |
|---|---|---|
fix(FeedsRepeat): golden third_party repeats 跟随 feeds 设备 Co-authored-by: xuxiao59<xuxiao59@huawei.com> # message auto-generated for no-merge-commit merge: !7071 merge fix/feeds_repeat into master fix(FeedsRepeat): golden third_party repeats 跟随 feeds 设备 Created-by: gcw_xYUkRrAH Commit-by: xuxiao59 Merged-by: cann-robot Description: ## 描述 FeedsRepeat golden 的 third_party 三方标杆在 xpu/CUDA 端点执行时设备不匹配报错,本 PR 修复其张量设备跟随问题。 **问题现象**:CI 回归 xpu 通路( --xpu-perf)对 FeedsRepeat 用例比对失败,服务端 500: RuntimeError: Expected all tensors to be on the same device, but got index is on cpu, different from other tensors on cuda:0 (when checking argument in method wrapper_CUDA_index_select) **根因**:_TorchFeedsRepeat.__call__ 中 repeats = torch.tensor(repeat_list, dtype=torch.int64) 未带 device(建在 CPU),而 xpu 端点上 feeds 在 cuda:0——torch.repeat_interleave 内部走 index_select 时设备不匹配。同函数的输出张量(torch.zeros(..., device=feeds.device)、repeated[:n].to(feeds.device))均有设备处理,唯独 repeats 漏了。 **修复**(conversion/feeds_repeat/tests/assets/golden.py,4 行): - repeats 加 device=feeds.device(问题本体); - _compute 输出 zeros 同步跟随 feeds_t.device(同类隐患防御,消除隐式跨设备赋值)。 与 operator-artifacts 仓 PR(opencann/operator-artifacts#321)的 FeedsRepeat golden 修复为同内容同步,两仓修复合入后 golden bit-exact 一致。 ## 关联的Issue - https://gitcode.com/wangyueting/changwei_liuyi/issues/119(xpu 通路比对失败原始问题单) ## 测试 - NPU 设备路径等价模拟 CUDA 端点(设备一致性语义同构):修复前复现同款 RuntimeError,修复后 5 场景全部通过(混合设备/全设备/third_party/主 golden/深度截断场景),输出与 CPU 基准逐位一致; - CPU 路径回归无变化:device 参数对 CPU 无副作用,截断/负值钳 0/填满语义不变(golden 数值语义零触碰)。 ## 文档更新 无(仅测试资产 golden.py,不涉及 README/文档变更)。 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7071 | 15 days ago |