pre_quant doc & verify#922
Conversation
Codex Review该评论由 review 机器人自动更新。
SummaryReview failed at stage Findings未生成结构化 findings,因为 review 过程提前失败。 Log Tail |
There was a problem hiding this comment.
Code Review
This pull request introduces validation and verification for pre_quant modes and destination types in the PTO compiler. It adds destination family mapping and verification in C++ (VPTO.cpp), payload and mode validation in Python (_ops.py), updates user documentation, and adds corresponding JIT and LIT tests. The feedback points out that the no_convert mode incorrectly triggers a TypeError in the Python validation logic because it is subjected to the scalar payload check, and suggests skipping validation for this mode.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if normalized_mode.endswith("_vec"): | ||
| if not _is_acc_store_scaling_pointer_payload(payload): | ||
| raise TypeError( | ||
| "acc store vector pre_quant payload must be a scaling pointer " | ||
| "with f16, bf16, or f32 elements" | ||
| ) | ||
| else: | ||
| if not _is_acc_store_float_scalar_payload(payload): | ||
| raise TypeError( | ||
| "acc store scalar pre_quant payload must be an f16, bf16, or f32 scalar" | ||
| ) |
There was a problem hiding this comment.
对于 no_convert 模式,由于不需要进行量化或转换,因此不应该强制要求 payload 必须是 float 标量。在当前的逻辑中,如果 normalized_mode 为 no_convert,它会进入 else 分支并触发 TypeError。
建议对 no_convert 模式进行特殊处理,跳过 payload 的类型校验。
if normalized_mode == "no_convert":
pass
elif normalized_mode.endswith("_vec"):
if not _is_acc_store_scaling_pointer_payload(payload):
raise TypeError(
"acc store vector pre_quant payload must be a scaling pointer "
"with f16, bf16, or f32 elements"
)
else:
if not _is_acc_store_float_scalar_payload(payload):
raise TypeError(
"acc store scalar pre_quant payload must be an f16, bf16, or f32 scalar"
)
TODO:
ci已过,人工再审查一下文档