Pull Request已成功合入, 合并人@CANN-robot
(感谢 陈海杰 的贡献)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 |
|---|---|---|
| quant | ✅ gcw_kUomxQ2l, 唐玮玮 (2/2) | ✅ gcw_kUomxQ2l (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
chenhaijie1423, thanks for your pull request. All authors of the commits have signed the CLA. 👍


问题/功能描述
本次PR旨在优化两个C++头文件中的整数除法计算逻辑,以提升计算效率和代码简洁性。原实现通过浮点数转换进行除法计算,存在不必要的性能开销和潜在的浮点精度风险,本次修改移除了该转换过程。
修改方案描述
将 flat_quant_cube.h 和 flat_quant_cube_one.h 文件中计算 invalidK 变量的表达式,从 static_cast<int64_t>(static_cast<float>(shape.K * shape.M - shape.Mceil) / static_cast<float>(shape.M)) 简化为 (shape.K * shape.M - shape.Mceil) / shape.M。该修改直接使用整数除法,消除了浮点转换开销和精度风险,使逻辑更清晰。


流水线任务触发成功
任务链接 [3e317d7681c54e29b1de1855d897a822][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Pre_Compile | ✅ SUCCESS | ||
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_monitor | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| Smoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| ATK_Test_A2 | ✅ SUCCESS |
[2026-04-20 15:01:12] CI执行结束


流水线任务触发成功
任务链接 [43f3eb93fb614d3fa4c76d15bad44acd][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| anti_virus | ✅ SUCCESS | >>>>> | |
| Check_Pr | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS |
[2026-04-20 15:00:32] CI执行结束


/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
唐玮玮


/lgtm


/approve


Review Guide
This pull-request passes review.
Committers who wrote a comment of /approve are: gcw_kUomxQ2l.
Reviewers who wrote a comment of /lgtm are: gcw_kUomxQ2l, 唐玮玮.


描述
FlatQuant修复大shape内存检测问题
关联的Issue
https://gitcode.com/cann/ops-nn/issues/2172
测试
用单算子OOM包验证1400条泛化用例,功能和精度全部OK
文档更新
不涉及
类型标签