# tmp **Repository Path**: hexchip_admin/tmp ## Basic Information - **Project Name**: tmp - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-05-20 - **Last Updated**: 2025-05-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 掩码索引(Mask Indexing)异常耗时 x = x[filt] 使用香橙派AI-pro(20T),芯片是310B。 CPU执行14ms, 而NPU执行需要329ms。 ## 复现流程 执行下列代码: python test_cpu.py 得到下列输出: ``` filt device = cpu filt shape = torch.Size([6300]) filt dtype = torch.bool x device = cpu x shape = torch.Size([6300, 84]) x dtype = torch.float16 Elapsed time is 14.021425000009913 ms ``` 执行下列代码: python test_npu.py 得到下列输出: ``` filt device = npu:0 filt shape = torch.Size([6300]) filt dtype = torch.bool 2025-05-20 17:36:30.290631: E external/org_tensorflow/tensorflow/core/framework/node_def_util.cc:676 NodeDef mentions attribute T which is not in the op definition: Op output:dtype; attr=dtype:type,default=DT_FLOAT,allowed=[DT_HALF, DT_BFLOAT16, DT_FLOAT, DT_DOUBLE]; attr=Tshape:type,default=DT_INT32,allowed=[DT_INT32, DT_INT64]> This may be expected if your graph generating binary is newer than this binary. Unknown attributes will be ignored. NodeDef: {{node StatelessRandomUniformV2}} x device = npu:0 x shape = torch.Size([6300, 84]) x dtype = torch.float16 Elapsed time is 329.4287999997323 ms ```