已合并
fix: support quantized NPU flip dispatch #36068
hz893创建于 5月19日
fix: support quantized NPU flip dispatch #36068
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 hz893 的贡献)ascend-robot
5月19日 评论:
5月19日 评论:
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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-Ascend/pytorch | ✅ chujinjin, hbhu_bin (2/2) | ✅ chujinjin (1/1) |
| test | ✅ chujinjin, hbhu_bin (2/2) | ✅ chujinjin (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
hz893, thanks for your pull request. All authors of the commits have signed the CLA. 👍


5月19日 添加了label:ascend-cla/yes
ascend-robot
5月19日 评论:
5月19日 评论:
当前仓库存在以下 保护分支 :
| Protected Branch | Version | Release |
|---|---|---|
| master | ||
| v2.11.0 | ||
| v2.10.0 | ||
| v2.9.0 | ||
| v2.7.1 | ||
| v2.12.0 |
评论 /sync <branch1> <branch2> ... 可将当前 PR 修改同步到其它分支(创建同步 PR):
a) 如果当前 PR 是 Open 状态,同步操作将延迟到 PR 被合并时执行
b) 如果当前 PR 已经 Merged,将立即执行同步操作
注意:
- /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
- 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭


ascend-robot
5月19日 评论:
5月19日 评论:
Ascend docs pipeline is running...


此处折叠了106条消息 查看更多
6月5日 添加了label:approvedlgtm
6月5日 合入了pull request
ascend-robot
6月5日 评论:
6月5日 评论:
流水线 pytorch_gitcode_PR_multiVersion#10029 [ commitID:3cac10af ] 已完成


【合入来源】
说明:修复 NPU 量化 tensor 执行
flip时的分发与错误语义问题,并补充 CI 中暴露的 complex dtype 测试处理。【修改方案】
flip实现,并在 codegen stub 中注册QuantizedPrivateUse1对应 kernel,使量化 NPU tensor 进入专用实现。int_repr()获取底层整型表示,再转发到普通aten::flip;随后使用原 tensor 的 size、dtype、scale、zero_point 和 memory format 构造量化结果,并通过set_复用翻转后的底层存储。quint4x2、quint2x4保持不支持报错;对 per-channel quantized tensor,先执行维度合法性检查,再按 CPU/CUDA 语义报出 uniformly quantized 相关错误,保证错误优先级一致。test_shape_ops.py中补充 NPU 专用 complex skip:仅当NPU + jit_compile=True + dtype.is_complex时跳过flip/flip_errors/flip_numpy/fliplr/flipud相关 complex 用例,规避当前jit_compile=True下 NPU 无法创建 complex tensor 的既有限制。该 skip 不影响 CPU/CUDA,也不影响 NPUjit_compile=False路径。【资料变更】
不涉及。
【接口变更】
不涉及跨仓或客户面可见接口变更。
【功能验证】
quint8、qint8、qint32per-tensor affine 结果与 CPU/CUDA 语义一致。jit_compile=True下 10 个 complex flip 实例均按预期 skip:OK (skipped=10)。int64/float64仍正常执行并通过。【CheckList】