已关闭
[Bug-Report|缺陷反馈]: qfa ttk修复图模式下泛化layout时batch size传参错误 #5427
yangxh1203创建于 22 天前关闭于 22 天前
22 天前 添加了label:bug-report
游震
22 天前 评论:
22 天前 评论:
/assign @yangxh1203


22 天前 将 yangxh1203 设为负责人
22 天前 关闭了 issue
22 天前 添加了label:resolved
/assign @yangxh1203


Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
qfa ttk修复图模式下泛化layout时batch size传参错误,表格传batch size了,但是算子没获取到:
[GRAPH] 构建 metadata (quant_flash_attn_metadata)
[Prefill_HIFP8_HIFP8_BF16_Prof_L0_pertensor_4_24_3_32_32_128_128_BNSD_LSE_000038_test] Error: call aclnnQuantFlashAttnMetadata failed, detail:[PID: 3131002] 2026-09-18-02:03:15.419.723 AclNN_Runtime_Error(EZ9903): batchSize must be -1 or greater than 0, but got 0
Solution: In this scenario, collect the plog when the fault occurs and locate the fault based on the plog.
Traceback (most recent call last):
File "/home/y00938753/ops-test-kit/ttk/core_modules/framework_api/profiling.py", line 308, in profile_process
_do_profile(testcase, backend, device_grant_events, device_granted_indices, dev_id, switches, return_struct)
File "/home/y00938753/ops-test-kit/ttk/core_modules/framework_api/profiling.py", line 1270, in _do_profile
graph_aclgraph_nps, graph_aclgraph_perf, graph_aclgraph_det = graph_fn(
File "/home/y00938753/ops-test-kit/ttk/core_modules/framework_api/graph_execution.py", line 325, in _execute_graph
model = custom_cls(**init_kwargs)
File "/home/y00938753/ops-transformer/attention/quant_flash_attn/tests/assets/impl/graph.py", line 362, in init
self.metadata = torch.ops.cann_ops_transformer.quant_flash_attn_metadata(
File "/home/y00938753/anaconda3/envs/yxh/lib/python3.9/site-packages/torch/_ops.py", line 1158, in call
return self._op(*args, **(kwargs or {}))
File "/home/y00938753/Ascend0917/cann/python/site-packages/cann_ops_transformer/ops/attention/quant_flash_attn/quant_flash_attn.py", line 360, in quant_flash_attn_metadata
return op_module.quant_flash_attn_metadata(
File "/home/y00938753/Ascend0917/cann/python/site-packages/cann_ops_transformer/utils/arg_check.py", line 524, in wrapper
return fn(*args, **kwargs)
RuntimeError: call aclnnQuantFlashAttnMetadata failed, detail:[PID: 3131002] 2026-09-18-02:03:15.419.723 AclNN_Runtime_Error(EZ9903): batchSize must be -1 or greater than 0, but got 0
Solution: In this scenario, collect the plog when the fault occurs and locate the fault based on the plog.
Environment Information / 环境信息 (Mandatory / 必填)
Ascend 950
cann 9.2.0
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
qfa ttk执行aclgraph
Describe the expected behavior / 预期结果 (Mandatory / 必填)
不被拦截正常执行
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
split_count:393216.0; max_diff_hd:10.0;
Loop ExpectOut RealOut FpDiff RateDiff
00000001 0.0892291 0.0893555 0.0001264 0.0014167
00000002 0.1379845 0.1376953 0.0002891 0.0020955
00000003 -0.0750700 -0.0751953 0.0001254 0.0016699
00000004 0.0279620 0.0279541 0.0000079 0.0002825
00000005 -0.1037444 -0.1035156 0.0002287 0.0022048
00000006 -0.0773408 -0.0771484 0.0001923 0.0024867
00000007 0.1008947 0.1010742 0.0001795 0.0017789
00000008 0.0197693 0.0197754 0.0000061 0.0003074
00000009 0.0452379 0.0451660 0.0000719 0.0015888
00000010 0.0628254 0.0629883 0.0001628 0.0025918
... ... ... ... ...
00393207 -0.1154928 -0.1157227 0.0002299 0.0019906
00393208 -0.0129531 -0.0129395 0.0000136 0.0010538
00393209 -0.0655923 -0.0654297 0.0001626 0.0024792
00393210 -0.0363789 -0.0363770 0.0000020 0.0000543
00393211 -0.0066144 -0.0066223 0.0000080 0.0012041
00393212 -0.0526392 -0.0527344 0.0000952 0.0018080
00393213 0.1914028 0.1914062 0.0000035 0.0000182
00393214 -0.0520880 -0.0520020 0.0000861 0.0016521
00393215 0.2554793 0.2558594 0.0003801 0.0014878
00393216 -0.0066144 -0.0066223 0.0000080 0.0012041
Rtol Atol PctThd PctRlt Result
0.0078 0.000100 99.50% 100.000000% Pass
[COMPARE] out1: csv rtol=0.0078125 atol=0.0001 diff_thd=0.005 pct_thd=0.005 max_diff_hd=10.0
[COMPARE] out1: npu_shape=(4, 24, 32) npu_dtype=torch.float32 | golden_shape=(4, 24, 32) golden_dtype=torch.float32
split_count:3072.0; max_diff_hd:10.0;
Loop ExpectOut RealOut FpDiff RateDiff
00000001 3.5030637 3.5030637 0.0000000 0.0000000
00000002 3.6087890 3.6087890 0.0000000 0.0000000
00000003 3.5150175 3.5150175 0.0000000 0.0000000
00000004 3.3893614 3.3893614 0.0000000 0.0000000
00000005 3.4756355 3.4756355 0.0000000 0.0000000
00000006 3.5485668 3.5485668 0.0000000 0.0000000
00000007 3.5197606 3.5197606 0.0000000 0.0000000
00000008 3.4784498 3.4784498 0.0000000 0.0000000
00000009 3.5029931 3.5029931 0.0000000 0.0000000
00000010 3.4561915 3.4561915 0.0000000 0.0000000
... ... ... ... ...
00003063 3.1741099 3.1741099 0.0000000 0.0000000
00003064 3.0837293 3.0837293 0.0000000 0.0000000
00003065 2.9806747 2.9806747 0.0000000 0.0000000
00003066 3.0594025 3.0594025 0.0000000 0.0000000
00003067 3.1390514 3.1390514 0.0000000 0.0000000
00003068 3.0320268 3.0320268 0.0000000 0.0000000
00003069 2.9808788 2.9808788 0.0000000 0.0000000
00003070 3.0636263 3.0636263 0.0000000 0.0000000
00003071 2.9301758 2.9301758 0.0000000 0.0000000
00003072 3.0810237 3.0810237 0.0000000 0.0000000
Rtol Atol PctThd PctRlt Result
0.0078 0.000100 99.50% 100.000000% Pass
Special notes for this issue/备注 (Optional / 选填)